-
Notifications
You must be signed in to change notification settings - Fork 25
WIP: Introduce add_claims_by_scope per client configuration #113
WIP: Introduce add_claims_by_scope per client configuration #113
Conversation
Thank you @ctriant |
95dbdeb
to
1401fb9
Compare
unit tests fails, some changes are required |
On it |
1401fb9
to
d294ab0
Compare
Ok I'd merge It now but I'm wondering that It needs to be documented, otherwise only the code would show this feature. @ctriant can you put a brief note on this feature, how It works with a short example? |
Hey @peppelinux, please see if the example on the MR description helps. Thanks! |
@CRiant yes it helps https://github.com/IdentityPython/oidc-op/blob/master/docs/source/contents/conf.rst @rohe ^ |
Shouldn't this be per client? E.g introduce the options |
@nsklikas Since we have the client parameters Also, we might want to think about structuring this is some way.
we could have (to improve readability)
Just a thought. |
d294ab0
to
a84eadf
Compare
I prefer the flat model. I think it's easier to handle and it makes the type of our fields simpler (if we want to add pydantic or something similar in the future it will probably be easier to describe primitive types rather than complex dicts) Having said that I have no hard objections against the nested model roland suggested and I agree that it also has certain advantages (e.g. all the information is gathered in one dict so it's easier to access) |
406068c
to
78cae68
Compare
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.
@peppelinux i think we better revert this MR because it was a WIP. |
I should have known during the last developer meeting and this PR should have been a draft. How long does it take to complete this feature? we will make a release solely to cover this issue, I beg you to give priority to this |
The MR was marked as WIP so I thought this was enough to be considered as draft. Sorry for the inconvenience @peppelinux . |
don't worry, for the next time create drafts and non-PRs and switch to PR when ready for final revisions. what time do you have to finish this WiP? |
The implementation follows the proposed scheme by @rohe . If we decide not to adopt this proposal I have to revert some changes. Then add some tests. I think there is no much work needed to close it. |
yes I saw unit tests and I pushed an example in the documentation, it works as it is, please add your minor changes and unit test for the next, imminent, release and thank you for all of this |
This MR enables per client configuration for add_claims_by_scope parameter.
If configuration for specific client exists, it overrides the global configuration.
For example consider the following list of clients and that the default oidc-op configuration sets
add_claims_by_scope = True
:Also consider the two clients form the following authorization request where
CLIENT_ID
is "client1" and "client2" respectively:As long as for "client1"
add_claims_by_scope = False
, the returned claims will be the union of the base claims and the explicit claims requested for this user givenenable_claims_per_client = True
.On the other hand, for "client2" the returned claims will be the same as for "client1" plus the the claims that correspond to the requested scopes after
oidcop.scopes.convert_scopes2claims()
is applied.