-
-
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: handle concurrent refreshes and improve graceful refreshing #3895
Conversation
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.
difficult to test programatically I guess
We do have tests in network for this so if it passes there it's fine here too |
It actually wasn't that hard other than that the test tooling isn't great :) I've added a test case |
34f492e
to
e6534c2
Compare
e6534c2
to
812b199
Compare
269fbb6
to
cdf6c19
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.
This is a dense change. I did not see anything wrong with it.
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's super hard to review with all the parallel refactoring. I know that you already put in a lot of work, but maybe you could still pull out the refactoring into a separate PR? Especially refactoring and changing of relevant test cases at the same time gets super hard to review 😅
...ce/sql/migrations/20241129111700000000_add_refresh_token_access_token_link.autocommit.up.sql
Show resolved
Hide resolved
I had to change the tests because I was not able to test parallel refresh grants in SQLite. So I had to change the test suite to use cockroach etc. If you review it in IntelliJ and hide whitespace changes it should be much easier to review |
And the graceful refresh token rotation tests I had to anyways rewrite because the test suite was not effective. |
This patch improves Ory Hydra's ability to deal with refresh flows which, for example, concurrently refresh the same token. Furthermore, graceful token refresh has been improved to handle a variety of edge cases and scenarios.
1faf44d
to
62a1e6f
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.
All LGTM, especially test improvements 👍
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.
LGTM! The review comments were quite helpful in understanding the change, thanks!
6aac1b3
to
1e9420d
Compare
I confirmed that a refresh token created before this patch also works after this patch. |
This patch improves Ory Hydra's ability to deal with refresh flows which, for example, concurrently refresh the same token. Furthermore, graceful token refresh has been improved to handle a variety of edge cases and scenarios.
Additionally, serializability errors in CockroachDB are now correctly retried.
Related issue(s)
See https://github.com/ory-corp/cloud/issues/7311
Closes #3895
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
security@ory.sh) from the maintainers to push
the changes.
works.
Further Comments