Skip to content

feat!: support key deletion via IDeletableXmlRepository - #43

Merged
giammin merged 1 commit into
mainfrom
feat/25-key-deletion
Oct 22, 2026
Merged

giammin merged 1 commit into
mainfrom
feat/25-key-deletion

Conversation

@giammin

@giammin giammin commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Add IDeletableDataProtectionStorage with Delete(keys). When the storage passed to PersistKeysToStorage implements it, the key repository also implements IDeletableXmlRepository, so XmlKeyManager.DeleteKeys works. Failures are logged and reported as false; the key XML is never logged.

The SQL Server and PostgreSQL repositories delete the selected rows by Id, in deletion order, in a single transaction (rollback verified with trigger-based tests).

Note: in ASP.NET Core 10.0 XmlKeyManager exposes CanDeleteKeys/DeleteKeys but does not implement IDeletableKeyManager, so the keyManager is IDeletableKeyManager pattern from the Microsoft docs is always false. The README documents using XmlKeyManager.

Testing: Release build clean; 76/76 tests pass locally (SQL Server tests need the localhost -> 127.0.0.1 fixture workaround removed in #40 on a Docker-on-WSL2 host; unrelated to this change).

BREAKING CHANGE: IDbDataProtectionStorage now extends IDeletableDataProtectionStorage. Custom implementations of IDbDataProtectionStorage must implement Delete(IReadOnlyCollection<DataProtectionKey>).

Closes #25

Add IDeletableDataProtectionStorage with Delete(keys). When the storage
passed to PersistKeysToStorage implements it, the key repository also
implements IDeletableXmlRepository, so XmlKeyManager.DeleteKeys works.
Failures are logged and reported as false; the key XML is never logged.

The SQL Server and PostgreSQL repositories delete the selected rows by
Id, in deletion order, in a single transaction.

Note: in ASP.NET Core 10.0 XmlKeyManager exposes DeleteKeys but does not
implement IDeletableKeyManager; the README documents the usage.

BREAKING CHANGE: IDbDataProtectionStorage now extends
IDeletableDataProtectionStorage. Custom implementations of
IDbDataProtectionStorage must implement
Delete(IReadOnlyCollection<DataProtectionKey>).

Closes #25
@giammin
giammin merged commit 35d50c4 into main Oct 22, 2026
1 check passed
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.

Support key deletion (IDeletableXmlRepository)

1 participant