-
Notifications
You must be signed in to change notification settings - Fork 202
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
Add allowed signing algorithms in validator #128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
PS384 = SignatureAlgorithm("PS384") // RSASSA-PSS using SHA384 and MGF1-SHA384 | ||
PS512 = SignatureAlgorithm("PS512") // RSASSA-PSS using SHA512 and MGF1-SHA512 | ||
) | ||
|
||
// Validator to use with the jose v2 package. | ||
type Validator struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this type need to be exported? It has a field of type jwt.Expected
, which is from the underlying library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we can't make it private because of the following linting error:
validator/validator.go:65:4: unexported-return: exported func New returns unexported type *validator.validator, which can be annoying to use (revive)
) (*validator, error) {
The field type of jwt.Expected
is not exported so there should not be any issues IMO:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just left a comment about the Validator
struct.
a77e338
to
5d3c76a
Compare
Codecov Report
@@ Coverage Diff @@
## master #128 +/- ##
=======================================
Coverage 89.32% 89.32%
=======================================
Files 7 7
Lines 178 178
=======================================
Hits 159 159
Misses 12 12
Partials 7 7
Continue to review full report at Codecov.
|
Had to push again as the github actions were stuck. |
Description
In this PR we add allowed signing algorithms for the validator.
References
Testing
Checklist
master
.