feat(jwt-exp): exp claim at the access entry level#3761
feat(jwt-exp): exp claim at the access entry level#3761andaaron merged 1 commit intoproject-zot:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3761 +/- ##
=======================================
Coverage 91.60% 91.60%
=======================================
Files 189 189
Lines 26930 26932 +2
=======================================
+ Hits 24670 24672 +2
Misses 1460 1460
Partials 800 800 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR implements fine-grained JWT access entry expiration, allowing individual resource access entries within a JWT bearer token to have their own expiration times. This addresses issue #3755 and enables use cases like enterprise licenses where different products/repositories can have different expiration times within the same token.
Changes:
- Added optional
ExpiresAtfield toResourceAccessstruct in the bearer authentication system - Implemented expiration validation logic that skips expired access entries while allowing valid ones
- Added comprehensive test coverage for the new per-entry expiration feature
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/api/bearer.go | Added optional ExpiresAt field to ResourceAccess struct and implemented expiration check in authorization logic |
| pkg/api/bearer_test.go | Added comprehensive test cases covering future expiration, past expiration, mixed expired/valid entries, and all-expired scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@andaaron Should I rebase this one? |
yes. |
|
On it! |
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2911255 to
ba3dee1
Compare
Closes: #3755