Skip to content

Commit

Permalink
Added CORS and CSP configuration resources (Azure#16822)
Browse files Browse the repository at this point in the history
* Added CORS and CSP settings resources.

* Added missing definitions.

* Added suppression of R4009 for apimportalsettings.json.

* Ran Prettier.

* Renamed definitions.

* Fixed references.

* Updated examples.

* Reversed change.

* Created new resource for portal settings.

* Added list example.

* Added missing collection contract.

* Added missing example. Cleaned up old ones.

* Fixed references.

* Fixed examples

* Fixed version.

* Added custom words. Fixed linting.

* Fixes.

* Fixes.

* Fixes.

* Fixes.

* Fixes.

* Fixes.

* Fixes.

* Fixes.

* Fixes.

* Fixes.

* Fixes

* Fixes.

* Fixes.

* Fixes

* Fixes

* Removed conflicting constraint.

* Updated readme.go.md.

* Reverted removing the restriction.

* Revert "Reverted removing the restriction."

This reverts commit 72d070f.

* Removed duplicate.

* Addressing PR comments.
  • Loading branch information
azaslonov authored and Milan Zolota committed Mar 30, 2022
1 parent 5c79904 commit abd4f9a
Show file tree
Hide file tree
Showing 11 changed files with 692 additions and 1 deletion.
1 change: 1 addition & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,7 @@ polyline
poolusagemetrics
popreceipt
portalsettings
portalconfigs
postbackup
Postgre
Postgres
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,16 @@
"minLength": 1,
"maxLength": 80,
"x-ms-parameter-location": "method"
},
"PortalConfigIdParameter": {
"name": "portalConfigId",
"in": "path",
"required": true,
"type": "string",
"description": "Portal configuration identifier.",
"minLength": 1,
"maxLength": 80,
"x-ms-parameter-location": "method"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
{
"swagger": "2.0",
"info": {
"title": "ApiManagementClient",
"description": "Use this REST API to perform operations on the developer portal configuration.",
"version": "2021-12-01-preview"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow.",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs": {
"get": {
"tags": [
"PortalConfig"
],
"operationId": "PortalConfig_ListByService",
"description": "Lists the developer portal configurations.",
"x-ms-examples": {
"ApiManagementListPortalConfig": {
"$ref": "./examples/ApiManagementListPortalConfig.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 configuration.",
"schema": {
"$ref": "./definitions.json#/definitions/PortalConfigCollection"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}": {
"head": {
"tags": [
"PortalConfig"
],
"operationId": "PortalConfig_GetEntityTag",
"description": "Gets the entity state (Etag) version of the developer portal configuration.",
"x-ms-examples": {
"ApiManagementHeadPortalConfig": {
"$ref": "./examples/ApiManagementHeadPortalConfig.json"
}
},
"parameters": [
{
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/PortalConfigIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
}
],
"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": [
"PortalConfig"
],
"operationId": "PortalConfig_Get",
"description": "Get the developer portal configuration.",
"x-ms-examples": {
"ApiManagementPortalConfig": {
"$ref": "./examples/ApiManagementPortalConfig.json"
}
},
"parameters": [
{
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/PortalConfigIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "The developer portal configuration.",
"schema": {
"$ref": "./definitions.json#/definitions/PortalConfigContract"
},
"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": [
"PortalConfig"
],
"operationId": "PortalConfig_Update",
"description": "Update the developer portal configuration.",
"x-ms-examples": {
"ApiManagementUpdatePortalConfig": {
"$ref": "./examples/ApiManagementUpdatePortalConfig.json"
}
},
"parameters": [
{
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/PortalConfigIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/IfMatchRequiredParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "./definitions.json#/definitions/PortalConfigContract"
},
"description": "Update the developer portal configuration."
}
],
"responses": {
"200": {
"description": "Operation completed successfully.",
"schema": {
"$ref": "./definitions.json#/definitions/PortalConfigContract"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
}
}
}
},
"put": {
"tags": [
"PortalConfig"
],
"operationId": "PortalConfig_CreateOrUpdate",
"description": "Create or update the developer portal configuration.",
"x-ms-examples": {
"ApiManagementUpdatePortalConfig": {
"$ref": "./examples/ApiManagementUpdatePortalConfig.json"
}
},
"parameters": [
{
"$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
},
{
"$ref": "./apimanagement.json#/parameters/PortalConfigIdParameter"
},
{
"$ref": "./apimanagement.json#/parameters/IfMatchRequiredParameter"
},
{
"$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "./definitions.json#/definitions/PortalConfigContract"
},
"description": "Update the developer portal configuration."
}
],
"responses": {
"200": {
"description": "Operation completed successfully.",
"schema": {
"$ref": "./definitions.json#/definitions/PortalConfigContract"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "./apimanagement.json#/definitions/ErrorResponse"
}
}
}
}
}
},
"definitions": {}
}
Loading

0 comments on commit abd4f9a

Please sign in to comment.