Skip to content

fix: tenant s3 credentials fixes and refactor #668

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

itslenny
Copy link
Contributor

@itslenny itslenny commented Apr 10, 2025

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Cache does not invalidate on database update/delete and s3 credential count always returns 0

What is the new behavior?

Cache is invalidated on database update/delete, credential count returns correct value, credentials limited to 50, cleaner architecture, improved test coverage

Changes

  • migration to use correct cache key in pg_notify cache invalidation
  • fix s3 credentials count, was always returning 0 (and allowing creation of > 50 credentials)
  • check for valid uuid on delete credential endpoint (used to throw 500 on insert)
  • refactor s3 credentials into manager pattern similar to jwks
  • add test coverage
  • updated add jwk endpoint to use 201 to match existing s3 credentials
  • some easy eslint fixes that caught my attention

@itslenny itslenny requested a review from fenos April 10, 2025 23:07
@coveralls
Copy link

coveralls commented Apr 10, 2025

Pull Request Test Coverage Report for Build 14404300513

Details

  • 218 of 223 (97.76%) changed or added relevant lines in 15 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.7%) to 78.398%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/http/plugins/jwt.ts 2 3 66.67%
src/http/plugins/signature-v4.ts 1 2 50.0%
src/internal/database/tenant.ts 11 12 91.67%
src/internal/streams/monitor.ts 0 1 0.0%
src/storage/events/webhook.ts 0 1 0.0%
Totals Coverage Status
Change from base Build 14399279405: 0.7%
Covered Lines: 16610
Relevant Lines: 21027

💛 - Coveralls

- migration to use correct cache key in pg_notify cache invalidation
- fix s3 credentials count, was always returning 0 (and allowing creation of > 50 credentials)
- check for valid uuid on delete credential endpoint (used to throw 500 on insert)
- add test coverage
- refactor s3 credentials into manager pattern similar to jwks
@itslenny itslenny force-pushed the fix/s3-credential-cache-notify-fix branch from 35e8d8e to c6f2e5e Compare April 11, 2025 13:30
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