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: generate RSA key lazily for lazy refresh #589

Merged
merged 2 commits into from
Jun 6, 2024
Merged

feat: generate RSA key lazily for lazy refresh #589

merged 2 commits into from
Jun 6, 2024

Conversation

enocom
Copy link
Member

@enocom enocom commented Jun 6, 2024

When lazy refresh is enabled, the RSA key generation will not occur until a client calls Dial. This change helps cold start times in serverless environments.

Prior to this commit, the RSA key generation was done at the package level using globals. This commit removes the use of globals and moves the key generation into the dialer. This means multiple dialers will now have multiple RSA keys. Before this commit, multiple dialers all shared the same RSA key. If this is a concern, callers may still configure their own RSA key across multiple dialers.

Fixes #584

When lazy refresh is enabled, the RSA key generation will not occur
until a client calls Dial. This change helps cold start times in
serverless environments.

Prior to this commit, the RSA key generation was done at the package
level using globals. This commit removes the use of globals and moves
the key generation into the dialer. This means multiple dialers will now
have multiple RSA keys. Before this commit, multiple dialers all shared
the same RSA key. If this is a concern, callers may still configure
their own RSA key across multiple dialers.

Fixes #584
@enocom enocom requested a review from a team as a code owner June 6, 2024 16:45
Copy link
Collaborator

@nancynh nancynh left a comment

Choose a reason for hiding this comment

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

LGTM - very cool!

@enocom enocom enabled auto-merge (squash) June 6, 2024 19:11
@enocom enocom merged commit f106169 into main Jun 6, 2024
16 checks passed
@enocom enocom deleted the lazy-key-gen branch June 6, 2024 19:12
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.

Lazy refresh should delay RSA key generation until first connection attempt
2 participants