Skip to content
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

Cosmos DB - POST operation for retrieving read only keys #3233

Merged
merged 2 commits into from
Jun 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,35 @@
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys": {
"get": {
"operationId": "DatabaseAccounts_GetReadOnlyKeys",
"x-ms-examples": {
"CosmosDBDatabaseAccountListReadOnlyKeys": { "$ref": "./examples/CosmosDBDatabaseAccountListReadOnlyKeys.json" }
},
"description": "Lists the read-only access keys for the specified Azure Cosmos DB database account.",
"parameters": [
{
"$ref": "#/parameters/subscriptionIdParameter"
},
{
"$ref": "#/parameters/resourceGroupNameParameter"
},
{
"$ref": "#/parameters/accountNameParameter"
},
{
"$ref": "#/parameters/apiVersionParameter"
}
],
"responses": {
"200": {
"description": "The operation completed successfully.",
"schema": {
"$ref": "#/definitions/DatabaseAccountListReadOnlyKeysResult"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems both DatabaseAccounts_GetReadOnlyKeys and DatabaseAccounts_ListReadOnlyKeys returns the same result. Are we planning to deprecate one of this eventually?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the GET is to be deprecated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you. Is this new POST action to retrieve the keys a long running operation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmakwana any reason why we use POST for listing keys?

Adding Gaurav - @ravbhatnagar any concern here from ARM side? the context is:

  1. There is already an operation to retrieve the database keys which is based on HTTP GET
  2. We are introducing a new operation for retrieving the same database keys which is based on HTTP POST (this is not a long running operation)
  3. The operation based on GET will be deprecated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anuchandy - Yes, this is the right way. secrets like keys should not be exposed via a GET. Right way is through a POST. Thanks for checking!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ravbhatnagar.

@dmakwana merging the PR.

}
}
}
},
"post": {
"operationId": "DatabaseAccounts_ListReadOnlyKeys",
"x-ms-examples": {
"CosmosDBDatabaseAccountListReadOnlyKeys": { "$ref": "./examples/CosmosDBDatabaseAccountListReadOnlyKeys.json" }
Expand Down