-
Notifications
You must be signed in to change notification settings - Fork 266
On reload don't store duplicated keys #553
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
cd6fbcf
If a key bundle is reloaded care should be taken to not store keys th…
rohe 8708520
If a key bundle is reloaded care should be taken to not store keys th…
rohe 7f3b96f
Not part of the 0.14.0 release
rohe 5c48955
Moved JWKS definitions out of test_keyio.py
rohe 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ The format is based on the [KeepAChangeLog] project. | |
| ## 0.14.0 [2018-05-15] | ||
|
|
||
| ### Fixed | ||
| - [#553] Made sure a a reload would not lead to duplicated keys in a keybundle. | ||
| - [#534] Fixed a bug in client_secret_basic authentication | ||
| - [#503] Fix error on UserInfo endpoint for removed clients | ||
| - [#508] JWT now uses verify keys for JWT verification | ||
|
|
@@ -45,6 +46,7 @@ The format is based on the [KeepAChangeLog] project. | |
| [#532]: https://github.com/OpenIDC/pyoidc/pull/532 | ||
| [#498]: https://github.com/OpenIDC/pyoidc/issues/498 | ||
| [#534]: https://github.com/OpenIDC/pyoidc/pull/534 | ||
| [#553]: https://github.com/OpenIDC/pyoidc/pull/553 | ||
|
||
|
|
||
| ## 0.13.1 [2018-04-06] | ||
|
|
||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -575,3 +575,28 @@ def test_load_spomky_keys(): | |
| kj = KeyJar() | ||
| kj.import_jwks(JWKS_SPO, '') | ||
| assert len(kj.get_issuer_keys('')) == 4 | ||
|
|
||
|
|
||
| def test_reload(): | ||
| """ | ||
| Emulates what happens if you fetch keys from a remote site and | ||
| you get back the same JWKS as the last time. | ||
| """ | ||
| _jwks = { | ||
| "keys": [ | ||
| { | ||
| "alg":"RS256", | ||
| "e":"AQAB", | ||
| "kty":"RSA", | ||
| "n":"wkpyitec6TgFC5G41RF6jBOZghGVyaHL79CzSjjS9VCkWjpGo2hajOsiJ1RnSoat9XDmQAqiqn18rWx4xa4ErdWVqug88pLxMVmnV9tF10uJNgIi_RSsIQz40J9aKrxOotN6Mnq454BpanAxbrbC5hLlp-PIGgmWzUDNwCSfnWBjd0yGwdYKVB6d-SGNfLvdMUhFiYIX0POUnJDNl_j3kLYQ0peYRbunyQzST5nLPOItePCuZ12G5e0Eo1meSF1Md3IkuY8paqKk-vsWrT22X7CUV3HZow06ogRcFMMzvooE7yDqS53I_onsUrqgQ2aUnoo8OaD0eLlEWdaTyeNAIw","use":"sig" | ||
|
||
| }]} | ||
|
|
||
| kb = KeyBundle() | ||
| kb.imp_jwks = _jwks | ||
| kb.do_keys(kb.imp_jwks['keys']) | ||
|
|
||
| assert len(kb) == 1 | ||
|
|
||
| kb.do_keys(kb.imp_jwks['keys']) | ||
|
|
||
| assert len(kb) == 1 | ||
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.
This should not be in the 0.14.0 section.
Open a new section for still unreleased changes on top.
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.
Got it