feat: add token request hooks for all grant types#3427
feat: add token request hooks for all grant types#3427aeneasr merged 9 commits intoory:masterfrom sgal:feat-add-request-hooks-for-all-grant-types
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3427 +/- ##
==========================================
- Coverage 76.83% 76.82% -0.01%
==========================================
Files 123 124 +1
Lines 9125 9160 +35
==========================================
+ Hits 7011 7037 +26
- Misses 1666 1673 +7
- Partials 448 450 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
hperl
left a comment
There was a problem hiding this comment.
This looks very good! I just had some minor questions & suggestions.
|
@hperl I fixed the comments, please have a look! |
aeneasr
left a comment
There was a problem hiding this comment.
Very nice changes, just two minor remarks
|
@aeneasr I fixed the following parts:
Please have a look. |
|
Docs are also updated - ory/docs#1241 |
...ion=should_pass_request_if_strategy_passes-should_call_refresh_token_hook_if_configured.json
Show resolved
Hide resolved
spec/config.json
Outdated
| "format": "uri", | ||
| "examples": ["https://my-example.app/token-refresh-hook"] | ||
| }, | ||
| "authorization_code_hook": { |
There was a problem hiding this comment.
Do we need all of these config elements? Maybe it makes more sense to have one endpoint and pass the grant type and let the webhook deal with that?
There was a problem hiding this comment.
Yeah, that makes much more sense. Let me take a stab at it.
There was a problem hiding this comment.
To keep backwards compatibility we could also just add a new key "hook" and deprecate the refresh token hook at some point. That way we don't break BC?
|
@aeneasr Changed to having a generic |
|
@fehrnah FYI, it's finally in! Thanks for laying the foundation for this feature 👍 |
Congratulations! |
|
Thank you both :) |
Added a generic token hook that is called for all grant types and includes `payload` with a single allowed value - `assertion` to cover the `jwt-bearer` grant type customization. The existing `refresh token hook` is left unchanged and is considered to be deprecated in favor of the new hook logic. The `refresh token hook` will at some point be removed. Closes ory#3244 Closes ory/fosite#729
Added a generic token hook that is called for all grant types and includes
payloadwith a single allowed value -assertionto cover thejwt-bearergrant type customization.Existing
refresh hookis left unchanged and will be deprecated in favor of the new hook.Related issue(s)
#3244
ory/fosite#729
This change completes and extends the work done in #3254
Checklist
introduces a new feature.
contributing code guidelines.
vulnerability. If this pull request addresses a security vulnerability, I
confirm that I got the approval (please contact
[email protected]) from the maintainers to push
the changes.
works.
Further Comments
Docs update PR - ory/docs#1241