Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec for verify_strict/3 missing {class, reason} results from try/catch #164

Open
brian-bk opened this issue Apr 9, 2024 · 1 comment
Open

Comments

@brian-bk
Copy link

brian-bk commented Apr 9, 2024

I'm not an elixir expert, so apologies if I'm understanding this issue incorrectly. When trying to upgrade jose to 1.11.9, there's an added spec to verify_strict/3:

@spec verify_strict(t(), [String.t()], binary()) :: {valid? :: boolean(), jwt :: t(), jws :: JOSE.JWS.t()}

Our dialyzer check for our application is failing because we were anticipating such results like {:error, reason} in addition to the currently spec'd {valid? :: boolean(), jwt :: t(), jws :: JOSE.JWS.t()}. I believe that the catch result should also be added to the type spec, here is the catch code block:

erlang-jose/lib/jose/jwt.ex

Lines 352 to 355 in 09de6d2

catch
class, reason ->
{class, reason}
end
.

@jareddellitt
Copy link
Contributor

We're also seeing a failure, but I think it's related to the t(). The function accepts a %JOSE.JWK{}, but the typespec states it accepts %JOSE.JWT{}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants