-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat: #1974 changes for mirroring custom claims #2545
feat: #1974 changes for mirroring custom claims #2545
Conversation
…er "ext" if not reserved
Thank you for these changes and ideas! Unfortunately, the CI is currently failing and we also need some tests. The approach though is correct (adding the config flag, parsing the config flag, and echoing the session correctly without ext)! :) |
Hey! I added some local tests which pass and am still trying to figure out how to get objects from the config. |
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.
Nice, found some hints that should help you finish this 😉
…s; added custom config option to config.json
…SessionWithCustomClaims(subject, nil), so less refactoring
It seems like session_custom_claims_test.go still passes all cases, I'm waiting for the CI results.
I'm trying to find out what's happening there and write tests to check for the correct behaviour.
|
I've merged with master - for test instructions see: https://github.com/ory/hydra/blob/master/README.md#develop |
Sorry, I forgot that! Do you want to also be able to set these allowed claims by environment variable? (maybe this even happens automatically, I did not look into it yet) I'm also gonna look into the documentation and try to extend it. |
Oops, forgot to format! |
…' into hydra-1974-custom-claims-top-level
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.
Yo, good job! Sorry for the long review time!
This is a very welcome feature for my usecase. Unfortunately all attempts to make it work failed. I added the custom claim "my_claim to my config but hydra won't allow to start The configuration contains values or keys which are invalid:
Any hints what I am doing wrong? |
Hi @vaggvisa, |
I followed the instructions for a Docker based installation, basically
|
In my understanding, what you did is Doing what you did results in having the newest source code locally, but using the released 1.10.2 image which is being pulled from the DockerHub (because that's what's used in the quickstart.yml). Hope that helped, let me know if I might have misunderstood something! ;)
|
Oh boy! You saved my day - it works! Thanks for pointing out to rebuild the hydra image myself. |
Alright, glad I could help :)
|
How long will the claims be mirrored to |
Related issue
#1974
Proposed changes
As described in #1974 custom claims are currently put under "ext".
For a transition period @aeneasr suggested that custom claims get put top-level and mirrored under "ext" (i.e. for backwards compatibility).
The original author of #1974 suggested using a configuration flag for custom claims which are allowed to go top-level.
I'm new to Go, but tried to implement the said features.
Checklist
vulnerability. If this pull request addresses a security. vulnerability, I
confirm that I got green light (please contact
security@ory.sh) from the maintainers to push
the changes.
works.
Further comments
I'm happy for advice on how to retrieve config/env flags to use in the code and other coding guidelines I might have missed :)
I should have mentioned, that I wrote with @zepatrik on Slack, who told me to create a draft PR, so my code of the concept could be seen.