feat(security)!: remove IEncryptionProvider.RotateKeyAsync overloads#157
Merged
AbongileBoja merged 1 commit intodevelopfrom Apr 27, 2026
Merged
feat(security)!: remove IEncryptionProvider.RotateKeyAsync overloads#157AbongileBoja merged 1 commit intodevelopfrom
AbongileBoja merged 1 commit intodevelopfrom
Conversation
BREAKING CHANGES — Phase 3c of v4 release. Both overloads were [Obsolete(error: true)] in 3.x and every shipping implementation threw NotSupportedException. ApiCompat reports CP0001 (member removed) on both. Removed: - IEncryptionProvider.RotateKeyAsync() - IEncryptionProvider.RotateKeyAsync(CancellationToken) (the DIM that delegated to the CT-less overload) - AesEncryptionProvider.RotateKeyAsync impl - AesGcmEncryptionProvider.RotateKeyAsync impl - MigratingEncryptionProvider.RotateKeyAsync impl - 2 reflection-based throw-asserting tests (RotateKeyAsync_Throws_NotSupported in AesGcmEncryptionProviderTests, RotateKeyAsync_AlwaysThrows in MigratingEncryptionProviderTests) Migration: implement key rotation at the storage layer — construct a new provider with the new key, decrypt with the old, re-encrypt with the new, persist, then cut over reads. For MigratingEncryptionProvider, register the previous writer as a legacy reader and promote the new writer. Tests: 718 unique green across net8.0/9.0/10.0 (was 720; 2 removed). Closes #138 Refs #73
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
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.
Summary
4.0 BREAKING — Phase 3c of v4 release. Closes the 3.x deprecation shipped in #137. Both overloads were
[Obsolete(error: true)]in 3.x and every shipping implementation (AesEncryptionProvider,AesGcmEncryptionProvider,MigratingEncryptionProvider) threwNotSupportedException. ApiCompat reportsCP0001(member removed) on both.Removed
IEncryptionProvider.RotateKeyAsync()IEncryptionProvider.RotateKeyAsync(CancellationToken)(the DIM that delegated to the CT-less overload)AesEncryptionProvider.RotateKeyAsyncimplementationAesGcmEncryptionProvider.RotateKeyAsyncimplementationMigratingEncryptionProvider.RotateKeyAsyncimplementationRotateKeyAsync_Throws_NotSupportedinAesGcmEncryptionProviderTestsRotateKeyAsync_AlwaysThrowsinMigratingEncryptionProviderTestsMigration
Implement key rotation at the storage layer:
For
MigratingEncryptionProviderspecifically, the existing prefix-tag dispatch already supports this pattern — register the previous writer as a legacy reader and promote the new writer.Local verification
dotnet build -c Release -p:QUERYSPEC_SKIP_SIGN=true— 0 errorsdotnet test -c Release— 718 unique tests green across net8.0/9.0/10.0 (was 720; 2 removed)Phase context — final v4 API break
Closes #138
Refs #73