-
Notifications
You must be signed in to change notification settings - Fork 2
Key vault secret refresh #175
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
zhiyuanliang-ms
wants to merge
63
commits into
main
Choose a base branch
from
zhiyuanliang/secret-refresh
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ScriptProvider into zhiyuanliang/startup-timeout
…re/AppConfiguration-JavaScriptProvider into zhiyuanliang/secret-refresh
…re/AppConfiguration-JavaScriptProvider into zhiyuanliang/secret-refresh
…re/AppConfiguration-JavaScriptProvider into zhiyuanliang/secret-refresh
…ScriptProvider into zhiyuanliang/secret-refresh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces periodic key vault secret refresh functionality along with updates to refresh intervals, error messages, and tracing tags. Key changes include:
- Adjusting timeout and interval constants across tests and production code.
- Incorporating secret refresh support into the key vault secret providers and configuration implementations.
- Updating error messages and tracing tags to include key vault secrets.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test/utils/testHelper.ts | Updated MAX_TIME_OUT constant to support longer waiting time during tests. |
test/refresh.test.ts | Updated error messages regarding refresh enabling to include key vault secrets. |
test/keyvault.test.ts | Added tests covering the secret refresh interval and behavior when secrets update. |
src/requestTracing/utils.ts & constants.ts | Introduced new tag (KEY_VAULT_REFRESH_CONFIGURED_TAG) for secret refresh configuration. |
src/refresh/RefreshTimer.ts, refreshOptions.ts, load.ts | Updated naming for time constants and interval handling. |
src/keyvault/* | Extended options, providers, and adapters to support secret refresh functionality. |
src/ConfigurationClientManager.ts & AzureAppConfigurationImpl.ts | Integrated secret refresh logic into configuration loading and client management. |
src/IKeyValueAdapter.ts & JsonKeyValueAdapter.ts | Added and updated onChangeDetected method in the key/value adapters. |
CsCherrYY
reviewed
May 7, 2025
CsCherrYY
reviewed
May 7, 2025
…ScriptProvider into zhiyuanliang/secret-refresh
rossgrambo
approved these changes
May 7, 2025
RichardChen820
approved these changes
May 8, 2025
…ScriptProvider into zhiyuanliang/secret-refresh
zhiyuanliang-ms
commented
May 9, 2025
zhiyuanliang-ms
commented
May 9, 2025
…e/AppConfiguration-JavaScriptProvider into zhiyuanliang/secret-refresh
…ScriptProvider into zhiyuanliang/secret-refresh
…ScriptProvider into zhiyuanliang/secret-refresh
…ScriptProvider into zhiyuanliang/secret-refresh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this PR?
Usage:
Allow periodic reload of key vault secrets. In this case, even if there is no change on App Configuration key-values. This feature is targeted on the scenario where user is using latest version of a secret. In this case, the key vault reference url will not change, but the secret value will change if user rotates their secret.
Secret cache
Secret with version will be cached after the initial load and whenever a secret reference of that secret is resolved, the value will always be served from the cache.
Secret with no version (which means latest), will be cached after the initial load, and it will be served from cache if the secret refresh interval is configured and not expired. Otherwise, the provider will reload it from the Key Vault.
reference: #249