From a26928deb92a0d76a6102d53c421721e43cfa915 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 12 Dec 2024 12:58:25 +0530 Subject: [PATCH 01/20] Copy files from preview/2023-10-01-preview Copied the files in a separate commit. This allows reviewers to easily diff subsequent changes against the previous spec. --- .../AccessTokens_CreateAccessToken.json | 36 + .../AccessTokens_DeleteAccessToken.json | 12 + .../examples/AccessTokens_GetAccessToken.json | 21 + .../AccessTokens_ListAccessTokens.json | 25 + .../examples/Accounts_GetAccount.json | 25 + .../stable/2024-12-01/playwrighttesting.json | 736 ++++++++++++++++++ 6 files changed, 855 insertions(+) create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json new file mode 100644 index 000000000000..17f6fd010929 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json @@ -0,0 +1,36 @@ +{ + "title": "AccessTokens_CreateAccessToken", + "operationId": "AccessTokens_CreateAccessToken", + "parameters": { + "api-version": "2023-10-01-preview", + "accountId": "sampleAccountId", + "accessTokenId": "00000000-0000-0000-0000-000000000000", + "resource": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "expiryAt": "2022-09-28T12:32:33Z" + } + }, + "responses": { + "200": { + "body": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + }, + "201": { + "body": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json new file mode 100644 index 000000000000..1dfb8f32a21e --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json @@ -0,0 +1,12 @@ +{ + "title": "AccessTokens_DeleteAccessToken", + "operationId": "AccessTokens_DeleteAccessToken", + "parameters": { + "api-version": "2023-10-01-preview", + "accountId": "sampleAccountId", + "accessTokenId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "204": {} + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json new file mode 100644 index 000000000000..b8669c51f92a --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json @@ -0,0 +1,21 @@ +{ + "title": "AccessTokens_GetAccessToken", + "operationId": "AccessTokens_GetAccessToken", + "parameters": { + "api-version": "2023-10-01-preview", + "accountId": "sampleAccountId", + "accessTokenId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json new file mode 100644 index 000000000000..01623f41f9f5 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json @@ -0,0 +1,25 @@ +{ + "title": "AccessTokens_ListAccessTokens", + "operationId": "AccessTokens_ListAccessTokens", + "parameters": { + "api-version": "2023-10-01-preview", + "accountId": "sampleAccountId" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json new file mode 100644 index 000000000000..e6a679938510 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json @@ -0,0 +1,25 @@ +{ + "title": "Accounts_GetAccount", + "operationId": "Accounts_GetAccount", + "parameters": { + "api-version": "2023-10-01-preview", + "accountId": "sampleAccountId" + }, + "responses": { + "200": { + "body": { + "id": "sampleAccountId", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount", + "name": "myPlaywrightAccount", + "state": "Active", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "subscriptionState": "Registered", + "tenantId": "00000000-0000-0000-0000-000000000000", + "location": "westus", + "regionalAffinity": "Enabled", + "scalableExecution": "Enabled", + "reporting": "Disabled" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json new file mode 100644 index 000000000000..7389ac6f3622 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json @@ -0,0 +1,736 @@ +{ + "swagger": "2.0", + "info": { + "title": "Microsoft PlaywrightTesting AuthManager Service API", + "version": "2023-10-01-preview", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "api.playwright-int.io", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "OAuth2Auth": [ + "https://preview.playwright-int.io/.default" + ] + } + ], + "securityDefinitions": { + "OAuth2Auth": { + "type": "oauth2", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "https://preview.playwright-int.io/.default": "" + } + } + }, + "tags": [], + "paths": { + "/accounts/{accountId}": { + "get": { + "operationId": "Accounts_GetAccount", + "description": "Get details of the ARM resource mapped to an account for the given accountId.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Account" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Accounts_GetAccount": { + "$ref": "./examples/Accounts_GetAccount.json" + } + } + } + }, + "/accounts/{accountId}/access-tokens": { + "get": { + "operationId": "AccessTokens_ListAccessTokens", + "description": "List access-tokens for a given accountId.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedAccessToken" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "AccessTokens_ListAccessTokens": { + "$ref": "./examples/AccessTokens_ListAccessTokens.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/accounts/{accountId}/access-tokens/{accessTokenId}": { + "get": { + "operationId": "AccessTokens_GetAccessToken", + "description": "Get an access-token for given access-token id in guid format.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string" + }, + { + "name": "accessTokenId", + "in": "path", + "description": "The access-token id.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AccessToken" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "AccessTokens_GetAccessToken": { + "$ref": "./examples/AccessTokens_GetAccessToken.json" + } + } + }, + "put": { + "operationId": "AccessTokens_CreateAccessToken", + "description": "Creates an access-token with given access-token id in guid format.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string" + }, + { + "name": "accessTokenId", + "in": "path", + "description": "The access-token id.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/AccessToken" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AccessToken" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/AccessToken" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "AccessTokens_CreateAccessToken": { + "$ref": "./examples/AccessTokens_CreateAccessToken.json" + } + } + }, + "delete": { + "operationId": "AccessTokens_DeleteAccessToken", + "description": "Revoke an access-token with given access-token id in guid format.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string" + }, + { + "name": "accessTokenId", + "in": "path", + "description": "The access-token id.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. ", + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "AccessTokens_DeleteAccessToken": { + "$ref": "./examples/AccessTokens_DeleteAccessToken.json" + } + } + } + } + }, + "definitions": { + "AccessToken": { + "type": "object", + "description": "Model of an access-token linked to an account.", + "properties": { + "id": { + "$ref": "#/definitions/Azure.Core.uuid", + "description": "The access-token id.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "The access-token name.", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "jwtToken": { + "type": "string", + "description": "The access-token value in JWT format.", + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The access-token createdAt utcDateTime.", + "readOnly": true + }, + "expiryAt": { + "type": "string", + "format": "date-time", + "description": "The access-token expiryAt utcDateTime.", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "state": { + "$ref": "#/definitions/AccessTokenState", + "description": "The access-token state - Active | Expired.", + "readOnly": true + } + }, + "required": [ + "id", + "name", + "expiryAt" + ] + }, + "AccessTokenState": { + "type": "string", + "description": "The access-token state.", + "enum": [ + "Active", + "Expired" + ], + "x-ms-enum": { + "name": "AccessTokenState", + "modelAsString": true, + "values": [ + { + "name": "Active", + "value": "Active", + "description": "The access-token is Active." + }, + { + "name": "Expired", + "value": "Expired", + "description": "The access-token is Expired." + } + ] + } + }, + "Account": { + "type": "object", + "description": "An account is a parent resource for most of the other service resources. It's directly mapped to an ARM resource and helps to create a link between control-plane and data-plane resources.", + "properties": { + "id": { + "type": "string", + "description": "The account id.", + "readOnly": true + }, + "resourceId": { + "type": "string", + "description": "The ARM fully-qualified resource id for the account.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "The account name.", + "readOnly": true + }, + "state": { + "$ref": "#/definitions/AccountState", + "description": "The state of account - Active | Inactive", + "readOnly": true + }, + "subscriptionId": { + "$ref": "#/definitions/Azure.Core.uuid", + "description": "The ARM-based subscription id for the account.", + "readOnly": true + }, + "subscriptionState": { + "$ref": "#/definitions/SubscriptionState", + "description": "The ARM-based subscription state - Registered | Unregistered | Warned | Suspended | Deleted", + "readOnly": true + }, + "tenantId": { + "$ref": "#/definitions/Azure.Core.uuid", + "description": "The Azure tenant id of the account.", + "readOnly": true + }, + "location": { + "type": "string", + "description": "The account resource ARM location, for eg. eastus, southeastasia.", + "readOnly": true + }, + "regionalAffinity": { + "type": "string", + "description": "This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created.", + "default": "Enabled", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "EnablementStatus", + "modelAsString": true, + "values": [ + { + "name": "Enabled", + "value": "Enabled", + "description": "The feature is Enabled." + }, + { + "name": "Disabled", + "value": "Disabled", + "description": "The feature is Disabled." + } + ] + }, + "readOnly": true + }, + "scalableExecution": { + "type": "string", + "description": "When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations.", + "default": "Enabled", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "EnablementStatus", + "modelAsString": true, + "values": [ + { + "name": "Enabled", + "value": "Enabled", + "description": "The feature is Enabled." + }, + { + "name": "Disabled", + "value": "Disabled", + "description": "The feature is Disabled." + } + ] + }, + "readOnly": true + }, + "reporting": { + "type": "string", + "description": "When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting.", + "default": "Disabled", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "EnablementStatus", + "modelAsString": true, + "values": [ + { + "name": "Enabled", + "value": "Enabled", + "description": "The feature is Enabled." + }, + { + "name": "Disabled", + "value": "Disabled", + "description": "The feature is Disabled." + } + ] + }, + "readOnly": true + } + }, + "required": [ + "id", + "resourceId", + "name", + "state", + "subscriptionId", + "subscriptionState", + "tenantId", + "location" + ] + }, + "AccountState": { + "type": "string", + "description": "The account state.", + "enum": [ + "Active", + "Inactive" + ], + "x-ms-enum": { + "name": "AccountState", + "modelAsString": true, + "values": [ + { + "name": "Active", + "value": "Active", + "description": "The account is Active." + }, + { + "name": "Inactive", + "value": "Inactive", + "description": "The account is Inactive." + } + ] + } + }, + "Azure.Core.Foundations.Error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [] + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "description": "A response containing error details.", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + } + }, + "Azure.Core.uuid": { + "type": "string", + "format": "uuid", + "description": "Universally Unique Identifier" + }, + "PagedAccessToken": { + "type": "object", + "description": "Paged collection of AccessToken items", + "properties": { + "value": { + "type": "array", + "description": "The AccessToken items on this page", + "items": { + "$ref": "#/definitions/AccessToken" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "SubscriptionState": { + "type": "string", + "description": "The ARM-based subscription state.", + "enum": [ + "Registered", + "Warned", + "Suspended", + "Deleted", + "Unregistered" + ], + "x-ms-enum": { + "name": "SubscriptionState", + "modelAsString": true, + "values": [ + { + "name": "Registered", + "value": "Registered", + "description": "The subscription state is Registered." + }, + { + "name": "Warned", + "value": "Warned", + "description": "The subscription state is Warned." + }, + { + "name": "Suspended", + "value": "Suspended", + "description": "The subscription state is Suspended." + }, + { + "name": "Deleted", + "value": "Deleted", + "description": "The subscription state is Deleted." + }, + { + "name": "Unregistered", + "value": "Unregistered", + "description": "The subscription state is Unregistered." + } + ] + } + } + }, + "parameters": { + "Azure.Core.ClientRequestIdHeader": { + "name": "x-ms-client-request-id", + "in": "header", + "description": "An opaque, globally-unique, client-generated string identifier for the request.", + "required": false, + "type": "string", + "format": "uuid", + "x-ms-parameter-location": "method", + "x-ms-client-name": "clientRequestId" + }, + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-client-name": "apiVersion" + } + } +} From 36c6afdb886a1783674f032d5a76981b9b243166 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 12 Dec 2024 12:58:26 +0530 Subject: [PATCH 02/20] Update version to stable/2024-12-01 Updated the API version from preview/2023-10-01-preview to stable/2024-12-01. --- .../2024-12-01/examples/AccessTokens_CreateAccessToken.json | 3 ++- .../2024-12-01/examples/AccessTokens_DeleteAccessToken.json | 3 ++- .../2024-12-01/examples/AccessTokens_GetAccessToken.json | 3 ++- .../2024-12-01/examples/AccessTokens_ListAccessTokens.json | 3 ++- .../stable/2024-12-01/examples/Accounts_GetAccount.json | 3 ++- .../stable/2024-12-01/playwrighttesting.json | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json index 17f6fd010929..fcf2f0a656c9 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json @@ -2,7 +2,7 @@ "title": "AccessTokens_CreateAccessToken", "operationId": "AccessTokens_CreateAccessToken", "parameters": { - "api-version": "2023-10-01-preview", + "api-version": "2024-12-01", "accountId": "sampleAccountId", "accessTokenId": "00000000-0000-0000-0000-000000000000", "resource": { @@ -34,3 +34,4 @@ } } } + diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json index 1dfb8f32a21e..eb16c3f5ff90 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json @@ -2,7 +2,7 @@ "title": "AccessTokens_DeleteAccessToken", "operationId": "AccessTokens_DeleteAccessToken", "parameters": { - "api-version": "2023-10-01-preview", + "api-version": "2024-12-01", "accountId": "sampleAccountId", "accessTokenId": "00000000-0000-0000-0000-000000000000" }, @@ -10,3 +10,4 @@ "204": {} } } + diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json index b8669c51f92a..2f8f33f6659e 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json @@ -2,7 +2,7 @@ "title": "AccessTokens_GetAccessToken", "operationId": "AccessTokens_GetAccessToken", "parameters": { - "api-version": "2023-10-01-preview", + "api-version": "2024-12-01", "accountId": "sampleAccountId", "accessTokenId": "00000000-0000-0000-0000-000000000000" }, @@ -19,3 +19,4 @@ } } } + diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json index 01623f41f9f5..97bc7c2d07c6 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json @@ -2,7 +2,7 @@ "title": "AccessTokens_ListAccessTokens", "operationId": "AccessTokens_ListAccessTokens", "parameters": { - "api-version": "2023-10-01-preview", + "api-version": "2024-12-01", "accountId": "sampleAccountId" }, "responses": { @@ -23,3 +23,4 @@ } } } + diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json index e6a679938510..185894f5273d 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json @@ -2,7 +2,7 @@ "title": "Accounts_GetAccount", "operationId": "Accounts_GetAccount", "parameters": { - "api-version": "2023-10-01-preview", + "api-version": "2024-12-01", "accountId": "sampleAccountId" }, "responses": { @@ -23,3 +23,4 @@ } } } + diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json index 7389ac6f3622..685a608b6d2b 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "Microsoft PlaywrightTesting AuthManager Service API", - "version": "2023-10-01-preview", + "version": "2024-12-01", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" @@ -734,3 +734,4 @@ } } } + From 52a1a37b2d9afd4c20a621dcf0103e8900d76225 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 12 Dec 2024 12:58:27 +0530 Subject: [PATCH 03/20] Added tag for 2024-12-01 in readme file --- specification/playwrighttesting/data-plane/readme.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/specification/playwrighttesting/data-plane/readme.md b/specification/playwrighttesting/data-plane/readme.md index 75117f82cfde..e5982387dfec 100644 --- a/specification/playwrighttesting/data-plane/readme.md +++ b/specification/playwrighttesting/data-plane/readme.md @@ -26,12 +26,21 @@ These are the global settings for the playwrighttesting. ```yaml openapi-type: data-plane -tag: package-2023-10-01-preview +tag: package-2024-12-01 title: [[Title]] security: AADToken security-scopes: [[SecurityScopes]] ``` +### Tag: package-2024-12-01 + +These settings apply only when `--tag=package-2024-12-01` is specified on the command line. + +```yaml $(tag) == 'package-2024-12-01' +input-file: + - Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json +``` + ### Tag: package-2023-10-01-preview These settings apply only when `--tag=package-2023-10-01-preview` is specified on the command line. From 9cc32832a6393dda2f844e49ae4604f224627ef6 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 12 Dec 2024 13:35:36 +0530 Subject: [PATCH 04/20] Added stable api-version for data-plane auth manager apis --- .../2024-12-01/AccessTokens_Create.json} | 6 +- .../2024-12-01/AccessTokens_Delete.json} | 6 +- .../2024-12-01/AccessTokens_Get.json} | 6 +- .../2024-12-01/AccessTokens_List.json} | 6 +- .../2024-12-01/AccessTokens_Validate.json | 11 + .../2024-12-01/Accounts_Get copy.json} | 9 +- .../2024-12-01/Accounts_GetBrowsers.json | 16 ++ .../main.tsp | 121 +++++++-- .../tspconfig.yaml | 46 ++++ .../PlaywrightTesting.Management/main.tsp | 2 +- .../PlaywrightTesting/tspconfig.yaml | 15 -- .../examples/AccessTokens_Create.json | 36 +++ .../AccessTokens_CreateAccessToken.json | 1 - .../examples/AccessTokens_Delete.json | 12 + .../AccessTokens_DeleteAccessToken.json | 1 - .../2024-12-01/examples/AccessTokens_Get.json | 21 ++ .../examples/AccessTokens_GetAccessToken.json | 1 - .../examples/AccessTokens_List.json | 25 ++ .../AccessTokens_ListAccessTokens.json | 1 - .../examples/AccessTokens_Validate.json | 11 + .../examples/Accounts_Get copy.json | 26 ++ .../examples/Accounts_GetAccount.json | 1 - .../examples/Accounts_GetBrowsers.json | 16 ++ .../stable/2024-12-01/playwrighttesting.json | 241 +++++++++++++++--- 24 files changed, 541 insertions(+), 96 deletions(-) rename specification/playwrighttesting/{PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_CreateAccessToken.json => PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Create.json} (86%) rename specification/playwrighttesting/{PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_DeleteAccessToken.json => PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json} (53%) rename specification/playwrighttesting/{PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_GetAccessToken.json => PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json} (76%) rename specification/playwrighttesting/{PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_ListAccessTokens.json => PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json} (77%) create mode 100644 specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Validate.json rename specification/playwrighttesting/{PlaywrightTesting/examples/2023-10-01-preview/Accounts_GetAccount.json => PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get copy.json} (81%) create mode 100644 specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json rename specification/playwrighttesting/{PlaywrightTesting => PlaywrightTesting.AuthManager}/main.tsp (52%) create mode 100644 specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml delete mode 100644 specification/playwrighttesting/PlaywrightTesting/tspconfig.yaml create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Create.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Validate.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get copy.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json diff --git a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_CreateAccessToken.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Create.json similarity index 86% rename from specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_CreateAccessToken.json rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Create.json index 17f6fd010929..537c8289dd69 100644 --- a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_CreateAccessToken.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Create.json @@ -1,8 +1,8 @@ { - "title": "AccessTokens_CreateAccessToken", - "operationId": "AccessTokens_CreateAccessToken", + "title": "AccessTokens_Create", + "operationId": "AccessTokens_Create", "parameters": { - "api-version": "2023-10-01-preview", + "api-version": "2024-12-01", "accountId": "sampleAccountId", "accessTokenId": "00000000-0000-0000-0000-000000000000", "resource": { diff --git a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_DeleteAccessToken.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json similarity index 53% rename from specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_DeleteAccessToken.json rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json index 1dfb8f32a21e..f6c247c6ea02 100644 --- a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_DeleteAccessToken.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json @@ -1,8 +1,8 @@ { - "title": "AccessTokens_DeleteAccessToken", - "operationId": "AccessTokens_DeleteAccessToken", + "title": "AccessTokens_Delete", + "operationId": "AccessTokens_Delete", "parameters": { - "api-version": "2023-10-01-preview", + "api-version": "2024-12-01", "accountId": "sampleAccountId", "accessTokenId": "00000000-0000-0000-0000-000000000000" }, diff --git a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_GetAccessToken.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json similarity index 76% rename from specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_GetAccessToken.json rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json index b8669c51f92a..ff184a5d0d94 100644 --- a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_GetAccessToken.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json @@ -1,8 +1,8 @@ { - "title": "AccessTokens_GetAccessToken", - "operationId": "AccessTokens_GetAccessToken", + "title": "AccessTokens_Get", + "operationId": "AccessTokens_Get", "parameters": { - "api-version": "2023-10-01-preview", + "api-version": "2024-12-01", "accountId": "sampleAccountId", "accessTokenId": "00000000-0000-0000-0000-000000000000" }, diff --git a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_ListAccessTokens.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json similarity index 77% rename from specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_ListAccessTokens.json rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json index 01623f41f9f5..02961a65efb7 100644 --- a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_ListAccessTokens.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json @@ -1,8 +1,8 @@ { - "title": "AccessTokens_ListAccessTokens", - "operationId": "AccessTokens_ListAccessTokens", + "title": "AccessTokens_List", + "operationId": "AccessTokens_List", "parameters": { - "api-version": "2023-10-01-preview", + "api-version": "2024-12-01", "accountId": "sampleAccountId" }, "responses": { diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Validate.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Validate.json new file mode 100644 index 000000000000..e4ff529aebae --- /dev/null +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Validate.json @@ -0,0 +1,11 @@ +{ + "title": "AccessTokens_Validate", + "operationId": "AccessTokens_Validate", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId" + }, + "responses": { + "200": {} + } +} diff --git a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/Accounts_GetAccount.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get copy.json similarity index 81% rename from specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/Accounts_GetAccount.json rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get copy.json index e6a679938510..c06187f52fdf 100644 --- a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/Accounts_GetAccount.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get copy.json @@ -1,8 +1,8 @@ { - "title": "Accounts_GetAccount", - "operationId": "Accounts_GetAccount", + "title": "Accounts_Get", + "operationId": "Accounts_Get", "parameters": { - "api-version": "2023-10-01-preview", + "api-version": "2024-12-01", "accountId": "sampleAccountId" }, "responses": { @@ -18,7 +18,8 @@ "location": "westus", "regionalAffinity": "Enabled", "scalableExecution": "Enabled", - "reporting": "Disabled" + "reporting": "Disabled", + "localAuth": "Enabled" } } } diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json new file mode 100644 index 000000000000..fc43e7fc5edd --- /dev/null +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json @@ -0,0 +1,16 @@ +{ + "title": "Accounts_GetBrowsers", + "operationId": "Accounts_GetBrowsers", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId", + "os": "linux" + }, + "responses": { + "302": { + "headers": { + "location": "wss://{region}.api.playwright.microsoft.com/redirectURL?api-version=2024-06-01-preview&os=linux" + } + } + } +} diff --git a/specification/playwrighttesting/PlaywrightTesting/main.tsp b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp similarity index 52% rename from specification/playwrighttesting/PlaywrightTesting/main.tsp rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp index d5d85fca81f1..7ca93510f219 100644 --- a/specification/playwrighttesting/PlaywrightTesting/main.tsp +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp @@ -15,8 +15,15 @@ using Azure.Core.Traits; using Autorest; @server( - "https://api.playwright-int.io", - "Azure Playwright Service API Endpoint" + "{endpoint}", + "Microsoft Azure Playwright Service API Endpoint", + { + @doc(""" +Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + https://{region}.api.playwright.microsoft.com). +""") + endpoint: string, + } ) @useAuth( [ @@ -24,7 +31,7 @@ using Autorest; { type: OAuth2FlowType.implicit, authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize", - scopes: ["https://preview.playwright-int.io/.default"], + scopes: ["https://playwright.microsoft.com/.default"], } ]> ] @@ -37,14 +44,14 @@ namespace Microsoft.PlaywrightTesting.AuthManager; @doc("The PlaywrightTesting Auth Manager service version.") enum Versions { - @doc("Version 2023-10-01-preview") + @doc("Version 2024-12-01") @useDependency(Azure.Core.Versions.v1_0_Preview_2) - `2023-10-01-preview`, + `2024-12-01`, } // Models //////////////////// -@doc("An account is a parent resource for most of the other service resources. It's directly mapped to an ARM resource and helps to create a link between control-plane and data-plane resources.") +@doc("An account is a parent resource for most of the other service resources. It's directly mapped to an Azure resource.") @resource("accounts") model Account { @key("accountId") @@ -52,7 +59,7 @@ model Account { @visibility("read") id: string; - @doc("The ARM fully-qualified resource id for the account.") + @doc("The fully-qualified Azure resource id for the account.") @visibility("read") resourceId: string; @@ -64,11 +71,11 @@ model Account { @visibility("read") state: AccountState; - @doc("The ARM-based subscription id for the account.") + @doc("The Azure subscription id for the account.") @visibility("read") subscriptionId: uuid; - @doc("The ARM-based subscription state - Registered | Unregistered | Warned | Suspended | Deleted") + @doc("The Azure subscription state - Registered | Unregistered | Warned | Suspended | Deleted") @visibility("read") subscriptionState: SubscriptionState; @@ -76,7 +83,7 @@ model Account { @visibility("read") tenantId: uuid; - @doc("The account resource ARM location, for eg. eastus, southeastasia.") + @doc("The account resource location in Azure, for eg. eastus, southeastasia.") @visibility("read") location: string; @@ -90,7 +97,11 @@ model Account { @doc("When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting.") @visibility("read") - reporting?: EnablementStatus = EnablementStatus.Disabled; + reporting?: EnablementStatus = EnablementStatus.Enabled; + + @doc("When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations.") + @visibility("read") + localAuth?: EnablementStatus = EnablementStatus.Disabled; } @doc("The account state.") @@ -104,7 +115,7 @@ union AccountState { "Inactive", } -@doc("The ARM-based subscription state.") +@doc("The Azure subscription state.") union SubscriptionState { string, @@ -146,7 +157,7 @@ model AccessToken { @doc("The access-token createdAt utcDateTime.") @visibility("read") - createdAt?: utcDateTime; + createdAt: utcDateTime; @doc("The access-token expiryAt utcDateTime.") @visibility("read", "create") @@ -154,7 +165,7 @@ model AccessToken { @doc("The access-token state - Active | Expired.") @visibility("read") - state?: AccessTokenState; + state: AccessTokenState; } @doc("The access-token state.") @@ -162,10 +173,10 @@ union AccessTokenState { string, @doc("The access-token is Active.") - "Active", + Active: "Active", @doc("The access-token is Expired.") - "Expired", + Expired: "Expired", } @doc("The enablement status of a feature.") @@ -179,6 +190,17 @@ union EnablementStatus { Disabled: "Disabled", } +@doc("The os to configure for remote test runs.") +union OS { + string, + + @doc("Linux OS.") + Linux: "linux", + + @doc("Windows OS.") + Windows: "windows", +} + // Operations //////////////////// alias ServiceTraits = NoRepeatableRequests & @@ -189,23 +211,66 @@ alias Operations = Azure.Core.ResourceOperations; interface AccessTokens { // AccessToken Operations + // #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Existing name" + @doc("Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") + @example("./AccessTokens_Create.json", "AccessTokens_Create") + create is Operations.ResourceCreateOrReplace; + + @doc("Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") + @example("./AccessTokens_Get.json", "AccessTokens_Get") + get is Operations.ResourceRead; + + @doc("Deletes an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") + @example("./AccessTokens_Delete.json", "AccessTokens_Delete") + delete is Operations.ResourceDelete; + + @doc("Lists access-tokens for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.") + @example("./AccessTokens_List.json", "AccessTokens_List") + list is Operations.ResourceList; + + @doc("Validates access-token provided in authorization header for the given account id. Authorization required is Bearer JWT Access token provided by MPT service.") + @example("./AccessTokens_Validate.json", "AccessTokens_Validate") + @actionSeparator("/") + validate is Operations.ResourceCollectionAction; +} + +alias GetBrowsersParams = { + @query + @doc("The run id provided by client for corresponding remote test run.") + runId?: string; - #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Existing name" - @doc("Creates an access-token with given access-token id in guid format.") - createAccessToken is Operations.ResourceCreateOrReplace; + @query + @doc("The os provided by client for remote test runs.") + os?: OS = OS.Linux; - @doc("Get an access-token for given access-token id in guid format.") - getAccessToken is Operations.ResourceRead; + @path + @doc("The account id.") + accountId: string; +}; - @doc("Revoke an access-token with given access-token id in guid format.") - deleteAccessToken is Operations.ResourceDelete; +alias GetBrowsersResponse = { + @statusCode + _: 302; - @doc("List access-tokens for a given accountId.") - listAccessTokens is Operations.ResourceList; -} + @header + @doc("The redirect target URL to run test on remote browsers.") + location: url; +}; interface Accounts { // Accounts Operations - @doc("Get details of the ARM resource mapped to an account for the given accountId.") - getAccount is Operations.ResourceRead; + + @doc("Get details of the Azure resource mapped to an account for the given accountId. Authorization required is Bearer JWT Access token provided by EntraID.") + @example("./Accounts_Get.json", "Accounts_Get") + get is Operations.ResourceRead; + + #suppress "@azure-tools/typespec-azure-core/no-rpc-path-params" "Operations defined using RpcOperation should not have path parameters. Consider using ResourceAction or ResourceCollectionAction instead." + @doc("Gets remote browsers corresponding to given accountId and redirects the client for running MPT tests. Authorization required is Bearer JWT Access token provided by EntraID or MPT Service.") + @example("./Accounts_GetBrowsers.json", "Accounts_GetBrowsers") + @route("/accounts/{accountId}/browsers") + getBrowsers is RpcOperation< + GetBrowsersParams, + GetBrowsersResponse, + ServiceTraits + >; } diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml new file mode 100644 index 000000000000..3ca1739cad38 --- /dev/null +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml @@ -0,0 +1,46 @@ +emit: + - "@azure-tools/typespec-autorest" +linter: + extends: + - "@azure-tools/typespec-azure-rulesets/data-plane" +parameters: + "service-dir": + default: "sdk/playwrighttesting" +options: + "@azure-tools/typespec-autorest": + azure-resource-provider-folder: "data-plane" + #emit-lro-options: "none" + emitter-output-dir: "{project-root}/.." + examples-directory: "{project-root}/examples" + output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/playwrighttesting.json" + omit-unreachable-types: true + "@azure-tools/typespec-python": + package-dir: "azure-developer-microsoftplaywrighttesting" + package-name: "{package-dir}" + # emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" + package-mode: azure-dataplane + flavor: azure + "@azure-tools/typespec-ts": + package-dir: "microsoft-playwright-testing-rest" + title: Microsoft Playwright Testing + description: Microsoft Playwright Testing Client + generateMetadata: true + generateTest: false + packageDetails: + name: "@azure-rest/microsoft-playwright-testing" + description: "This package contains Microsoft Playwright Testing client library." + version: 1.0.0 + flavor: azure + "@azure-tools/typespec-csharp": + package-dir: "Azure.Developer.MicrosoftPlaywrightTesting" + clear-output-folder: true + model-namespace: false + namespace: "{package-dir}" + flavor: azure + "@azure-tools/typespec-java": + package-dir: "azure-developer-microsoftplaywrighttesting" + namespace: com.azure.developer.microsoftplaywrighttesting + partial-update: true + generate-tests: false + service-name: Microsoft Playwright Testing + flavor: azure \ No newline at end of file diff --git a/specification/playwrighttesting/PlaywrightTesting.Management/main.tsp b/specification/playwrighttesting/PlaywrightTesting.Management/main.tsp index 6f1579272e50..6583cebc20b5 100644 --- a/specification/playwrighttesting/PlaywrightTesting.Management/main.tsp +++ b/specification/playwrighttesting/PlaywrightTesting.Management/main.tsp @@ -55,7 +55,7 @@ model AccountProperties { @doc("When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting.") reporting?: EnablementStatus = EnablementStatus.Enabled; - @doc("When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs.") + @doc("When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations.") localAuth?: EnablementStatus = EnablementStatus.Disabled; @visibility("read") diff --git a/specification/playwrighttesting/PlaywrightTesting/tspconfig.yaml b/specification/playwrighttesting/PlaywrightTesting/tspconfig.yaml deleted file mode 100644 index d0d4ffa73239..000000000000 --- a/specification/playwrighttesting/PlaywrightTesting/tspconfig.yaml +++ /dev/null @@ -1,15 +0,0 @@ -emit: - - "@azure-tools/typespec-autorest" -linter: - extends: - - "@azure-tools/typespec-azure-rulesets/data-plane" -parameters: - "service-directory-name": - default: "playwrighttesting" -options: - "@azure-tools/typespec-autorest": - azure-resource-provider-folder: "data-plane" - emit-lro-options: "none" - emitter-output-dir: "{project-root}/.." - output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/playwrighttesting.json" - omit-unreachable-types: true diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Create.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Create.json new file mode 100644 index 000000000000..537c8289dd69 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Create.json @@ -0,0 +1,36 @@ +{ + "title": "AccessTokens_Create", + "operationId": "AccessTokens_Create", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId", + "accessTokenId": "00000000-0000-0000-0000-000000000000", + "resource": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "expiryAt": "2022-09-28T12:32:33Z" + } + }, + "responses": { + "200": { + "body": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + }, + "201": { + "body": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json index fcf2f0a656c9..aeda8908de2b 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json @@ -34,4 +34,3 @@ } } } - diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json new file mode 100644 index 000000000000..f6c247c6ea02 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json @@ -0,0 +1,12 @@ +{ + "title": "AccessTokens_Delete", + "operationId": "AccessTokens_Delete", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId", + "accessTokenId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "204": {} + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json index eb16c3f5ff90..667aeb93d4aa 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json @@ -10,4 +10,3 @@ "204": {} } } - diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json new file mode 100644 index 000000000000..ff184a5d0d94 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json @@ -0,0 +1,21 @@ +{ + "title": "AccessTokens_Get", + "operationId": "AccessTokens_Get", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId", + "accessTokenId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json index 2f8f33f6659e..01d774ef0a99 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json @@ -19,4 +19,3 @@ } } } - diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json new file mode 100644 index 000000000000..02961a65efb7 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json @@ -0,0 +1,25 @@ +{ + "title": "AccessTokens_List", + "operationId": "AccessTokens_List", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json index 97bc7c2d07c6..b09af67b9de5 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json @@ -23,4 +23,3 @@ } } } - diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Validate.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Validate.json new file mode 100644 index 000000000000..e4ff529aebae --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Validate.json @@ -0,0 +1,11 @@ +{ + "title": "AccessTokens_Validate", + "operationId": "AccessTokens_Validate", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId" + }, + "responses": { + "200": {} + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get copy.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get copy.json new file mode 100644 index 000000000000..c06187f52fdf --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get copy.json @@ -0,0 +1,26 @@ +{ + "title": "Accounts_Get", + "operationId": "Accounts_Get", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId" + }, + "responses": { + "200": { + "body": { + "id": "sampleAccountId", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount", + "name": "myPlaywrightAccount", + "state": "Active", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "subscriptionState": "Registered", + "tenantId": "00000000-0000-0000-0000-000000000000", + "location": "westus", + "regionalAffinity": "Enabled", + "scalableExecution": "Enabled", + "reporting": "Disabled", + "localAuth": "Enabled" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json index 185894f5273d..f4c23dba4c9c 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json @@ -23,4 +23,3 @@ } } } - diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json new file mode 100644 index 000000000000..fc43e7fc5edd --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json @@ -0,0 +1,16 @@ +{ + "title": "Accounts_GetBrowsers", + "operationId": "Accounts_GetBrowsers", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId", + "os": "linux" + }, + "responses": { + "302": { + "headers": { + "location": "wss://{region}.api.playwright.microsoft.com/redirectURL?api-version=2024-06-01-preview&os=linux" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json index 685a608b6d2b..121cad93a2a6 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json @@ -12,7 +12,19 @@ "schemes": [ "https" ], - "host": "api.playwright-int.io", + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "in": "path", + "description": "Supported Azure Playwright Service API Endpoints (protocol and hostname, for example:\n https://{region}.api.playwright.microsoft.com).", + "required": true, + "type": "string" + } + ] + }, "produces": [ "application/json" ], @@ -22,7 +34,7 @@ "security": [ { "OAuth2Auth": [ - "https://preview.playwright-int.io/.default" + "https://playwright.microsoft.com/.default" ] } ], @@ -32,7 +44,7 @@ "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { - "https://preview.playwright-int.io/.default": "" + "https://playwright.microsoft.com/.default": "" } } }, @@ -40,8 +52,8 @@ "paths": { "/accounts/{accountId}": { "get": { - "operationId": "Accounts_GetAccount", - "description": "Get details of the ARM resource mapped to an account for the given accountId.", + "operationId": "Accounts_Get", + "description": "Get details of the Azure resource mapped to an account for the given accountId. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -85,16 +97,16 @@ } }, "x-ms-examples": { - "Accounts_GetAccount": { - "$ref": "./examples/Accounts_GetAccount.json" + "Accounts_Get": { + "$ref": "./examples/Accounts_Get copy.json" } } } }, "/accounts/{accountId}/access-tokens": { "get": { - "operationId": "AccessTokens_ListAccessTokens", - "description": "List access-tokens for a given accountId.", + "operationId": "AccessTokens_List", + "description": "Lists access-tokens for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -138,8 +150,8 @@ } }, "x-ms-examples": { - "AccessTokens_ListAccessTokens": { - "$ref": "./examples/AccessTokens_ListAccessTokens.json" + "AccessTokens_List": { + "$ref": "./examples/AccessTokens_List.json" } }, "x-ms-pageable": { @@ -149,8 +161,8 @@ }, "/accounts/{accountId}/access-tokens/{accessTokenId}": { "get": { - "operationId": "AccessTokens_GetAccessToken", - "description": "Get an access-token for given access-token id in guid format.", + "operationId": "AccessTokens_Get", + "description": "Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -202,14 +214,14 @@ } }, "x-ms-examples": { - "AccessTokens_GetAccessToken": { - "$ref": "./examples/AccessTokens_GetAccessToken.json" + "AccessTokens_Get": { + "$ref": "./examples/AccessTokens_Get.json" } } }, "put": { - "operationId": "AccessTokens_CreateAccessToken", - "description": "Creates an access-token with given access-token id in guid format.", + "operationId": "AccessTokens_Create", + "description": "Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -283,14 +295,14 @@ } }, "x-ms-examples": { - "AccessTokens_CreateAccessToken": { - "$ref": "./examples/AccessTokens_CreateAccessToken.json" + "AccessTokens_Create": { + "$ref": "./examples/AccessTokens_Create.json" } } }, "delete": { - "operationId": "AccessTokens_DeleteAccessToken", - "description": "Revoke an access-token with given access-token id in guid format.", + "operationId": "AccessTokens_Delete", + "description": "Deletes an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -339,8 +351,148 @@ } }, "x-ms-examples": { - "AccessTokens_DeleteAccessToken": { - "$ref": "./examples/AccessTokens_DeleteAccessToken.json" + "AccessTokens_Delete": { + "$ref": "./examples/AccessTokens_Delete.json" + } + } + } + }, + "/accounts/{accountId}/access-tokens/validate": { + "post": { + "operationId": "AccessTokens_Validate", + "description": "Validates access-token provided in authorization header for the given account id. Authorization required is Bearer JWT Access token provided by MPT service.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "AccessTokens_Validate": { + "$ref": "./examples/AccessTokens_Validate.json" + } + } + } + }, + "/accounts/{accountId}/browsers": { + "get": { + "operationId": "Accounts_GetBrowsers", + "description": "Gets remote browsers corresponding to given accountId and redirects the client for running MPT tests. Authorization required is Bearer JWT Access token provided by EntraID or MPT Service.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "runId", + "in": "query", + "description": "The run id provided by client for corresponding remote test run.", + "required": false, + "type": "string" + }, + { + "name": "os", + "in": "query", + "description": "The os provided by client for remote test runs.", + "required": false, + "type": "string", + "default": "linux", + "enum": [ + "linux", + "windows" + ], + "x-ms-enum": { + "name": "OS", + "modelAsString": true, + "values": [ + { + "name": "Linux", + "value": "linux", + "description": "Linux OS." + }, + { + "name": "Windows", + "value": "windows", + "description": "Windows OS." + } + ] + } + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "302": { + "description": "Redirection", + "headers": { + "location": { + "type": "string", + "format": "uri", + "description": "The redirect target URL to run test on remote browsers." + }, + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Accounts_GetBrowsers": { + "$ref": "./examples/Accounts_GetBrowsers.json" } } } @@ -396,7 +548,9 @@ "required": [ "id", "name", - "expiryAt" + "createdAt", + "expiryAt", + "state" ] }, "AccessTokenState": { @@ -425,7 +579,7 @@ }, "Account": { "type": "object", - "description": "An account is a parent resource for most of the other service resources. It's directly mapped to an ARM resource and helps to create a link between control-plane and data-plane resources.", + "description": "An account is a parent resource for most of the other service resources. It's directly mapped to an Azure resource.", "properties": { "id": { "type": "string", @@ -434,7 +588,7 @@ }, "resourceId": { "type": "string", - "description": "The ARM fully-qualified resource id for the account.", + "description": "The fully-qualified Azure resource id for the account.", "readOnly": true }, "name": { @@ -449,12 +603,12 @@ }, "subscriptionId": { "$ref": "#/definitions/Azure.Core.uuid", - "description": "The ARM-based subscription id for the account.", + "description": "The Azure subscription id for the account.", "readOnly": true }, "subscriptionState": { "$ref": "#/definitions/SubscriptionState", - "description": "The ARM-based subscription state - Registered | Unregistered | Warned | Suspended | Deleted", + "description": "The Azure subscription state - Registered | Unregistered | Warned | Suspended | Deleted", "readOnly": true }, "tenantId": { @@ -464,7 +618,7 @@ }, "location": { "type": "string", - "description": "The account resource ARM location, for eg. eastus, southeastasia.", + "description": "The account resource location in Azure, for eg. eastus, southeastasia.", "readOnly": true }, "regionalAffinity": { @@ -522,6 +676,32 @@ "reporting": { "type": "string", "description": "When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting.", + "default": "Enabled", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "EnablementStatus", + "modelAsString": true, + "values": [ + { + "name": "Enabled", + "value": "Enabled", + "description": "The feature is Enabled." + }, + { + "name": "Disabled", + "value": "Disabled", + "description": "The feature is Disabled." + } + ] + }, + "readOnly": true + }, + "localAuth": { + "type": "string", + "description": "When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations.", "default": "Disabled", "enum": [ "Enabled", @@ -670,7 +850,7 @@ }, "SubscriptionState": { "type": "string", - "description": "The ARM-based subscription state.", + "description": "The Azure subscription state.", "enum": [ "Registered", "Warned", @@ -734,4 +914,3 @@ } } } - From 1db7b13706ca6b2c008e9ecca1b048251814b563 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 12 Dec 2024 14:47:41 +0530 Subject: [PATCH 05/20] Rectified a typo --- ...counts_Get copy.json => Accounts_Get.json} | 0 .../2024-12-01/Accounts_GetBrowsers.json | 2 +- .../2024-12-01/examples/Accounts_Get.json | 26 +++++++++++++++++++ .../examples/Accounts_GetBrowsers.json | 2 +- .../stable/2024-12-01/playwrighttesting.json | 2 +- 5 files changed, 29 insertions(+), 3 deletions(-) rename specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/{Accounts_Get copy.json => Accounts_Get.json} (100%) create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get copy.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get.json similarity index 100% rename from specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get copy.json rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get.json diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json index fc43e7fc5edd..6544c3581395 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json @@ -9,7 +9,7 @@ "responses": { "302": { "headers": { - "location": "wss://{region}.api.playwright.microsoft.com/redirectURL?api-version=2024-06-01-preview&os=linux" + "location": "wss://{region}.api.playwright.microsoft.com/redirectURL?api-version=2024-12-01&os=linux" } } } diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json new file mode 100644 index 000000000000..c06187f52fdf --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json @@ -0,0 +1,26 @@ +{ + "title": "Accounts_Get", + "operationId": "Accounts_Get", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId" + }, + "responses": { + "200": { + "body": { + "id": "sampleAccountId", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount", + "name": "myPlaywrightAccount", + "state": "Active", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "subscriptionState": "Registered", + "tenantId": "00000000-0000-0000-0000-000000000000", + "location": "westus", + "regionalAffinity": "Enabled", + "scalableExecution": "Enabled", + "reporting": "Disabled", + "localAuth": "Enabled" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json index fc43e7fc5edd..6544c3581395 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json @@ -9,7 +9,7 @@ "responses": { "302": { "headers": { - "location": "wss://{region}.api.playwright.microsoft.com/redirectURL?api-version=2024-06-01-preview&os=linux" + "location": "wss://{region}.api.playwright.microsoft.com/redirectURL?api-version=2024-12-01&os=linux" } } } diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json index 121cad93a2a6..5d9c3d8e72e1 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json @@ -98,7 +98,7 @@ }, "x-ms-examples": { "Accounts_Get": { - "$ref": "./examples/Accounts_Get copy.json" + "$ref": "./examples/Accounts_Get.json" } } } From 2cb194c1110e9858a44b075666f053c4d507dcb4 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 12 Dec 2024 15:18:11 +0530 Subject: [PATCH 06/20] Typespec Validation error resolved --- .../PlaywrightTesting.AuthManager/main.tsp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp index 7ca93510f219..57d8f860cc2d 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp @@ -213,23 +213,23 @@ interface AccessTokens { // AccessToken Operations // #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Existing name" @doc("Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") - @example("./AccessTokens_Create.json", "AccessTokens_Create") + @Autorest.example("./AccessTokens_Create.json", "AccessTokens_Create") create is Operations.ResourceCreateOrReplace; @doc("Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") - @example("./AccessTokens_Get.json", "AccessTokens_Get") + @Autorest.example("./AccessTokens_Get.json", "AccessTokens_Get") get is Operations.ResourceRead; @doc("Deletes an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") - @example("./AccessTokens_Delete.json", "AccessTokens_Delete") + @Autorest.example("./AccessTokens_Delete.json", "AccessTokens_Delete") delete is Operations.ResourceDelete; @doc("Lists access-tokens for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.") - @example("./AccessTokens_List.json", "AccessTokens_List") + @Autorest.example("./AccessTokens_List.json", "AccessTokens_List") list is Operations.ResourceList; @doc("Validates access-token provided in authorization header for the given account id. Authorization required is Bearer JWT Access token provided by MPT service.") - @example("./AccessTokens_Validate.json", "AccessTokens_Validate") + @Autorest.example("./AccessTokens_Validate.json", "AccessTokens_Validate") @actionSeparator("/") validate is Operations.ResourceCollectionAction; } @@ -261,12 +261,12 @@ interface Accounts { // Accounts Operations @doc("Get details of the Azure resource mapped to an account for the given accountId. Authorization required is Bearer JWT Access token provided by EntraID.") - @example("./Accounts_Get.json", "Accounts_Get") + @Autorest.example("./Accounts_Get.json", "Accounts_Get") get is Operations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-rpc-path-params" "Operations defined using RpcOperation should not have path parameters. Consider using ResourceAction or ResourceCollectionAction instead." @doc("Gets remote browsers corresponding to given accountId and redirects the client for running MPT tests. Authorization required is Bearer JWT Access token provided by EntraID or MPT Service.") - @example("./Accounts_GetBrowsers.json", "Accounts_GetBrowsers") + @Autorest.example("./Accounts_GetBrowsers.json", "Accounts_GetBrowsers") @route("/accounts/{accountId}/browsers") getBrowsers is RpcOperation< GetBrowsersParams, From 0bdfe0561c938d926bc92e4f74863371b79d4638 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 12 Dec 2024 15:44:19 +0530 Subject: [PATCH 07/20] Typespec Validation error resolved --- ...json => AccessTokens_CreateOrReplace.json} | 4 +-- .../PlaywrightTesting.AuthManager/main.tsp | 15 +++----- .../tspconfig.yaml | 1 - .../AccessTokens_CreateAccessToken.json | 36 ------------------- ...json => AccessTokens_CreateOrReplace.json} | 4 +-- .../AccessTokens_DeleteAccessToken.json | 12 ------- .../examples/AccessTokens_GetAccessToken.json | 21 ----------- .../AccessTokens_ListAccessTokens.json | 25 ------------- .../examples/Accounts_Get copy.json | 26 -------------- .../examples/Accounts_GetAccount.json | 25 ------------- .../stable/2024-12-01/playwrighttesting.json | 6 ++-- 11 files changed, 11 insertions(+), 164 deletions(-) rename specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/{AccessTokens_Create.json => AccessTokens_CreateOrReplace.json} (90%) delete mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json rename specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/{AccessTokens_Create.json => AccessTokens_CreateOrReplace.json} (90%) delete mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json delete mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json delete mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json delete mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get copy.json delete mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Create.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_CreateOrReplace.json similarity index 90% rename from specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Create.json rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_CreateOrReplace.json index 537c8289dd69..858dea4c7ce6 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Create.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_CreateOrReplace.json @@ -1,6 +1,6 @@ { - "title": "AccessTokens_Create", - "operationId": "AccessTokens_Create", + "title": "AccessTokens_CreateOrReplace", + "operationId": "AccessTokens_CreateOrReplace", "parameters": { "api-version": "2024-12-01", "accountId": "sampleAccountId", diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp index 57d8f860cc2d..c3f11d207de9 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp @@ -19,9 +19,9 @@ using Autorest; "Microsoft Azure Playwright Service API Endpoint", { @doc(""" -Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: - https://{region}.api.playwright.microsoft.com). -""") + Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + https://{region}.api.playwright.microsoft.com). + """) endpoint: string, } ) @@ -213,23 +213,18 @@ interface AccessTokens { // AccessToken Operations // #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Existing name" @doc("Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") - @Autorest.example("./AccessTokens_Create.json", "AccessTokens_Create") - create is Operations.ResourceCreateOrReplace; + createOrReplace is Operations.ResourceCreateOrReplace; @doc("Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") - @Autorest.example("./AccessTokens_Get.json", "AccessTokens_Get") get is Operations.ResourceRead; @doc("Deletes an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") - @Autorest.example("./AccessTokens_Delete.json", "AccessTokens_Delete") delete is Operations.ResourceDelete; @doc("Lists access-tokens for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.") - @Autorest.example("./AccessTokens_List.json", "AccessTokens_List") list is Operations.ResourceList; @doc("Validates access-token provided in authorization header for the given account id. Authorization required is Bearer JWT Access token provided by MPT service.") - @Autorest.example("./AccessTokens_Validate.json", "AccessTokens_Validate") @actionSeparator("/") validate is Operations.ResourceCollectionAction; } @@ -261,12 +256,10 @@ interface Accounts { // Accounts Operations @doc("Get details of the Azure resource mapped to an account for the given accountId. Authorization required is Bearer JWT Access token provided by EntraID.") - @Autorest.example("./Accounts_Get.json", "Accounts_Get") get is Operations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-rpc-path-params" "Operations defined using RpcOperation should not have path parameters. Consider using ResourceAction or ResourceCollectionAction instead." @doc("Gets remote browsers corresponding to given accountId and redirects the client for running MPT tests. Authorization required is Bearer JWT Access token provided by EntraID or MPT Service.") - @Autorest.example("./Accounts_GetBrowsers.json", "Accounts_GetBrowsers") @route("/accounts/{accountId}/browsers") getBrowsers is RpcOperation< GetBrowsersParams, diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml index 3ca1739cad38..b3948dc3dbc5 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml @@ -11,7 +11,6 @@ options: azure-resource-provider-folder: "data-plane" #emit-lro-options: "none" emitter-output-dir: "{project-root}/.." - examples-directory: "{project-root}/examples" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/playwrighttesting.json" omit-unreachable-types: true "@azure-tools/typespec-python": diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json deleted file mode 100644 index aeda8908de2b..000000000000 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateAccessToken.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "title": "AccessTokens_CreateAccessToken", - "operationId": "AccessTokens_CreateAccessToken", - "parameters": { - "api-version": "2024-12-01", - "accountId": "sampleAccountId", - "accessTokenId": "00000000-0000-0000-0000-000000000000", - "resource": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "sampleAccessToken", - "expiryAt": "2022-09-28T12:32:33Z" - } - }, - "responses": { - "200": { - "body": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "sampleAccessToken", - "jwtToken": "sampleJwtToken", - "createdAt": "2021-09-28T12:32:33Z", - "expiryAt": "2022-09-28T12:32:33Z", - "state": "Active" - } - }, - "201": { - "body": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "sampleAccessToken", - "jwtToken": "sampleJwtToken", - "createdAt": "2021-09-28T12:32:33Z", - "expiryAt": "2022-09-28T12:32:33Z", - "state": "Active" - } - } - } -} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Create.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateOrReplace.json similarity index 90% rename from specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Create.json rename to specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateOrReplace.json index 537c8289dd69..858dea4c7ce6 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Create.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateOrReplace.json @@ -1,6 +1,6 @@ { - "title": "AccessTokens_Create", - "operationId": "AccessTokens_Create", + "title": "AccessTokens_CreateOrReplace", + "operationId": "AccessTokens_CreateOrReplace", "parameters": { "api-version": "2024-12-01", "accountId": "sampleAccountId", diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json deleted file mode 100644 index 667aeb93d4aa..000000000000 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_DeleteAccessToken.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "title": "AccessTokens_DeleteAccessToken", - "operationId": "AccessTokens_DeleteAccessToken", - "parameters": { - "api-version": "2024-12-01", - "accountId": "sampleAccountId", - "accessTokenId": "00000000-0000-0000-0000-000000000000" - }, - "responses": { - "204": {} - } -} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json deleted file mode 100644 index 01d774ef0a99..000000000000 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_GetAccessToken.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "title": "AccessTokens_GetAccessToken", - "operationId": "AccessTokens_GetAccessToken", - "parameters": { - "api-version": "2024-12-01", - "accountId": "sampleAccountId", - "accessTokenId": "00000000-0000-0000-0000-000000000000" - }, - "responses": { - "200": { - "body": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "sampleAccessToken", - "jwtToken": "sampleJwtToken", - "createdAt": "2021-09-28T12:32:33Z", - "expiryAt": "2022-09-28T12:32:33Z", - "state": "Active" - } - } - } -} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json deleted file mode 100644 index b09af67b9de5..000000000000 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_ListAccessTokens.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "title": "AccessTokens_ListAccessTokens", - "operationId": "AccessTokens_ListAccessTokens", - "parameters": { - "api-version": "2024-12-01", - "accountId": "sampleAccountId" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "00000000-0000-0000-0000-000000000000", - "name": "sampleAccessToken", - "jwtToken": "sampleJwtToken", - "createdAt": "2021-09-28T12:32:33Z", - "expiryAt": "2022-09-28T12:32:33Z", - "state": "Active" - } - ], - "nextLink": null - } - } - } -} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get copy.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get copy.json deleted file mode 100644 index c06187f52fdf..000000000000 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get copy.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "title": "Accounts_Get", - "operationId": "Accounts_Get", - "parameters": { - "api-version": "2024-12-01", - "accountId": "sampleAccountId" - }, - "responses": { - "200": { - "body": { - "id": "sampleAccountId", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount", - "name": "myPlaywrightAccount", - "state": "Active", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "subscriptionState": "Registered", - "tenantId": "00000000-0000-0000-0000-000000000000", - "location": "westus", - "regionalAffinity": "Enabled", - "scalableExecution": "Enabled", - "reporting": "Disabled", - "localAuth": "Enabled" - } - } - } -} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json deleted file mode 100644 index f4c23dba4c9c..000000000000 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetAccount.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "title": "Accounts_GetAccount", - "operationId": "Accounts_GetAccount", - "parameters": { - "api-version": "2024-12-01", - "accountId": "sampleAccountId" - }, - "responses": { - "200": { - "body": { - "id": "sampleAccountId", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount", - "name": "myPlaywrightAccount", - "state": "Active", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "subscriptionState": "Registered", - "tenantId": "00000000-0000-0000-0000-000000000000", - "location": "westus", - "regionalAffinity": "Enabled", - "scalableExecution": "Enabled", - "reporting": "Disabled" - } - } - } -} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json index 5d9c3d8e72e1..6b640c64724e 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json @@ -220,7 +220,7 @@ } }, "put": { - "operationId": "AccessTokens_Create", + "operationId": "AccessTokens_CreateOrReplace", "description": "Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { @@ -295,8 +295,8 @@ } }, "x-ms-examples": { - "AccessTokens_Create": { - "$ref": "./examples/AccessTokens_Create.json" + "AccessTokens_CreateOrReplace": { + "$ref": "./examples/AccessTokens_CreateOrReplace.json" } } }, From c8216f4e467db4a71477a4de750efbfe1341ccd0 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 12 Dec 2024 16:00:18 +0530 Subject: [PATCH 08/20] TSP Validation fix trial --- .../PlaywrightTesting.AuthManager/tspconfig.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml index b3948dc3dbc5..288348519c39 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml @@ -42,4 +42,5 @@ options: partial-update: true generate-tests: false service-name: Microsoft Playwright Testing - flavor: azure \ No newline at end of file + flavor: azure + \ No newline at end of file From 6ff1186ff77734e53a5ffaa163b13c9eef153e1c Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 12 Dec 2024 16:20:12 +0530 Subject: [PATCH 09/20] TSP Validation fix trial --- .../PlaywrightTesting.AuthManager/tspconfig.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml index 288348519c39..9609a2c92df9 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml @@ -9,7 +9,6 @@ parameters: options: "@azure-tools/typespec-autorest": azure-resource-provider-folder: "data-plane" - #emit-lro-options: "none" emitter-output-dir: "{project-root}/.." output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/playwrighttesting.json" omit-unreachable-types: true @@ -42,5 +41,4 @@ options: partial-update: true generate-tests: false service-name: Microsoft Playwright Testing - flavor: azure - \ No newline at end of file + flavor: azure \ No newline at end of file From 13348ffb007a6ec277e171179feac7b2254d6ca6 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Fri, 13 Dec 2024 11:54:38 +0530 Subject: [PATCH 10/20] Removed redundant imports --- .../playwrighttesting/PlaywrightTesting.AuthManager/main.tsp | 2 -- 1 file changed, 2 deletions(-) diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp index c3f11d207de9..25467263ceae 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp @@ -5,14 +5,12 @@ import "@typespec/http"; import "@typespec/rest"; import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; -import "@azure-tools/typespec-autorest"; using TypeSpec.Http; using TypeSpec.Rest; using TypeSpec.Versioning; using Azure.Core; using Azure.Core.Traits; -using Autorest; @server( "{endpoint}", From c3f61c79e9f535e3a3f10dff5b1c7cb1af7105af Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Fri, 13 Dec 2024 13:00:10 +0530 Subject: [PATCH 11/20] Fixed readme errors --- specification/playwrighttesting/data-plane/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/playwrighttesting/data-plane/readme.md b/specification/playwrighttesting/data-plane/readme.md index e5982387dfec..15cf305dc271 100644 --- a/specification/playwrighttesting/data-plane/readme.md +++ b/specification/playwrighttesting/data-plane/readme.md @@ -27,9 +27,9 @@ These are the global settings for the playwrighttesting. ```yaml openapi-type: data-plane tag: package-2024-12-01 -title: [[Title]] +title: PlaywrightTestingClient security: AADToken -security-scopes: [[SecurityScopes]] +#security-scopes: [[SecurityScopes]] ``` ### Tag: package-2024-12-01 From 74b8e4728d58ded1ac0552c18e9f383f70c826d1 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Tue, 17 Dec 2024 11:39:01 +0530 Subject: [PATCH 12/20] Added trailing newline char in tspconfig.yaml --- .../PlaywrightTesting.AuthManager/tspconfig.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml index 9609a2c92df9..1c577e066c04 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml @@ -41,4 +41,5 @@ options: partial-update: true generate-tests: false service-name: Microsoft Playwright Testing - flavor: azure \ No newline at end of file + flavor: azure + \ No newline at end of file From 91818d61fe9cdff44afd88d34bc340c75febd9a7 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Tue, 17 Dec 2024 12:06:14 +0530 Subject: [PATCH 13/20] Typespec validation errors fix --- .../PlaywrightTesting.AuthManager/tspconfig.yaml | 3 +-- .../stable/2024-12-01/playwrighttesting.json | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml index 1c577e066c04..9609a2c92df9 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml @@ -41,5 +41,4 @@ options: partial-update: true generate-tests: false service-name: Microsoft Playwright Testing - flavor: azure - \ No newline at end of file + flavor: azure \ No newline at end of file diff --git a/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/playwrighttesting.json b/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/playwrighttesting.json index dd5351642022..0321c9944190 100644 --- a/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/playwrighttesting.json +++ b/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/playwrighttesting.json @@ -870,7 +870,7 @@ }, "localAuth": { "type": "string", - "description": "When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs.", + "description": "When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations.", "default": "Disabled", "enum": [ "Enabled", @@ -988,7 +988,7 @@ }, "localAuth": { "$ref": "#/definitions/EnablementStatus", - "description": "When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs." + "description": "When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations." } } }, From 528ca41b2e892009aeaa047eb05e686d35a62e3f Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Tue, 17 Dec 2024 12:21:50 +0530 Subject: [PATCH 14/20] Committing changes by npx tsv --- .../PlaywrightTesting.AuthManager/tspconfig.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml index 9609a2c92df9..1c577e066c04 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml @@ -41,4 +41,5 @@ options: partial-update: true generate-tests: false service-name: Microsoft Playwright Testing - flavor: azure \ No newline at end of file + flavor: azure + \ No newline at end of file From 3f602d2e53ec9b75903c439fe05da24945853b36 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Tue, 17 Dec 2024 12:35:44 +0530 Subject: [PATCH 15/20] Update formatting --- .../PlaywrightTesting.AuthManager/tspconfig.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml index 1c577e066c04..5b3209eec885 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml @@ -42,4 +42,3 @@ options: generate-tests: false service-name: Microsoft Playwright Testing flavor: azure - \ No newline at end of file From c21633b854da8056421d8816a8f10ecca8f116de Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Tue, 17 Dec 2024 16:04:43 +0530 Subject: [PATCH 16/20] Added suppression and bit more documentation in comments --- .../PlaywrightTesting.AuthManager/main.tsp | 6 +++--- .../stable/2024-12-01/playwrighttesting.json | 6 +++--- specification/playwrighttesting/data-plane/readme.md | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp index 25467263ceae..89a83be4fa49 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp @@ -219,7 +219,7 @@ interface AccessTokens { @doc("Deletes an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") delete is Operations.ResourceDelete; - @doc("Lists access-tokens for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.") + @doc("Lists access-tokens for the given account id. It can use OData query params like $select, $filter, $orderby, $top and $skip. The default page size is 10. Use nextLink in response to fetch more objects in the list. Authorization required is Bearer JWT Access token provided by EntraID.") list is Operations.ResourceList; @doc("Validates access-token provided in authorization header for the given account id. Authorization required is Bearer JWT Access token provided by MPT service.") @@ -253,11 +253,11 @@ alias GetBrowsersResponse = { interface Accounts { // Accounts Operations - @doc("Get details of the Azure resource mapped to an account for the given accountId. Authorization required is Bearer JWT Access token provided by EntraID.") + @doc("Get details of the Azure resource mapped to an account for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.") get is Operations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-rpc-path-params" "Operations defined using RpcOperation should not have path parameters. Consider using ResourceAction or ResourceCollectionAction instead." - @doc("Gets remote browsers corresponding to given accountId and redirects the client for running MPT tests. Authorization required is Bearer JWT Access token provided by EntraID or MPT Service.") + @doc("Gets remote browsers corresponding to given account id and redirects the client for running MPT tests. Authorization required is Bearer JWT Access token provided by EntraID or MPT Service.") @route("/accounts/{accountId}/browsers") getBrowsers is RpcOperation< GetBrowsersParams, diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json index 6b640c64724e..84de6e6c2306 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json @@ -53,7 +53,7 @@ "/accounts/{accountId}": { "get": { "operationId": "Accounts_Get", - "description": "Get details of the Azure resource mapped to an account for the given accountId. Authorization required is Bearer JWT Access token provided by EntraID.", + "description": "Get details of the Azure resource mapped to an account for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -106,7 +106,7 @@ "/accounts/{accountId}/access-tokens": { "get": { "operationId": "AccessTokens_List", - "description": "Lists access-tokens for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.", + "description": "Lists access-tokens for the given account id. It can use OData query params like $select, $filter, $orderby, $top and $skip. The default page size is 10. Use nextLink in response to fetch more objects in the list. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -410,7 +410,7 @@ "/accounts/{accountId}/browsers": { "get": { "operationId": "Accounts_GetBrowsers", - "description": "Gets remote browsers corresponding to given accountId and redirects the client for running MPT tests. Authorization required is Bearer JWT Access token provided by EntraID or MPT Service.", + "description": "Gets remote browsers corresponding to given account id and redirects the client for running MPT tests. Authorization required is Bearer JWT Access token provided by EntraID or MPT Service.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" diff --git a/specification/playwrighttesting/data-plane/readme.md b/specification/playwrighttesting/data-plane/readme.md index 15cf305dc271..a58ac5661c50 100644 --- a/specification/playwrighttesting/data-plane/readme.md +++ b/specification/playwrighttesting/data-plane/readme.md @@ -39,6 +39,12 @@ These settings apply only when `--tag=package-2024-12-01` is specified on the co ```yaml $(tag) == 'package-2024-12-01' input-file: - Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json +suppressions: + - code: ValidResponseCodeRequired + from: playwrighttesting.json + reason: Need 302 response code as a product requirement to redirect the client for test execution on remote browsers provided by the service. + where: + - $.paths["/accounts/{accountId}/browsers"].get ``` ### Tag: package-2023-10-01-preview From 7ce268be18d2a1a2a8367d634e46d4d99f163e8b Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Wed, 18 Dec 2024 17:20:52 +0530 Subject: [PATCH 17/20] Suppression improvement --- specification/playwrighttesting/data-plane/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/playwrighttesting/data-plane/readme.md b/specification/playwrighttesting/data-plane/readme.md index a58ac5661c50..4bbfd44d93d7 100644 --- a/specification/playwrighttesting/data-plane/readme.md +++ b/specification/playwrighttesting/data-plane/readme.md @@ -44,7 +44,7 @@ suppressions: from: playwrighttesting.json reason: Need 302 response code as a product requirement to redirect the client for test execution on remote browsers provided by the service. where: - - $.paths["/accounts/{accountId}/browsers"].get + - $.paths["/accounts/{accountId}/browsers"].get.responses ``` ### Tag: package-2023-10-01-preview From 15d88811156b297076d72f4aac7503542dae4dff Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 19 Dec 2024 18:01:40 +0530 Subject: [PATCH 18/20] Removed validate access token api as suggested in review feedback --- .../2024-12-01/AccessTokens_Validate.json | 11 --- .../PlaywrightTesting.AuthManager/main.tsp | 21 +++-- .../examples/AccessTokens_Validate.json | 11 --- .../stable/2024-12-01/playwrighttesting.json | 93 +++++++------------ 4 files changed, 47 insertions(+), 89 deletions(-) delete mode 100644 specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Validate.json delete mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Validate.json diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Validate.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Validate.json deleted file mode 100644 index e4ff529aebae..000000000000 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Validate.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "title": "AccessTokens_Validate", - "operationId": "AccessTokens_Validate", - "parameters": { - "api-version": "2024-12-01", - "accountId": "sampleAccountId" - }, - "responses": { - "200": {} - } -} diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp index 89a83be4fa49..ccbd18e212eb 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp @@ -28,9 +28,19 @@ using Azure.Core.Traits; OAuth2Auth<[ { type: OAuth2FlowType.implicit, + description: "We can use OAuth2 Implicit flow to get the auth token for calling the APIs.", authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize", scopes: ["https://playwright.microsoft.com/.default"], } + ]>, + OAuth2Auth<[ + { + type: OAuth2FlowType.authorizationCode, + description: "We can use OAuth2 Authorization Code flow to get the auth token for calling the APIs.", + authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize", + tokenUrl: "https://login.microsoftonline.com/common/v2.0/oauth2/token", + scopes: ["https://playwright.microsoft.com/.default"], + } ]> ] ) @@ -54,6 +64,8 @@ enum Versions { model Account { @key("accountId") @doc("The account id.") + @maxLength(64) + @pattern("^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$") @visibility("read") id: string; @@ -139,6 +151,8 @@ union SubscriptionState { model AccessToken { @key("accessTokenId") @doc("The access-token id.") + @maxLength(64) + @pattern("^[a-zA-Z0-9]{1,63}$") @visibility("read") id: uuid; @@ -209,7 +223,6 @@ alias Operations = Azure.Core.ResourceOperations; interface AccessTokens { // AccessToken Operations - // #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Existing name" @doc("Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") createOrReplace is Operations.ResourceCreateOrReplace; @@ -221,10 +234,6 @@ interface AccessTokens { @doc("Lists access-tokens for the given account id. It can use OData query params like $select, $filter, $orderby, $top and $skip. The default page size is 10. Use nextLink in response to fetch more objects in the list. Authorization required is Bearer JWT Access token provided by EntraID.") list is Operations.ResourceList; - - @doc("Validates access-token provided in authorization header for the given account id. Authorization required is Bearer JWT Access token provided by MPT service.") - @actionSeparator("/") - validate is Operations.ResourceCollectionAction; } alias GetBrowsersParams = { @@ -257,7 +266,7 @@ interface Accounts { get is Operations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-rpc-path-params" "Operations defined using RpcOperation should not have path parameters. Consider using ResourceAction or ResourceCollectionAction instead." - @doc("Gets remote browsers corresponding to given account id and redirects the client for running MPT tests. Authorization required is Bearer JWT Access token provided by EntraID or MPT Service.") + @doc("Gets remote browsers corresponding to given account id and redirects the client for running Playwright tests. Authorization required is Bearer JWT Access token provided by EntraID or Microsoft Playwright Testing Service.") @route("/accounts/{accountId}/browsers") getBrowsers is RpcOperation< GetBrowsersParams, diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Validate.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Validate.json deleted file mode 100644 index e4ff529aebae..000000000000 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Validate.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "title": "AccessTokens_Validate", - "operationId": "AccessTokens_Validate", - "parameters": { - "api-version": "2024-12-01", - "accountId": "sampleAccountId" - }, - "responses": { - "200": {} - } -} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json index 84de6e6c2306..1738244a54a9 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json @@ -41,11 +41,12 @@ "securityDefinitions": { "OAuth2Auth": { "type": "oauth2", - "flow": "implicit", + "flow": "accessCode", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "https://playwright.microsoft.com/.default": "" - } + }, + "tokenUrl": "https://login.microsoftonline.com/common/v2.0/oauth2/token" } }, "tags": [], @@ -63,7 +64,9 @@ "in": "path", "description": "The account id.", "required": true, - "type": "string" + "type": "string", + "maxLength": 64, + "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" @@ -116,7 +119,9 @@ "in": "path", "description": "The account id.", "required": true, - "type": "string" + "type": "string", + "maxLength": 64, + "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" @@ -172,7 +177,9 @@ "in": "path", "description": "The account id.", "required": true, - "type": "string" + "type": "string", + "maxLength": 64, + "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$" }, { "name": "accessTokenId", @@ -180,7 +187,9 @@ "description": "The access-token id.", "required": true, "type": "string", - "format": "uuid" + "format": "uuid", + "maxLength": 64, + "pattern": "^[a-zA-Z0-9]{1,63}$" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" @@ -231,7 +240,9 @@ "in": "path", "description": "The account id.", "required": true, - "type": "string" + "type": "string", + "maxLength": 64, + "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$" }, { "name": "accessTokenId", @@ -239,7 +250,9 @@ "description": "The access-token id.", "required": true, "type": "string", - "format": "uuid" + "format": "uuid", + "maxLength": 64, + "pattern": "^[a-zA-Z0-9]{1,63}$" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" @@ -312,7 +325,9 @@ "in": "path", "description": "The account id.", "required": true, - "type": "string" + "type": "string", + "maxLength": 64, + "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$" }, { "name": "accessTokenId", @@ -320,7 +335,9 @@ "description": "The access-token id.", "required": true, "type": "string", - "format": "uuid" + "format": "uuid", + "maxLength": 64, + "pattern": "^[a-zA-Z0-9]{1,63}$" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" @@ -357,60 +374,10 @@ } } }, - "/accounts/{accountId}/access-tokens/validate": { - "post": { - "operationId": "AccessTokens_Validate", - "description": "Validates access-token provided in authorization header for the given account id. Authorization required is Bearer JWT Access token provided by MPT service.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "accountId", - "in": "path", - "description": "The account id.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "x-ms-client-request-id": { - "type": "string", - "format": "uuid", - "description": "An opaque, globally-unique, client-generated string identifier for the request." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - }, - "x-ms-examples": { - "AccessTokens_Validate": { - "$ref": "./examples/AccessTokens_Validate.json" - } - } - } - }, "/accounts/{accountId}/browsers": { "get": { "operationId": "Accounts_GetBrowsers", - "description": "Gets remote browsers corresponding to given account id and redirects the client for running MPT tests. Authorization required is Bearer JWT Access token provided by EntraID or MPT Service.", + "description": "Gets remote browsers corresponding to given account id and redirects the client for running Playwright tests. Authorization required is Bearer JWT Access token provided by EntraID or Microsoft Playwright Testing Service.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -506,6 +473,8 @@ "id": { "$ref": "#/definitions/Azure.Core.uuid", "description": "The access-token id.", + "maxLength": 64, + "pattern": "^[a-zA-Z0-9]{1,63}$", "readOnly": true }, "name": { @@ -584,6 +553,8 @@ "id": { "type": "string", "description": "The account id.", + "maxLength": 64, + "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$", "readOnly": true }, "resourceId": { From 96a2f69fd5b59115b5c5030e702662e92da18425 Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 19 Dec 2024 19:09:41 +0530 Subject: [PATCH 19/20] Added suppressions for swagger lintdiff issues --- .../AccessTokens_CreateOrReplace.json | 2 +- .../2024-12-01/AccessTokens_Delete.json | 2 +- .../examples/2024-12-01/AccessTokens_Get.json | 2 +- .../2024-12-01/AccessTokens_List.json | 2 +- .../examples/2024-12-01/Accounts_Get.json | 4 ++-- .../2024-12-01/Accounts_GetBrowsers.json | 2 +- .../PlaywrightTesting.AuthManager/main.tsp | 4 ++-- .../AccessTokens_CreateOrReplace.json | 2 +- .../examples/AccessTokens_Delete.json | 2 +- .../2024-12-01/examples/AccessTokens_Get.json | 2 +- .../examples/AccessTokens_List.json | 2 +- .../2024-12-01/examples/Accounts_Get.json | 4 ++-- .../examples/Accounts_GetBrowsers.json | 2 +- .../stable/2024-12-01/playwrighttesting.json | 20 +++++++++---------- .../playwrighttesting/data-plane/readme.md | 13 ++++++++++++ 15 files changed, 39 insertions(+), 26 deletions(-) diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_CreateOrReplace.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_CreateOrReplace.json index 858dea4c7ce6..3cda5ec2604c 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_CreateOrReplace.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_CreateOrReplace.json @@ -3,7 +3,7 @@ "operationId": "AccessTokens_CreateOrReplace", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", "accessTokenId": "00000000-0000-0000-0000-000000000000", "resource": { "id": "00000000-0000-0000-0000-000000000000", diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json index f6c247c6ea02..89786059c5bb 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json @@ -3,7 +3,7 @@ "operationId": "AccessTokens_Delete", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", "accessTokenId": "00000000-0000-0000-0000-000000000000" }, "responses": { diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json index ff184a5d0d94..5bcc133167d2 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json @@ -3,7 +3,7 @@ "operationId": "AccessTokens_Get", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", "accessTokenId": "00000000-0000-0000-0000-000000000000" }, "responses": { diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json index 02961a65efb7..067ead9616f4 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json @@ -3,7 +3,7 @@ "operationId": "AccessTokens_List", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId" + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000" }, "responses": { "200": { diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get.json index c06187f52fdf..2305831119f2 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get.json @@ -3,12 +3,12 @@ "operationId": "Accounts_Get", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId" + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000" }, "responses": { "200": { "body": { - "id": "sampleAccountId", + "id": "sampleAccountId_00000000-0000-0000-0000-000000000000", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount", "name": "myPlaywrightAccount", "state": "Active", diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json index 6544c3581395..ad4232eb2a54 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json @@ -3,7 +3,7 @@ "operationId": "Accounts_GetBrowsers", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", "os": "linux" }, "responses": { diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp index ccbd18e212eb..6f8e2fda8f35 100644 --- a/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp @@ -65,7 +65,7 @@ model Account { @key("accountId") @doc("The account id.") @maxLength(64) - @pattern("^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$") + @pattern("[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+") @visibility("read") id: string; @@ -152,7 +152,7 @@ model AccessToken { @key("accessTokenId") @doc("The access-token id.") @maxLength(64) - @pattern("^[a-zA-Z0-9]{1,63}$") + @pattern("[A-Za-z0-9]+(-[A-Za-z0-9]+)+") @visibility("read") id: uuid; diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateOrReplace.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateOrReplace.json index 858dea4c7ce6..3cda5ec2604c 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateOrReplace.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateOrReplace.json @@ -3,7 +3,7 @@ "operationId": "AccessTokens_CreateOrReplace", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", "accessTokenId": "00000000-0000-0000-0000-000000000000", "resource": { "id": "00000000-0000-0000-0000-000000000000", diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json index f6c247c6ea02..89786059c5bb 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json @@ -3,7 +3,7 @@ "operationId": "AccessTokens_Delete", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", "accessTokenId": "00000000-0000-0000-0000-000000000000" }, "responses": { diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json index ff184a5d0d94..5bcc133167d2 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json @@ -3,7 +3,7 @@ "operationId": "AccessTokens_Get", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", "accessTokenId": "00000000-0000-0000-0000-000000000000" }, "responses": { diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json index 02961a65efb7..067ead9616f4 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json @@ -3,7 +3,7 @@ "operationId": "AccessTokens_List", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId" + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000" }, "responses": { "200": { diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json index c06187f52fdf..2305831119f2 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json @@ -3,12 +3,12 @@ "operationId": "Accounts_Get", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId" + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000" }, "responses": { "200": { "body": { - "id": "sampleAccountId", + "id": "sampleAccountId_00000000-0000-0000-0000-000000000000", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount", "name": "myPlaywrightAccount", "state": "Active", diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json index 6544c3581395..ad4232eb2a54 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json @@ -3,7 +3,7 @@ "operationId": "Accounts_GetBrowsers", "parameters": { "api-version": "2024-12-01", - "accountId": "sampleAccountId", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", "os": "linux" }, "responses": { diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json index 1738244a54a9..ea0606a7ef57 100644 --- a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json @@ -66,7 +66,7 @@ "required": true, "type": "string", "maxLength": 64, - "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$" + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" @@ -121,7 +121,7 @@ "required": true, "type": "string", "maxLength": 64, - "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$" + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" @@ -179,7 +179,7 @@ "required": true, "type": "string", "maxLength": 64, - "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$" + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" }, { "name": "accessTokenId", @@ -189,7 +189,7 @@ "type": "string", "format": "uuid", "maxLength": 64, - "pattern": "^[a-zA-Z0-9]{1,63}$" + "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" @@ -242,7 +242,7 @@ "required": true, "type": "string", "maxLength": 64, - "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$" + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" }, { "name": "accessTokenId", @@ -252,7 +252,7 @@ "type": "string", "format": "uuid", "maxLength": 64, - "pattern": "^[a-zA-Z0-9]{1,63}$" + "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" @@ -327,7 +327,7 @@ "required": true, "type": "string", "maxLength": 64, - "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$" + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" }, { "name": "accessTokenId", @@ -337,7 +337,7 @@ "type": "string", "format": "uuid", "maxLength": 64, - "pattern": "^[a-zA-Z0-9]{1,63}$" + "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" @@ -474,7 +474,7 @@ "$ref": "#/definitions/Azure.Core.uuid", "description": "The access-token id.", "maxLength": 64, - "pattern": "^[a-zA-Z0-9]{1,63}$", + "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+", "readOnly": true }, "name": { @@ -554,7 +554,7 @@ "type": "string", "description": "The account id.", "maxLength": 64, - "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$", + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+", "readOnly": true }, "resourceId": { diff --git a/specification/playwrighttesting/data-plane/readme.md b/specification/playwrighttesting/data-plane/readme.md index 4bbfd44d93d7..eb75b8eb3f75 100644 --- a/specification/playwrighttesting/data-plane/readme.md +++ b/specification/playwrighttesting/data-plane/readme.md @@ -45,6 +45,19 @@ suppressions: reason: Need 302 response code as a product requirement to redirect the client for test execution on remote browsers provided by the service. where: - $.paths["/accounts/{accountId}/browsers"].get.responses + - code: SecurityDefinitionDescription + from: playwrighttesting.json + reason: Seems like a tool bug, as the description is added in the TypeSpec already. + - code: PathParameterSchema + from: playwrighttesting.json + reason: No provision to define path parameter schema for custom routes of rpc operations in Typespec. + where: + - $.paths["/accounts/{accountId}/browsers"].get.parameters + - code: OperationId + from: playwrighttesting.json + reason: Inconsistency with Typespec nomenclature to use create and replace for put while update is used for patch api. + where: + - $.paths["/accounts/{accountId}/access-tokens/{accessTokenId}"].put.operationId ``` ### Tag: package-2023-10-01-preview From c28011532d39265e56754d50b375b0ac9cab15ce Mon Sep 17 00:00:00 2001 From: Madhuri Jain Date: Thu, 19 Dec 2024 19:23:53 +0530 Subject: [PATCH 20/20] Added suppressions for swagger lintdiff issues --- specification/playwrighttesting/data-plane/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/playwrighttesting/data-plane/readme.md b/specification/playwrighttesting/data-plane/readme.md index eb75b8eb3f75..c03dc371ddbc 100644 --- a/specification/playwrighttesting/data-plane/readme.md +++ b/specification/playwrighttesting/data-plane/readme.md @@ -52,7 +52,7 @@ suppressions: from: playwrighttesting.json reason: No provision to define path parameter schema for custom routes of rpc operations in Typespec. where: - - $.paths["/accounts/{accountId}/browsers"].get.parameters + - $.paths["/accounts/{accountId}/browsers"].get.parameters[3] - code: OperationId from: playwrighttesting.json reason: Inconsistency with Typespec nomenclature to use create and replace for put while update is used for patch api.