Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Pre-Signed URL Signatures with Storage JWT Secret #649

Merged
merged 4 commits into from
Apr 8, 2025

Conversation

itslenny
Copy link
Contributor

@itslenny itslenny commented Apr 1, 2025

What kind of change does this PR introduce?

Feature

What is the current behavior?

URLs can only be signed using the tenant jwt secret associated with the project

What is the new behavior?

  • Use a new tenant specific "url signing jwk" to sign urls
  • Generate url signing jwk for all existing tenants using the worker queue
  • Create url signing jwk for new tenants
  • Allow user-submitted jwks (including asymmetric) to be used for self-signing of URLs
  • Legacy JWT Secret is still used as fallback validation to ensure previously created long lived URLs are still valid

@itslenny itslenny requested review from fenos and hf April 1, 2025 20:55
@itslenny itslenny force-pushed the feat/pre-signed-url-with-storage-jwt-secret branch from 570505b to 71ffda7 Compare April 1, 2025 21:07
@coveralls
Copy link

coveralls commented Apr 1, 2025

Pull Request Test Coverage Report for Build 14273943858

Details

  • 545 of 608 (89.64%) changed or added relevant lines in 16 files are covered.
  • 4 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+1.2%) to 77.778%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/config.ts 41 42 97.62%
src/http/plugins/signature-v4.ts 7 8 87.5%
src/http/routes/admin/tenants.ts 25 26 96.15%
src/storage/events/workers.ts 1 2 50.0%
src/storage/object.ts 7 8 87.5%
src/admin-app.ts 8 10 80.0%
src/internal/auth/jwt.ts 33 35 94.29%
src/internal/auth/generators/jwk-generator.ts 61 71 85.92%
src/internal/database/tenant.ts 179 191 93.72%
src/storage/events/jwks-create-signing-secret.ts 28 60 46.67%
Files with Coverage Reduction New Missed Lines %
src/internal/database/tenant.ts 1 75.29%
src/storage/events/workers.ts 1 55.56%
src/internal/queue/event.ts 2 50.54%
Totals Coverage Status
Change from base Build 14262883028: 1.2%
Covered Lines: 16227
Relevant Lines: 20700

💛 - Coveralls

Copy link
Contributor

@fenos fenos left a comment

Choose a reason for hiding this comment

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

Overall looks great!
Just left some questions / small improvements to consider improving

@itslenny itslenny force-pushed the feat/pre-signed-url-with-storage-jwt-secret branch 2 times, most recently from 98d0405 to d4f445c Compare April 4, 2025 13:41
@itslenny itslenny force-pushed the feat/pre-signed-url-with-storage-jwt-secret branch from 8d5d6e5 to ca6564f Compare April 4, 2025 20:50
@itslenny itslenny force-pushed the feat/pre-signed-url-with-storage-jwt-secret branch from ca6564f to a29b76d Compare April 7, 2025 15:29
@itslenny itslenny force-pushed the feat/pre-signed-url-with-storage-jwt-secret branch from 1b40e11 to cb22a61 Compare April 7, 2025 21:09
@fenos fenos enabled auto-merge (squash) April 8, 2025 14:23
@fenos fenos merged commit b8a3382 into master Apr 8, 2025
2 checks passed
@fenos fenos deleted the feat/pre-signed-url-with-storage-jwt-secret branch April 8, 2025 14:23
Copy link

github-actions bot commented Apr 8, 2025

🎉 This PR is included in version 1.21.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants