-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API for Acs Auth GA version (#12396)
* API for Acs Auth GA version * Update enum as camlCase * run prettier * add voip as custom work * Update an example * Remove kind as property for CommunicationIdentity * Update an example * Update examples * Update description * remove real tokens from examples * Remove identities from endpoint for every example * remove redundancy from operationId set api-version as global open api parameter * Add default response * Update operationId, rename ErrorResponse to CommunicationError * Update CreateIdentityExample * Update examples * Change operationId from CommunicationIdentity_CreateOrUpdate back to CommunicationIdentity_Create. Endpoint doesn't update anything. There is a description for the optional body explaining the purpose. * run prettier * Return 201 for CreateIdentity endpoint * Add readOnly parameter, add innerError parameter * Add "x-nullable" in CommunicationError * Remove x-nullable Co-authored-by: Alexandra Lamiova Pistrakova <apistrak@microsoft.com>
- Loading branch information
1 parent
df3ecf8
commit 5b19c6e
Showing
7 changed files
with
437 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1973,6 +1973,7 @@ VMXNET | |
vnet | ||
vnetid | ||
Vnets | ||
voip | ||
Vpnclient | ||
vpnconfiguration | ||
vpndeviceconfigurationscript | ||
|
359 changes: 359 additions & 0 deletions
359
...lane/Microsoft.CommunicationServicesIdentity/stable/2021-03-07/CommunicationIdentity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,359 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "CommunicationIdentityClient", | ||
"description": "Azure Communication Identity Service", | ||
"version": "2021-03-07" | ||
}, | ||
"paths": { | ||
"/identities": { | ||
"post": { | ||
"tags": [ | ||
"Identity" | ||
], | ||
"summary": "Create a new identity.", | ||
"operationId": "CommunicationIdentity_Create", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"parameters": [ | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
}, | ||
{ | ||
"in": "body", | ||
"name": "body", | ||
"schema": { | ||
"$ref": "#/definitions/CommunicationIdentityCreateRequest" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"default": { | ||
"description": "Error", | ||
"schema": { | ||
"$ref": "#/definitions/CommunicationErrorResponse" | ||
} | ||
}, | ||
"201": { | ||
"description": "Created - Returns the created identity.", | ||
"schema": { | ||
"$ref": "#/definitions/CommunicationIdentityAccessTokenResult" | ||
} | ||
} | ||
}, | ||
"x-ms-examples": { | ||
"Create an Identity": { | ||
"$ref": "./examples/CreateIdentity.json" | ||
} | ||
} | ||
} | ||
}, | ||
"/identities/{id}": { | ||
"delete": { | ||
"tags": [ | ||
"Identity" | ||
], | ||
"summary": "Delete the identity, revoke all tokens for the identity and delete all associated data.", | ||
"operationId": "CommunicationIdentity_Delete", | ||
"produces": [ | ||
"application/json" | ||
], | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"description": "Identifier of the identity to be deleted.", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"default": { | ||
"description": "Error", | ||
"schema": { | ||
"$ref": "#/definitions/CommunicationErrorResponse" | ||
} | ||
}, | ||
"204": { | ||
"description": "Success" | ||
} | ||
}, | ||
"x-ms-examples": { | ||
"Delete an identity": { | ||
"$ref": "./examples/DeleteIdentity.json" | ||
} | ||
} | ||
} | ||
}, | ||
"/identities/{id}/:revokeAccessTokens": { | ||
"post": { | ||
"tags": [ | ||
"Identity" | ||
], | ||
"summary": "Revoke all access tokens for the specific identity.", | ||
"operationId": "CommunicationIdentity_RevokeAccessTokens", | ||
"produces": [ | ||
"application/json" | ||
], | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"description": "Identifier of the identity.", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"default": { | ||
"description": "Error", | ||
"schema": { | ||
"$ref": "#/definitions/CommunicationErrorResponse" | ||
} | ||
}, | ||
"204": { | ||
"description": "Success" | ||
} | ||
}, | ||
"x-ms-examples": { | ||
"Revoke access tokens": { | ||
"$ref": "./examples/RevokeAccessTokens.json" | ||
} | ||
} | ||
} | ||
}, | ||
"/identities/{id}/:issueAccessToken": { | ||
"post": { | ||
"tags": [ | ||
"Token" | ||
], | ||
"summary": "Issue a new token for an identity.", | ||
"operationId": "CommunicationIdentity_IssueAccessToken", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"description": "Identifier of the identity to issue token for.", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
}, | ||
{ | ||
"in": "body", | ||
"name": "body", | ||
"description": "Requesting scopes for the new token.", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/CommunicationIdentityAccessTokenRequest" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"default": { | ||
"description": "Error", | ||
"schema": { | ||
"$ref": "#/definitions/CommunicationErrorResponse" | ||
} | ||
}, | ||
"200": { | ||
"description": "Success", | ||
"schema": { | ||
"$ref": "#/definitions/CommunicationIdentityAccessToken" | ||
} | ||
} | ||
}, | ||
"x-ms-examples": { | ||
"Issue an access token": { | ||
"$ref": "./examples/IssueAccessToken.json" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"CommunicationIdentityTokenScope": { | ||
"description": "List of scopes for an access token.", | ||
"enum": [ | ||
"chat", | ||
"voip" | ||
], | ||
"type": "string", | ||
"x-ms-enum": { | ||
"name": "CommunicationIdentityTokenScope", | ||
"modelAsString": true | ||
} | ||
}, | ||
"CommunicationIdentityCreateRequest": { | ||
"type": "object", | ||
"properties": { | ||
"createTokenWithScopes": { | ||
"description": "Also create access token for the created identity.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/CommunicationIdentityTokenScope" | ||
} | ||
} | ||
} | ||
}, | ||
"CommunicationError": { | ||
"description": "The Communication Services error.", | ||
"required": [ | ||
"code", | ||
"message" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"code": { | ||
"description": "The error code.", | ||
"type": "string" | ||
}, | ||
"message": { | ||
"description": "The error message.", | ||
"type": "string" | ||
}, | ||
"target": { | ||
"description": "The error target.", | ||
"type": "string", | ||
"readOnly": true | ||
}, | ||
"details": { | ||
"description": "Further details about specific errors that led to this error.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/CommunicationError" | ||
}, | ||
"readOnly": true | ||
}, | ||
"innerError": { | ||
"$ref": "#/definitions/CommunicationError" | ||
} | ||
} | ||
}, | ||
"CommunicationErrorResponse": { | ||
"description": "The Communication Services error.", | ||
"required": [ | ||
"error" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"error": { | ||
"$ref": "#/definitions/CommunicationError" | ||
} | ||
} | ||
}, | ||
"CommunicationIdentity": { | ||
"description": "A communication identity.", | ||
"required": [ | ||
"id" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"description": "Identifier of the identity.", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"CommunicationIdentityAccessToken": { | ||
"description": "An access token.", | ||
"required": [ | ||
"expiresOn", | ||
"token" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"token": { | ||
"description": "The access token issued for the identity.", | ||
"type": "string" | ||
}, | ||
"expiresOn": { | ||
"format": "date-time", | ||
"description": "The expiry time of the token.", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"CommunicationIdentityAccessTokenResult": { | ||
"description": "A communication identity with access token.", | ||
"required": [ | ||
"identity" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"identity": { | ||
"$ref": "#/definitions/CommunicationIdentity" | ||
}, | ||
"accessToken": { | ||
"$ref": "#/definitions/CommunicationIdentityAccessToken" | ||
} | ||
} | ||
}, | ||
"CommunicationIdentityAccessTokenRequest": { | ||
"required": [ | ||
"scopes" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"scopes": { | ||
"description": "List of scopes attached to the token.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/CommunicationIdentityTokenScope" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"parameters": { | ||
"ApiVersionParameter": { | ||
"in": "query", | ||
"name": "api-version", | ||
"description": "Version of API to invoke.", | ||
"required": true, | ||
"type": "string" | ||
} | ||
}, | ||
"securityDefinitions": { | ||
"azure_auth": { | ||
"type": "oauth2", | ||
"flow": "implicit", | ||
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", | ||
"scopes": { | ||
"user_impersonation": "impersonate your user account" | ||
} | ||
} | ||
}, | ||
"x-ms-parameterized-host": { | ||
"hostTemplate": "{endpoint}", | ||
"useSchemePrefix": false, | ||
"parameters": [ | ||
{ | ||
"name": "endpoint", | ||
"description": "The communication resource, for example https://my-resource.communication.azure.com", | ||
"required": true, | ||
"type": "string", | ||
"in": "path", | ||
"x-ms-skip-url-encoding": true, | ||
"x-ms-parameter-location": "client" | ||
} | ||
] | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...ne/Microsoft.CommunicationServicesIdentity/stable/2021-03-07/examples/CreateIdentity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2021-03-07", | ||
"content-type": "application/json", | ||
"endpoint": "https://my-resource.communication.azure.com", | ||
"body": { | ||
"createTokenWithScopes": [ | ||
"chat" | ||
] | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"body": { | ||
"identity": { | ||
"id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081" | ||
}, | ||
"accessToken": { | ||
"token": "token", | ||
"expiresOn": "2020-09-10T21:39:39.3244584+00:00" | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.