Repository navigation
Add asynchronous enclave delegate operations - #4886
Conversation
Connect enclave session lookup, attestation parameters, creation, and invalidation to async provider APIs without changing synchronous dispatch. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4992e92c-122b-4f55-92c7-0042cd288dee
There was a problem hiding this comment.
🔵 Needs a closer look
Human confirmation is needed because trusted supplementary review guidance, existing PR feedback, and current-head CI remain unverified.
No open issues 🎉
What changed in this PR
Adds internal asynchronous enclave-delegate operations as a foundation for async Always Encrypted support in #3672. Command integration remains deferred to layer 2.
Changes:
- Adds async session lookup, creation, invalidation, and attestation-parameter methods without changing synchronous or public APIs.
- Adds 22 deterministic test cases covering forwarding, cancellation, errors, cache rechecks, and sync/async parity.
| File | Description |
|---|---|
| src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/AlwaysEncrypted/EnclaveDelegateAsyncTests.cs | Tests async delegation and synchronous compatibility. |
| src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveDelegate.Crypto.cs | Adds four internal async enclave operations. |
Review effort: Balanced
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. Some pipeline(s) encountered errors during trigger evaluation. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4886 +/- ##
==========================================
+ Coverage 67.58% 70.38% +2.80%
==========================================
Files 310 305 -5
Lines 45543 69821 +24278
==========================================
+ Hits 30779 49143 +18364
- Misses 14764 20678 +5914
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
paulmedynski
left a comment
There was a problem hiding this comment.
New methods and tests look good. Just one style suggestion.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4992e92c-122b-4f55-92c7-0042cd288dee
…/async-enclave-delegate
Description
Add internal async enclave-delegate APIs for session lookup, attestation parameters, session creation, and invalidation. Preserve cancellation, provider errors, session validation, and replay-counter results. Providers retain ownership of async attestation gating; no monitor lock crosses an await. Synchronous methods and public APIs are unchanged.
Layer 1 of a two-PR stack. Command async execution wiring belongs to layer 2. No key-store or enclave-package-generation changes; no overlap with #4585 or #4798.
Issues
Part of #3672.
Testing
Added 22 deterministic delegate cases covering incomplete provider tasks, input/result forwarding, cancellation and original errors, cold/warm cache rechecks, validation parity, and synchronous dispatch. Integration coverage is deferred to layer 2 because this foundation has no command call sites.
dotnet test src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj --framework net10.0 --filter 'FullyQualifiedName~EnclaveDelegateAsyncTests|FullyQualifiedName~SqlColumnEncryptionEnclaveProviderAsyncShould|FullyQualifiedName~EnclaveSessionCacheTest' --no-build --no-restore --verbosity quiet --blame-hang-timeout 1mdotnet build src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj --framework net462 --configuration Release --no-restore --verbosity quietGuidelines
Please review the contribution guidelines before submitting a pull request: