Skip to content
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

feat: periodic key revocation #401

Merged
merged 18 commits into from
Jun 25, 2024
Merged

feat: periodic key revocation #401

merged 18 commits into from
Jun 25, 2024

Conversation

cwaldren-ld
Copy link
Contributor

@cwaldren-ld cwaldren-ld commented Jun 18, 2024

This replaces Relay's key rotation system with a new abstraction: credential.Rotator

Previously, key rotation was the concern of the stream message handler, project manager, environment manager, and environments. This was because SDK key expiry was handled by the stream manager at the highest level, even though the actual credential handling needed to be delegated to the lowest level (environments.)

Now, key rotation happens locally within an environment. Key deprecation messages are pushed down the stack until they get to an environment, which hands it off to the Rotator.

A Rotator can be queried at any time to determine what keys should be added or removed from an environment. It is purely logical and doesn't deal with goroutines or channels, making it easy to test.


Behavioral Change
Key expiration is no longer instantaneous, it now happens on a configurable interval - for example, expired keys are checked every minute. The tradeoff is higher latency, but easier to test and predict the behavior.

The interval can be controlled with config option EXPIRED_CREDENTIAL_CLEANUP_INTERVAL.

@cwaldren-ld cwaldren-ld force-pushed the cw/sc-247250/key-rotator branch from 1c4a165 to 260640b Compare June 19, 2024 01:54
@cwaldren-ld cwaldren-ld force-pushed the cw/sc-247250/key-rotator branch from 6754991 to 84427b0 Compare June 21, 2024 21:52
@cwaldren-ld cwaldren-ld changed the title refactor: handle key rotation with new component feat: handle key rotation with new component Jun 21, 2024
@cwaldren-ld cwaldren-ld changed the title feat: handle key rotation with new component feat: periodic key revocation Jun 21, 2024
@cwaldren-ld cwaldren-ld marked this pull request as ready for review June 24, 2024 23:47
@cwaldren-ld cwaldren-ld requested a review from a team June 24, 2024 23:47
Copy link
Contributor

@louis-launchdarkly louis-launchdarkly left a comment

Choose a reason for hiding this comment

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

We pair reviewed this together and the clean up, and encapsulate the add/remove credential as the update function is good.

@cwaldren-ld cwaldren-ld merged commit 92033e9 into v8 Jun 25, 2024
8 checks passed
@cwaldren-ld cwaldren-ld deleted the cw/sc-247250/key-rotator branch June 25, 2024 17:56
cwaldren-ld pushed a commit that referenced this pull request Jun 25, 2024
🤖 I have created a release *beep* *boop*
---


##
[8.8.0](v8.7.1...v8.8.0)
(2024-06-25)


### Features

* offline mode key rotation
([#408](#408))
([b3f03a4](b3f03a4))
* periodic key revocation
([#401](#401))
([92033e9](92033e9))


### Bug Fixes

* offline mode would spam logs when file changes
([#406](#406))
([3c12e10](3c12e10))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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