Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add cache abstraction for fetching signing keys#14777

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sreya merged 15 commits intomainfromjon/keychain
Oct 1, 2024
Merged

Conversation

sreya
Copy link
Collaborator

@sreyasreya commentedSep 24, 2024
edited
Loading

This PR adds the database implementation for fetching and caching keys used for JWT signing. It's been merged into thekeyrotate pkg and renamed tocryptokeys since they're coupled concepts. Given the size of the PR, an additional PR will be added for the wsproxy implementation.

@sreyasreya changed the titlefeat: add keychain abstraction for fetching encryption keysfeat: add keychain abstraction for fetching signing keysSep 24, 2024
@sreyasreya marked this pull request as ready for reviewSeptember 24, 2024 01:57
@sreyasreya changed the titlefeat: add keychain abstraction for fetching signing keysfeat: add cache abstraction for fetching signing keysSep 24, 2024
- Simplify naming by renaming `DBKeyCache` to `DBCache`.- Introduce `DBCacheOption` for flexible clock configuration.- Ensure consistent clock handling across the methods.
Refactored the CryptoKey handling logic to leverage the codersdkpackage. This enhances consistency and modularity by centralizingCryptoKey management and related operations. The refactoring alsoincludes renaming functions to better reflect their functionalityand using the db2sdk package for database to SDK conversions.
- Simplifies conversion and improves consistency by using  a common package for translating database keys to SDK keys.- Improves test reliability and code maintainability by centralizing  the conversion process.
Copy link
Contributor

@spikecurtisspikecurtis left a comment

Choose a reason for hiding this comment

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

You don't have to convert all the times to UTC. Go handles timezones just fine without this.

Introduce a timer-based cache invalidation system in DBCache to enhance reliability. The new implementation minimizes cache invalidation race conditions during key fetching, ensuring consistent cache state management. Additions include a 'Close' method for releasing resources, such as timers, and test improvements for timer behavior validation.
Introduce `closed` state to the DBCache to ensure operations suchas Verifying and Signing are safely terminated when the cache isclosed. This update prevents resource access and ensures propershutdown sequences, enhancing system reliability.
Copy link
Contributor

@spikecurtisspikecurtis left a comment

Choose a reason for hiding this comment

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

I don't need to review again, but you need to fix the re-checking ofd.close when you release the read lock and acquire the write lock.

@sreyasreya merged commit21b92ef intomainOct 1, 2024
28 of 30 checks passed
@sreyasreya deleted the jon/keychain branchOctober 1, 2024 16:04
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsOct 1, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@spikecurtisspikecurtisspikecurtis approved these changes

Assignees

@sreyasreya

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@sreya@spikecurtis

[8]ページ先頭

©2009-2025 Movatter.jp