Skip to content

Fix bearer token cache#3527

Merged
cthulhu-rider merged 2 commits intomasterfrom
bugfix/token-caches
Aug 14, 2025
Merged

Fix bearer token cache#3527
cthulhu-rider merged 2 commits intomasterfrom
bugfix/token-caches

Conversation

@cthulhu-rider
Copy link
Contributor

No description provided.

Similar to 90a7be8. Follow #3526.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
@codecov
Copy link

codecov bot commented Aug 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 23.92%. Comparing base (fefd962) to head (df8d099).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3527      +/-   ##
==========================================
+ Coverage   23.54%   23.92%   +0.38%     
==========================================
  Files         669      669              
  Lines       50248    50248              
==========================================
+ Hits        11832    12024     +192     
+ Misses      37502    37257     -245     
- Partials      914      967      +53     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The same status returns in other case of failure.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
@cthulhu-rider cthulhu-rider marked this pull request as ready for review August 13, 2025 15:15
@cthulhu-rider cthulhu-rider added this to the v0.48.3 milestone Aug 13, 2025
if !ok {
// TODO: Signed data is used twice - for cache key and to check the signature. Coding can be deduplicated.
res.token, res.err = b.decodeAndVerifyBearerTokenCommon(m, ownerCnr)
res.token, res.err = b.decodeAndVerifyBearerTokenCommon(m)
Copy link
Member

@carpawell carpawell Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't bearer->eacl table->container->owner a const chain for any token?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is, and that's what tricked me. ownerCnr is an owner of the container from request body

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hw, i guess the fix is ok then, but

owner of the container from request body

bothers me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bearer token issuer must be the owner of the requested container. It has always been like this and it is right

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check can be before the cache check then imo. i think ownerCnr must be correct in this func

@cthulhu-rider cthulhu-rider merged commit b8fdfda into master Aug 14, 2025
22 checks passed
@cthulhu-rider cthulhu-rider deleted the bugfix/token-caches branch August 14, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants