diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/apimportalsettings.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/apimportalsettings.json index 25a5a75f79c2..30802bd2eefd 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/apimportalsettings.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/apimportalsettings.json @@ -693,6 +693,390 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/csp": { + "head": { + "tags": [ + "PortalSettingsCsp" + ], + "operationId": "PortalSettingsCsp_GetEntityTag", + "description": "Get the entity state (Etag) version of the Content Security Policy (CSP) settings for the developer portal.", + "x-ms-examples": { + "ApiManagementPortalSettingsCspHead": { + "$ref": "./examples/ApiManagementPortalSettingsCspHead.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Operation completed successfully.", + "headers": { + "ETag": { + "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", + "type": "string" + } + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + }, + "get": { + "tags": [ + "PortalSettingsCsp" + ], + "operationId": "PortalSettingsCsp_Get", + "description": "Get the Content Security Policy (CSP) settings for the developer portal.", + "x-ms-examples": { + "ApiManagementPortalSettingsCspGet": { + "$ref": "./examples/ApiManagementPortalSettingsCspGet.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The developer portal Content Security Policy (CSP) settings.", + "schema": { + "$ref": "./definitions.json#/definitions/PortalSettingsCsp" + }, + "headers": { + "ETag": { + "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", + "type": "string" + } + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "PortalSettingsCsp" + ], + "operationId": "PortalSettingsCsp_Update", + "description": "Update the Content Security Policy (CSP) settings for the developer portal.", + "x-ms-examples": { + "ApiManagementPortalSettingsCspPatch": { + "$ref": "./examples/ApiManagementPortalSettingsCspPatch.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "./definitions.json#/definitions/PortalSettingsCsp" + }, + "description": "Update the Content Security Policy (CSP) settings for the developer portal." + }, + { + "$ref": "./apimanagement.json#/parameters/IfMatchRequiredParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "204": { + "description": "The settings were successfully updated." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "PortalSettingsCsp" + ], + "operationId": "PortalSettingsCsp_CreateOrUpdate", + "description": "Create or update Content Security Policy (CSP) settings for the developer portal.", + "x-ms-examples": { + "PortalSettingsCspPut": { + "$ref": "./examples/ApiManagementPortalSettingsCspPut.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "./definitions.json#/definitions/PortalSettingsCsp" + }, + "description": "Create or update parameters." + }, + { + "$ref": "./apimanagement.json#/parameters/IfMatchOptionalParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The settings were successfully updated.", + "schema": { + "$ref": "./definitions.json#/definitions/PortalSettingsCsp" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/cors": { + "head": { + "tags": [ + "PortalSettingsCors" + ], + "operationId": "PortalSettingsCors_GetEntityTag", + "description": "Get the entity state (Etag) version of the Cross-Origin Resource Sharing (CORS) settings for the developer portal.", + "x-ms-examples": { + "ApiManagementPortalSettingsCorsHead": { + "$ref": "./examples/ApiManagementPortalSettingsCorsHead.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Operation completed successfully.", + "headers": { + "ETag": { + "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", + "type": "string" + } + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + }, + "get": { + "tags": [ + "PortalSettingsCors" + ], + "operationId": "PortalSettingsCors_Get", + "description": "Get the Cross-Origin Resource Sharing (CORS) settings for the developer portal.", + "x-ms-examples": { + "ApiManagementPortalSettingsCorsGet": { + "$ref": "./examples/ApiManagementPortalSettingsCorsGet.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The developer portal Cross-Origin Resource Sharing (CORS) settings.", + "schema": { + "$ref": "./definitions.json#/definitions/PortalSettingsCors" + }, + "headers": { + "ETag": { + "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", + "type": "string" + } + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "PortalSettingsCors" + ], + "operationId": "PortalSettingsCors_Update", + "description": "Update the Cross-Origin Resource Sharing (CORS) settings for the developer portal.", + "x-ms-examples": { + "ApiManagementPortalSettingsCorsPatch": { + "$ref": "./examples/ApiManagementPortalSettingsCorsPatch.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "./definitions.json#/definitions/PortalSettingsCors" + }, + "description": "Update the Cross-Origin Resource Sharing (CORS) settings for the developer portal." + }, + { + "$ref": "./apimanagement.json#/parameters/IfMatchRequiredParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "204": { + "description": "The settings were successfully updated." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "PortalSettingsCors" + ], + "operationId": "PortalSettingsCors_CreateOrUpdate", + "description": "Create or update the Cross-Origin Resource Sharing (CORS) settings for the developer portal.", + "x-ms-examples": { + "ApiManagementPortalSettingsCorsPut": { + "$ref": "./examples/ApiManagementPortalSettingsCorsPut.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "./definitions.json#/definitions/PortalSettingsCors" + }, + "description": "Create or update parameters." + }, + { + "$ref": "./apimanagement.json#/parameters/IfMatchOptionalParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The settings were successfully updated.", + "schema": { + "$ref": "./definitions.json#/definitions/PortalSettingsCors" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + } } }, "definitions": {} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/definitions.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/definitions.json index 353ef951ed96..ae323cdc3d0a 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/definitions.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/definitions.json @@ -3945,6 +3945,91 @@ }, "description": "Delegation settings contract properties." }, + "PortalSettingsCors": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/PortalSettingsCorsProperties", + "description": "The developer portal Cross-Origin Resource Sharing (CORS) settings contract properties." + } + }, + "allOf": [ + { + "$ref": "./../../../../../common-types/resource-management/v2/types.json#/definitions/Resource" + } + ], + "description": "The developer portal Cross-Origin Resource Sharing (CORS) settings." + }, + "PortalSettingsCorsProperties": { + "properties": { + "allowedOrigins": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Allowed origins, e.g. `https://trusted.com`." + } + }, + "description": "The developer portal Cross-Origin Resource Sharing (CORS) settings contract properties." + }, + "PortalSettingsCsp": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/PortalSettingsCspProperties", + "description": "The developer portal Content Security Policy (CSP) settings contract properties." + } + }, + "allOf": [ + { + "$ref": "./../../../../../common-types/resource-management/v2/types.json#/definitions/Resource" + } + ], + "description": "The developer portal Content Security Policy (CSP) settings." + }, + "PortalSettingsCspProperties": { + "properties": { + "mode": { + "type": "string", + "description": "The mode of the developer portal Content Security Policy (CSP).", + "enum": [ + "enabled", + "disabled", + "reportOnly" + ], + "x-ms-enum": { + "modelAsString": true, + "name": "PortalSettingsCspMode", + "values": [ + { + "value": "enabled", + "description": "The browser will block requests not matching allowed origins." + }, + { + "value": "disabled", + "description": "The browser will not apply the origin restrictions." + }, + { + "value": "reportOnly", + "description": "The browser will report requests not matching allowed origins without blocking them." + } + ] + } + }, + "reportUri": { + "type": "string", + "description": "The URL used by the browser to report CSP violations." + }, + "allowedSources": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`." + } + }, + "description": "The developer portal Content Security Policy (CSP) settings contract properties." + }, "PortalSettingsCollection": { "properties": { "value": { diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsGet.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsGet.json new file mode 100644 index 000000000000..e759db21f616 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsGet.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-04-01-preview", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/cors", + "type": "Microsoft.ApiManagement/service/portalsettings/cors", + "name": "cors", + "properties": { + "allowedOrigins": ["https://trusted.com"] + } + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsHead.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsHead.json new file mode 100644 index 000000000000..7407089f02d3 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsHead.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-04-01-preview", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "headers": { + "etag": "AAAAAAAAAAa=" + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsPatch.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsPatch.json new file mode 100644 index 000000000000..970b857d033c --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsPatch.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-04-01-preview", + "subscriptionId": "subid", + "If-Match": "*", + "parameters": { + "properties": { + "allowedOrigins": ["https://trusted.com"] + } + } + }, + "responses": { + "204": {} + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsPut.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsPut.json new file mode 100644 index 000000000000..59ebf9e43fb3 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCorsPut.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-04-01-preview", + "subscriptionId": "subid", + "If-Match": "*", + "parameters": { + "properties": { + "allowedOrigins": ["https://trusted.com"] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/cors", + "type": "Microsoft.ApiManagement/service/portalsettings/cors", + "name": "cors", + "properties": { + "allowedOrigins": ["https://trusted.com"] + } + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspGet.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspGet.json new file mode 100644 index 000000000000..a5e5775bcdd9 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspGet.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-04-01-preview", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/csp", + "type": "Microsoft.ApiManagement/service/portalsettings/csp", + "name": "csp", + "properties": { + "mode": "reportOnly", + "reportUri": "https://report.com", + "allowedSources": [ + "*.trusted.com", + "trusted.com" + ] + } + } + } + } +} \ No newline at end of file diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspHead.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspHead.json new file mode 100644 index 000000000000..7407089f02d3 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspHead.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-04-01-preview", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "headers": { + "etag": "AAAAAAAAAAa=" + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspPatch.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspPatch.json new file mode 100644 index 000000000000..2414c44f4c89 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspPatch.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-04-01-preview", + "subscriptionId": "subid", + "userId": "5931a75ae4bbd512288c680b", + "If-Match": "*", + "parameters": { + "properties": { + "mode": "reportOnly", + "reportUri": "https://report.com", + "allowedSources": [ + "*.trusted.com", + "trusted.com" + ] + } + } + }, + "responses": { + "204": {} + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspPut.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspPut.json new file mode 100644 index 000000000000..9e677b320c8c --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementPortalSettingsCspPut.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-04-01-preview", + "subscriptionId": "subid", + "userId": "5931a75ae4bbd512288c680b", + "If-Match": "*", + "parameters": { + "properties": { + "mode": "reportOnly", + "reportUri": "https://report.com", + "allowedSources": [ + "*.trusted.com", + "trusted.com" + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalsettings/csp", + "type": "Microsoft.ApiManagement/service/portalsettings/csp", + "name": "csp", + "properties": { + "mode": "reportOnly", + "reportUri": "https://report.com", + "allowedSources": [ + "*.trusted.com", + "trusted.com" + ] + } + } + } + } +}