feat(azure-sql): Transparent Data Encryption (TDE) - #906
Merged
Conversation
Add the Microsoft.Sql database transparentDataEncryption/current sub-resource as a new optional TransparentDataEncryptions capability on the relationaldb driver (type-asserted, not widening the cross-cloud interface). A TDE record is auto-materialized as Enabled when a database is created; PUT/GET/List are served synchronously (no LRO), matching real Azure SQL TDE.
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.
What
Adds Azure SQL Transparent Data Encryption (the
Microsoft.Sql/servers/databases/transparentDataEncryption/currentsub-resource) so realarmsql.TransparentDataEncryptionsClientcode works against the emulator.TransparentDataEncryptionscapability on the relationaldb driver (Set/Get/List), discovered by type assertion — the cross-cloud driver is not widened.Enabledwhen a database is created, matching Azure's encrypted-at-rest default, so aGet/Listround-trips with no explicit PUT.rp.SubResourceAction == "transparentDataEncryption"insideserveDatabaseRoute; the trailing/currentname segment is safely dropped by the 4-segmentParsePath, and Get vs. ListByDatabase is disambiguated on the raw path suffix.Architecture-fit
server/azure/sql/tde.gohandler + aproviders/azure/sql/tde.gobackend on a newmemstore.Storekeyed"server/database".CreateOrUpdate, notBegin…; it accepts 200/201/202 and does not poll). A 202 would be wrong; TDE also cannot be deleted, only toggled.Persistence
The TDE store bolts onto the already-
SnapshottablesqlMock, which the completeness guard does not deep-check — so it was added manually to the snapshotdumps/loadslists and thesqlSnapshotstruct, and the round-trip is asserted insnapshot_test.go. Cascade cleanup is wired:DeleteDatabasedrops the record, and the server-delete prefix cascade (deleteChildren) covers it, so an RG purge leaves no orphans.Test
server/azure/sql/tde_sdk_test.go): a freshly-created DB reportsEnabledwith no PUT;CreateOrUpdate(state=Enabled)→Getround-trips;ListByDatabasereturns the singlecurrentrecord.Refs #611.