-
Notifications
You must be signed in to change notification settings - Fork 374
feat: Authorization Grants using JWT #546
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.
8000
Sign up for GitHub
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
Closed
Closed
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5bd00a4
feat: add ability to disable client authentication in token endpoint …
95798e7
feat(oauth2): add handler for authorize grant via jwt bearer
7e04502
fix(oauth2): mark jwt as used, if kid is provided in token
df5b6f1
refactor(oauth2): change err msg when no public key found for auth gr…
fd1ae59
feat(storage): add implementation of JWTAuthGrantStorage in MemoryStore
1509763
feat(compose): add support for AuthorizeJwtGrantHandler in compose
02992f7
fix(oauth2): fix incorrect message when validating assertion prerequi…
0e14733
fix(oauth2): fix nil pointer if all public keys didn't match in Autho…
18267a6
refactor(oauth2): change order of token validation in AuthorizeJwtGra…
b406a62
test: added unit tests for AuthorizeJwtGrantHandler
0d11ebd
fix(oauth2): fill session with subject, scopes, audience correctly in…
ca7f8a9
test: fix test assertion
f1a93b0
fix(oauth2): fix audience grant in AuthorizeJwtGrantHandler
9cba91b
feat(oauth2): add additional check for exp claim in AuthorizeJwtGrant…
665b957
cases for jwt bearer authorization grand creation
seliverstov-tinkoff db0aafa
draft introspection cases of jwt bearer
seliverstov-tinkoff db506b9
add clients for jwt bearer test
seliverstov-tinkoff 38afdae
introspect token expired test
seliverstov-tinkoff a9de527
add constants for tests and few test on introspect token
seliverstov-tinkoff af01a48
use jose for jwt generation in tests
seliverstov-tinkoff 7dea172
rename jwt bearer tests
seliverstov-tinkoff 92bee79
introspection auth header store in suite
seliverstov-tinkoff ade7901
fix TestSuccessResponseWithMultipleScopesToken test
seliverstov-tinkoff 6cf3d51
refactor: client authentification handling
27babf5
fix(oauth2): fix code style, naming and jwt token validation
418ddc3
fix(oauth2): mark jwt as used only after all checks
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Where does this client come from? Shouldn't the client be nil? What I also don't fully understand is -
store := internal.NewMockStorage(ctrl)
does not seem to have any EXPECT calls?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.
It is default empty client struct. When Request is created default value is used for client, so it is just an empty struct. So we are checking, that even without client auth (and hence storage wont be called, and client struct will stay empty) everything is working.
Considering storage - it is not expected to be called, because we are not passing any client credentials. However i agree that it is not very clear why is that. That's why i will add case, where we WILL pass client credentials and in other cases will add explicit instruction, that we are not expecting storage to be called.
Uh oh!
There was an error while loading. Please reload this page.
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.
Also i am suggesting to rewrite the whole tests in this file completely, because each test affects other test, because they share mocks and other vars which results in that test cases are not isolated from each other. That's why new tests that were added in this PR were made using
suite
package of testify. Only in this file i write new test cases in the same style as old ones.If you are not against this idea maybe i can rewrite them using suite, but i will made it in separate PR.