Skip to content

Commit

Permalink
Add cors rule in request/response for Cosmos DB (Azure#10204)
Browse files Browse the repository at this point in the history
  • Loading branch information
shurd authored and innosam committed Aug 17, 2020
1 parent 14faf68 commit 859abc5
Show file tree
Hide file tree
Showing 14 changed files with 140 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5207,6 +5207,38 @@
"defaultConsistencyLevel"
]
},
"CorsPolicy": {
"type": "object",
"description": "The CORS policy for the Cosmos DB database account.",
"properties": {
"allowedOrigins": {
"description": "The origin domains that are permitted to make a request against the service via CORS.",
"type": "string"
},
"allowedMethods": {
"description": "The methods (HTTP request verbs) that the origin domain may use for a CORS request.",
"type": "string"
},
"allowedHeaders": {
"description": "The request headers that the origin domain may specify on the CORS request.",
"type": "string"
},
"exposedHeaders": {
"description": "The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.",
"type": "string"
},
"maxAgeInSeconds": {
"description": "The maximum amount time that a browser should cache the preflight OPTIONS request.",
"type": "integer",
"minimum": 1,
"maximum": 2147483647,
"format": "int64"
}
},
"required": [
"allowedOrigins"
]
},
"DatabaseAccountGetProperties": {
"description": "Properties for the database account.",
"type": "object",
Expand Down Expand Up @@ -5351,6 +5383,13 @@
"description": "The object representing the policy for taking backups on an account.",
"type": "object",
"$ref": "#/definitions/BackupPolicy"
},
"cors": {
"type": "array",
"description": "The CORS policy for the Cosmos DB database account.",
"items": {
"$ref": "#/definitions/CorsPolicy"
}
}
}
},
Expand Down Expand Up @@ -5447,6 +5486,13 @@
"description": "The object representing the policy for taking backups on an account.",
"type": "object",
"$ref": "#/definitions/BackupPolicy"
},
"cors": {
"type": "array",
"description": "The CORS policy for the Cosmos DB database account.",
"items": {
"$ref": "#/definitions/CorsPolicy"
}
}
},
"required": [
Expand Down Expand Up @@ -5593,6 +5639,13 @@
"description": "The object representing the policy for taking backups on an account.",
"type": "object",
"$ref": "#/definitions/BackupPolicy"
},
"cors": {
"type": "array",
"description": "The CORS policy for the Cosmos DB database account.",
"items": {
"$ref": "#/definitions/CorsPolicy"
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@
"backupIntervalInMinutes": 240,
"backupRetentionIntervalInHours": 720
}
}
},
"cors": [
{
"allowedOrigins": "https://test"
}
]
}
}
},
Expand Down Expand Up @@ -158,7 +163,12 @@
"backupIntervalInMinutes": 240,
"backupRetentionIntervalInHours": 720
}
}
},
"cors": [
{
"allowedOrigins": "https://test"
}
]
},
"systemData": {
"createdAt": "2020-06-12T22:05:09Z"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"failoverPriority": 0
}
],
"cors": [],
"enableFreeTier": false,
"apiProperties": {},
"enableAnalyticalStorage": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
}
}
],
"cors": [],
"enableFreeTier": false,
"apiProperties": {},
"enableAnalyticalStorage": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
}
}
],
"cors": [],
"enableFreeTier": false,
"apiProperties": {},
"enableAnalyticalStorage": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"failoverPriority": 0
}
],
"cors": [],
"enableFreeTier": false,
"instanceId": "d9b26648-2f53-4541-b3d8-3044f4f9810d",
"createMode": "Default",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"failoverPriority": 0
}
],
"cors": [],
"virtualNetworkRules": [
{
"id": "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5818,6 +5818,38 @@
"defaultConsistencyLevel"
]
},
"CorsPolicy": {
"type": "object",
"description": "The CORS policy for the Cosmos DB database account.",
"properties": {
"allowedOrigins": {
"description": "The origin domains that are permitted to make a request against the service via CORS.",
"type": "string"
},
"allowedMethods": {
"description": "The methods (HTTP request verbs) that the origin domain may use for a CORS request.",
"type": "string"
},
"allowedHeaders": {
"description": "The request headers that the origin domain may specify on the CORS request.",
"type": "string"
},
"exposedHeaders": {
"description": "The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.",
"type": "string"
},
"maxAgeInSeconds": {
"description": "The maximum amount time that a browser should cache the preflight OPTIONS request.",
"type": "integer",
"minimum": 1,
"maximum": 2147483647,
"format": "int64"
}
},
"required": [
"allowedOrigins"
]
},
"DatabaseAccountGetProperties": {
"description": "Properties for the database account.",
"type": "object",
Expand Down Expand Up @@ -5941,6 +5973,13 @@
"enableAnalyticalStorage": {
"description": "Flag to indicate whether to enable storage analytics.",
"type": "boolean"
},
"cors": {
"type": "array",
"description": "The CORS policy for the Cosmos DB database account.",
"items": {
"$ref": "#/definitions/CorsPolicy"
}
}
}
},
Expand Down Expand Up @@ -6025,6 +6064,13 @@
"enableAnalyticalStorage": {
"description": "Flag to indicate whether to enable storage analytics.",
"type": "boolean"
},
"cors": {
"type": "array",
"description": "The CORS policy for the Cosmos DB database account.",
"items": {
"$ref": "#/definitions/CorsPolicy"
}
}
},
"required": [
Expand Down Expand Up @@ -6141,6 +6187,13 @@
"enableAnalyticalStorage": {
"description": "Flag to indicate whether to enable storage analytics.",
"type": "boolean"
},
"cors": {
"type": "array",
"description": "The CORS policy for the Cosmos DB database account.",
"items": {
"$ref": "#/definitions/CorsPolicy"
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@
"apiProperties": {
"serverVersion": "3.2"
},
"enableAnalyticalStorage": true
"enableAnalyticalStorage": true,
"cors": [
{
"allowedOrigins": "https://test"
}
]
}
}
},
Expand Down Expand Up @@ -141,7 +146,12 @@
"apiProperties": {
"serverVersion": "3.2"
},
"enableAnalyticalStorage": true
"enableAnalyticalStorage": true,
"cors": [
{
"allowedOrigins": "https://test"
}
]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"failoverPriority": 0
}
],
"cors": [],
"enableFreeTier": false,
"apiProperties": {},
"enableAnalyticalStorage": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
}
}
],
"cors": [],
"enableFreeTier": false,
"apiProperties": {},
"enableAnalyticalStorage": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
}
}
],
"cors": [],
"enableFreeTier": false,
"apiProperties": {},
"enableAnalyticalStorage": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"failoverPriority": 0
}
],
"cors": [],
"enableFreeTier": false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
}
}
],
"cors": [],
"enableFreeTier": false,
"apiProperties": {},
"enableAnalyticalStorage": true
Expand Down

0 comments on commit 859abc5

Please sign in to comment.