Skip to content

Commit

Permalink
mongo rbac cherry-pick (#5)
Browse files Browse the repository at this point in the history
* mongo rbac cherry-pick

* Removing entry for 07 preview

Co-authored-by: kavskalyan <[email protected]>
  • Loading branch information
abhijitkaranjkar89 and kavskalyan authored Oct 5, 2021
1 parent 60844c7 commit 8392017
Show file tree
Hide file tree
Showing 10 changed files with 894 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"parameters": {
"mongoDbRoleDefinitionId": "myMongoDbRoleDefinitionId",
"subscriptionId": "mySubscriptionId",
"resourceGroupName": "myResourceGroupName",
"accountName": "myAccountName",
"api-version": "2021-10-15-preview",
"createUpdateMongoDbRoleDefinitionParameters": {
"properties": {
"roleName": "myRoleName",
"databaseName": "sales",
"privileges": [
{
"resource": {
"db": "sales",
"collection": "sales"
},
"actions": [
"insert",
"find"
]
}
],
"roles": [
{
"role": "myInheritedRole",
"db": "sales"
}
]
}
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbRoleDefinitions/myMongoDbRoleDefinitionId",
"name": "myMongoDbRoleDefinitionId",
"type": "Microsoft.DocumentDB/databaseAccounts/mongoDbRoleDefinitionId",
"properties": {
"roleName": "myRoleName",
"type": "CustomRole",
"databaseName": "sales",
"privileges": [
{
"resource": {
"db": "sales",
"collection": "coll"
},
"actions": [
"find",
"insert"
]
}
],
"roles": [
{
"db": "sales",
"role": "myReadRole"
}
]
}
}
},
"202": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"parameters": {
"mongoDbRoleDefinitionId": "myMongoDbRoleDefinitionId",
"subscriptionId": "mySubscriptionId",
"resourceGroupName": "myResourceGroupName",
"accountName": "myAccountName",
"api-version": "2021-10-15-preview"
},
"responses": {
"200": {},
"202": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"parameters": {
"mongoDbRoleDefinitionId": "myMongoDbRoleDefinitionId",
"databaseName": "sales",
"subscriptionId": "mySubscriptionId",
"resourceGroupName": "myResourceGroupName",
"accountName": "myAccountName",
"api-version": "2021-10-15-preview"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbRoleDefinitions/myMongoDbRoleDefinitionId",
"name": "myMongoRoleDefinitionId",
"type": "Microsoft.DocumentDB/databaseAccounts/mongoRoleDefinitions",
"properties": {
"roleName": "myRoleName",
"type": "CustomRole",
"databaseName": "sales",
"privileges": [
{
"resource": {
"db": "sales",
"collection": "coll"
},
"actions": [
"find",
"insert"
]
}
],
"roles": [
{
"db": "sales",
"role": "myReadRole"
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"parameters": {
"subscriptionId": "mySubscriptionId",
"resourceGroupName": "myResourceGroupName",
"accountName": "myAccountName",
"api-version": "2021-10-15-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongoRoleDefinitions/myRoleDefinitionId",
"name": "myRoleDefinitionId",
"type": "Microsoft.DocumentDB/databaseAccounts/mongoRoleDefinitions",
"properties": {
"roleName": "myRoleName",
"type": "CustomRole",
"databaseName": "sales",
"privileges": [
{
"resource": {
"db": "sales",
"collection": "coll"
},
"actions": [
"find",
"insert"
]
}
],
"roles": [
{
"db": "sales",
"role": "myReadRole"
}
]
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"parameters": {
"userName": "myUserName",
"databaseName": "sales",
"subscriptionId": "mySubscriptionId",
"resourceGroupName": "myResourceGroupName",
"accountName": "myAccountName",
"api-version": "2021-10-15-preview",
"createUpdateMongoDbRoleDefinitionParameters": {
"properties": {
"userName": "myUserName",
"password": "myPassword",
"databaseName": "sales",
"customData": "My custom data",
"roles": [
{
"role": "myReadRole",
"db": "sales"
}
],
"mechanisms": "SCRAM-SHA-256"
}
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbUserDefinitions/myUserId",
"name": "myUserName",
"type": "Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions",
"properties": {
"userName": "myUserName",
"databaseName": "sales",
"customData": "My custom data",
"roles": [
{
"db": "sales",
"role": "myReadRole"
}
],
"mechanisms": "SCRAM-SHA-256"
}
}
},
"202": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"parameters": {
"userName": "myUserName",
"databaseName": "sales",
"subscriptionId": "mySubscriptionId",
"resourceGroupName": "myResourceGroupName",
"accountName": "myAccountName",
"api-version": "2021-10-15-preview"
},
"responses": {
"200": {},
"202": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"parameters": {
"userName": "myUserName",
"databaseName": "sales",
"subscriptionId": "mySubscriptionId",
"resourceGroupName": "myResourceGroupName",
"accountName": "myAccountName",
"api-version": "2021-10-15-preview"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbUserDefinitions/myUserId",
"name": "myUserId",
"type": "Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions",
"properties": {
"userName": "myUserName",
"databaseName": "sales",
"customData": "My custom data",
"roles": [
{
"db": "sales",
"role": "myReadRole"
}
],
"mechanisms": "SCRAM-SHA-256"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"parameters": {
"subscriptionId": "mySubscriptionId",
"resourceGroupName": "myResourceGroupName",
"accountName": "myAccountName",
"api-version": "2021-10-15-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongodbUserDefinitions/myUserId",
"name": "myUserId",
"type": "Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions",
"properties": {
"userName": "myUserName",
"databaseName": "sales",
"customData": "My custom data",
"roles": [
{
"db": "sales",
"role": "myReadRole"
}
],
"mechanisms": "SCRAM-SHA-256"
}
}
]
}
}
}
}
Loading

0 comments on commit 8392017

Please sign in to comment.