[release/8.0] Introduce a read-only mode for data protection keyring consumers #54266
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.
Backport of #53539 to release/8.0
/cc @amcasey
Introduce a read-only mode for data protection keyring consumers
Summary of the changes (Less than 80 chars)
Description
When multiple app instances consume the same keyring, they all try to rotate it, leading to races. This change introduces an IConfiguration property (usually set as an env var) that puts data protection in a read-only mode. The expectation is that writing will be done by a separate (i.e. non-app-instance) component.
Fixes #52915
Customer Impact
This is required to automatically configure data protection (which is required for horizontal scaling) in Aspire, which will ship on 8.0.
Regression?
[If yes, specify the version the behavior has regressed from]
Risk
Does nothing unless a magic environment variable is set, in which case it configures a couple of properties into states that were already possible.
The biggest risk is that it hasn't been tested E2E. Making it available in 8.0 is a pre-requisite for that.
Verification
As mentioned above, final validation won't occur until the E2E scenario is ready.
Packaging changes reviewed?