-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyVault: Feature/update security domain spec #12863
KeyVault: Feature/update security domain spec #12863
Conversation
Hi, @docschmidt Thanks for your PR. I am workflow bot for review process. Here are some small tips. Any feedback about review process or workflow bot, pls contact swagger and tools team. [email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All comments made to the 7.2-preview version apply to 7.3-preview.
specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.2-preview/securitydomain.json
Outdated
Show resolved
Hide resolved
"type": "string" | ||
} | ||
} | ||
}, | ||
"200": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why return both a 202 or a 200? When should the SDK - and customers - expect 1 vs. the other? This isn't consistent with other LROs in Key Vault. Looking at others, they return a 202 only that represents the operation. Polling the pending method is how status and the eventual object (security domain) is retrieved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a managed HSM resource is created, the resource is in what we call the Provisioned state. At this point, customers have to call either the /securitydomain/upload endpoint to restore a Security Domain or the /securitydomain/download endpoint to confirm the Security Domain of the created pool. Both restoring and confirming are long running operations. Once complete the managed HSM goes into Active state at which point the managed HSM will accept other service calls.
Once the managed HSM is active, we want to allow customers to redownload the Security Domain, for example to rotate encryption keys. Merely downloading the Security Domain can be satisfied right away, and so the service would return 200 instead of 202. If this is an anti-pattern, please let me know. We may need to implement an additional endpoint then (or change to "get" for download only).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this can be a problem. In one case you're asking to return a long-running operation object (LRO) but in another the desired model. Even if we used a union of sorts for strongly-typed languages (.NET doesn't support this, but we could fake it) how do customers know to intuitively use one over the other?
Instead, always returning an LRO allows you to return one in an already-resolved state, which we support today.
/cc @johanste @JeffreyRichter for guidance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another possibility - though not ideal since we can't really rely on the generated code - is to have the SDKs always return an LRO anyway (e.g. in .NET: something deriving from Operation<T>
) that could be either in a fully resolved state for HTTP 200, or act like a normal LRO for HTTP 202. We actually do something like this for delete and recover operations, which aren't declared as LROs but may take a while, so we "override" those methods to work like LROs even if they are already completed. (Also, the REST APIs themselves return the model right away regardless of whether the operation is done, so we already have the model.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The service should not flip-flop between 200 and 202 responses. It should pick one pattern and stick with it. It becomes challenging for clients to have to fork their code paths depending on if the request could be satisfied "synchronously" or not.
specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.2-preview/securitydomain.json
Outdated
Show resolved
Hide resolved
"type": "string", | ||
"description": "SHA 256 hash of certificate" | ||
"format": "base64url", | ||
"description": "A blob containing the Security Domain." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the security policy for key export/release, should this have some sort of contentType to inform the customer what it is or how to store it or, more importantly, that needs to be sent back as-is for compatibility? Or will this opaque blob always work (or maybe even contain an embedded version)?
/cc @herveyw-msft
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The opaque blob contains a version number and it is our intent that the opaque blob will always work.
….2-preview/securitydomain.json Co-authored-by: Heath Stewart <[email protected]>
Swagger Validation Report
Only 10 items are listed, please refer to log for more details.
|
Rule | Message |
---|---|
AutoRest exception |
"readme":"keyvault/data-plane/readme.md", "tag":"package-preview-7.3-preview", "details":"Error: Lexical error on line 1. Unrecognized text." |
AutoRest exception |
"readme":"keyvault/data-plane/readme.md", "tag":"package-7.2-preview", "details":"Error: Lexical error on line 1. Unrecognized text." |
️️✔️
Avocado succeeded [Detail] [Expand]
Validation passes for Avocado.
️️✔️
ModelValidation succeeded [Detail] [Expand]
Validation passes for ModelValidation.
️️✔️
SemanticValidation succeeded [Detail] [Expand]
Validation passes for SemanticValidation.
️️✔️
[Staging] Cross Version BreakingChange (Base on preview version) succeeded [Detail] [Expand]
There are no breaking changes.
️️✔️
[Staging] Cross Version BreakingChange (Base on stable version) succeeded [Detail] [Expand]
There are no breaking changes.
️️✔️
CredScan succeeded [Detail] [Expand]
There is no credential detected.
️⚠️
[Staging] SDK Track2 Validation: 728 Warnings warning [Detail]
Only 10 items are listed, please refer to log for more details.
- The following tags are being changed in this PR
- keyvault/data-plane/readme.md#package-preview-7.3-preview
- keyvault/data-plane/readme.md#package-7.2-preview
- keyvault/data-plane/readme.md#package-7.1
- keyvault/data-plane/readme.md#package-7.1-preview
- keyvault/data-plane/readme.md#package-7.0
- keyvault/data-plane/readme.md#package-7.0-preview
- keyvault/data-plane/readme.md#package-2016-10
- keyvault/data-plane/readme.md#package-2015-06
Rule | Message |
---|---|
"readme":"keyvault/data-plane/readme.md", "tag":"package-preview-7.3-preview", "details":"The schema 'RestoreOperationParameters' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'" |
|
"readme":"keyvault/data-plane/readme.md", "tag":"package-preview-7.3-preview", "details":"The schema 'SelectiveKeyRestoreOperationParameters' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'" |
|
"readme":"keyvault/data-plane/readme.md", "tag":"package-preview-7.3-preview", "details":"The schema 'SelectiveKeyRestoreOperation' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'" |
|
"readme":"keyvault/data-plane/readme.md", "tag":"package-preview-7.3-preview", "details":"The schema 'SASTokenParameter' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'" |
|
"readme":"keyvault/data-plane/readme.md", "tag":"package-preview-7.3-preview", "details":"The schema 'FullBackupOperation' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'" |
|
"readme":"keyvault/data-plane/readme.md", "tag":"package-preview-7.3-preview", "details":"The schema 'RestoreOperation' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'" |
|
"readme":"keyvault/data-plane/readme.md", "tag":"package-preview-7.3-preview", "details":"The schema 'CertificateAttributes' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'" |
|
"readme":"keyvault/data-plane/readme.md", "tag":"package-preview-7.3-preview", "details":"The schema 'CertificateItem' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'" |
|
"readme":"keyvault/data-plane/readme.md", "tag":"package-preview-7.3-preview", "details":"The schema 'CertificateIssuerItem' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'" |
|
"readme":"keyvault/data-plane/readme.md", "tag":"package-preview-7.3-preview", "details":"The schema 'CertificateBundle' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'" |
️️✔️
[Staging] PrettierCheck succeeded [Detail] [Expand]
Validation passes for PrettierCheck.
️️✔️
[Staging] SpellCheck succeeded [Detail] [Expand]
Validation passes for SpellCheck.
Swagger Generation Artifacts
|
Co-authored-by: Heath Stewart <[email protected]>
Hi @docschmidt, Your PR has some issues. Please fix the CI sequentially by following the order of
|
NewApiVersionRequired reason: |
…into fix_resource_multiapi_submodule * 'master' of https://github.com/Azure/azure-rest-api-specs: (452 commits) Dev cost management microsoft.cost management 2020 12 01 preview new (Azure#12259) Edit securityContact swagger for 2020-01-01 (Azure#12265) [Hub Generated] Review request for Microsoft.Insights to add version stable/2020-10-01 (Azure#11579) [Hub Generated] Review request for Microsoft.Media to add version stable/2020-05-01 (Azure#12681) Fix TimeSeriesInsights swagger issues (Azure#12204) Fixing error in lastModifiedAt description (Azure#12854) Update comment.yml (Azure#12910) Fixing RI s360 Flagged corrections in 2019-10-01 version (Azure#12777) [Hub Generated] Review request for Microsoft.Web to add version stable/2020-10-01 (Azure#11636) [Ready For Review] New version 20210101 (Azure#12111) Update scheduledQueryRule_API.json (Azure#12895) Remove UserAssigned MSI (Azure#12900) Update library.json (Azure#12922) KeyVault: Feature/update security domain spec (Azure#12863) Fixes ExampleId type and incorrect ArmTokenParameter name (Azure#12896) Update contract for anomaly detector (Azure#12487) [NetAppFiles] Urgent bug fix, backup response, remove systemData(not in response yet) (Azure#12852) [AML] Add PipelineEndpoint with version and DataPathAssignments fields in AzureMLExecutePipeline (Azure#12744) remove duplicated schema (Azure#12779) [Web] Add Swagger for Service Principal (Azure#12780) ...
* Convert SD download operation to async operation * Remove Security Domain structure definition * Minor update * Update 7.3-preview spec * Fix validation errors * Update specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.2-preview/securitydomain.json Co-authored-by: Heath Stewart <[email protected]> * Address review feedback Co-authored-by: Heath Stewart <[email protected]> * Fix prettier check failures * Fix suppression statement in readme.md * Fix typo * Another prettier fix Co-authored-by: Heath Stewart <[email protected]>
MSFT employees can try out our new experience at OpenAPI Hub - one location for using our validation tools and finding your workflow.
Changelog
Please ensure to add changelog with this PR by answering the following questions.
What's the purpose of the update?
When you are targeting to deploy new service/feature to public regions? Please provide date, or month to public if date is not available yet.
When you expect to publish swagger? Please provide date, or month to public if date is not available yet.
If it's an update to existing version, please select SDKs of specific language and CLIs that require refresh after swagger is published.
Contribution checklist:
If any further question about AME onboarding or validation tools, please view the FAQ.
ARM API Review Checklist
Ensure to check this box if one of the following scenarios meet updates in the PR, so that label “WaitForARMFeedback” will be added automatically to involve ARM API Review. Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs, all “removals” and “adding a new property” no more require ARM API review.
Please ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.
If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.
Breaking Change Review Checklist
If there are following updates in the PR, ensure to request an approval from API Review Board as defined in the Breaking Change Policy.
Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Addition details on the process and office hours are on the Breaking change Wiki.
Please follow the link to find more details on PR review process.