-
Notifications
You must be signed in to change notification settings - Fork 29
Fix that auth tokens would sometimes be overwritten #8738
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
Conversation
📝 WalkthroughWalkthroughThe update process for bearer token authenticators was simplified by revising the update logic to only refresh the last used timestamp, removing unnecessary database context dependencies and redundant field updates. The token data access object was refactored to support this streamlined update, and a bug causing premature token expiration was fixed. Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (1)app/security/Token.scala (1)
🧬 Code Graph Analysis (1)app/security/Token.scala (1)
🪛 LanguageToolunreleased_changes/8738.md[duplication] ~1-~1: Possible typo: you repeated a word. (ENGLISH_WORD_REPEAT_RULE) ⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Thanks for fixing this. I did some basic testing like normal annotation and viewing an annotation via a shared public link incl. token. All seemed to work.
I skipped explicit testing via self written requests using X-Auth-Token
. If I should still do this please just ping me.
Quoting from Silhouette’s BearerTokenAuthenticator docstring for
update
:Our implementation of
update
did something else. It fetched any authenticator of the same user and changed not only the last used date time but also the value. So if update was called by silhouette on a datastore token, it could happen that an Authentication token was changed.This bug has been in place ever since #2149 but to trigger it, a request has to be sent to
/api/
with a valid datastore token. We don’t usually do that, but the libs tests seem to do so now. That is also a libs bug.This also caused the webknossos-libs tests to get 401 responses when using X-Auth-Tokens that were lost in this way.
Steps to test:
$PR_NUMBER.md
file inunreleased_changes
or use./tools/create-changelog-entry.py
)