diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user.yaml index c7011335ecf7..7e41f754589f 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user.yaml @@ -13,7 +13,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:24 GMT + - Wed, 21 Apr 2021 01:03:37 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -29,9 +29,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:24 GMT + - Wed, 21 Apr 2021 01:03:35 GMT ms-cv: - - UEGC+xqwQkqRRfXm5Md24A.0 + - MAFpWlOWZkOwGTjcoqQs/A.0 request-context: - appId= strict-transport-security: @@ -39,7 +39,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 12ms + - 13ms status: code: 201 message: Created diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_and_token.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_and_token.yaml index 24325cd40622..641ff514b18f 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_and_token.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_and_token.yaml @@ -13,7 +13,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:24 GMT + - Wed, 21 Apr 2021 01:03:37 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,16 +23,16 @@ interactions: response: body: string: '{"identity": {"id": "sanitized"}, "accessToken": {"token": "sanitized", - "expiresOn": "2021-04-14T17:54:25.0058231+00:00"}}' + "expiresOn": "2021-04-22T01:03:36.4974103+00:00"}}' headers: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:25 GMT + - Wed, 21 Apr 2021 01:03:37 GMT ms-cv: - - I9ZS0qxvQEKYO/S5ErFh1w.0 + - 8h5FkbC290CXIiTUXJXG1A.0 request-context: - appId= strict-transport-security: @@ -40,7 +40,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 215ms + - 460ms status: code: 201 message: Created diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_and_token_with_no_scopes.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_and_token_with_no_scopes.yaml new file mode 100644 index 000000000000..cb6d253c9f41 --- /dev/null +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_and_token_with_no_scopes.yaml @@ -0,0 +1,46 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + Date: + - Wed, 21 Apr 2021 01:03:38 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 + response: + body: + string: '{"identity": {"id": "sanitized"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Wed, 21 Apr 2021 01:03:37 GMT + ms-cv: + - vm3Y63QS2E2q02bPpNW/pw.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 13ms + status: + code: 201 + message: Created +version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_from_managed_identity.yaml index 6ec1415a7621..56c413fc45bc 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_from_managed_identity.yaml @@ -25,9 +25,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:27 GMT + - Wed, 21 Apr 2021 01:03:38 GMT ms-cv: - - Z2JdPGt9IEegXVCKKHjiJg.0 + - /0cdgYWzkUSJN8NGVXbzww.0 request-context: - appId= strict-transport-security: @@ -35,7 +35,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 162ms + - 12ms status: code: 201 message: Created diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user.yaml index 4b1297bc1fd5..250ef1bbcff1 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user.yaml @@ -13,7 +13,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:26 GMT + - Wed, 21 Apr 2021 01:03:39 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -29,9 +29,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:27 GMT + - Wed, 21 Apr 2021 01:03:38 GMT ms-cv: - - NpGxr/VCv0i3/F8p8B/PEw.0 + - v1sp8VZ12kmfHIv4KPQL/g.0 request-context: - appId= strict-transport-security: @@ -39,7 +39,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 16ms + - 11ms status: code: 201 message: Created @@ -55,7 +55,7 @@ interactions: Content-Length: - '0' Date: - - Tue, 13 Apr 2021 17:54:27 GMT + - Wed, 21 Apr 2021 01:03:39 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -69,15 +69,15 @@ interactions: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 date: - - Tue, 13 Apr 2021 17:54:27 GMT + - Wed, 21 Apr 2021 01:03:39 GMT ms-cv: - - zRztRbFrrEe9RLXIARPN7w.0 + - pd0NJk+DuE+kE0OxofV5oA.0 request-context: - appId= strict-transport-security: - max-age=2592000 x-processing-time: - - 583ms + - 556ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user_from_managed_identity.yaml index d38866508f87..7459941fd8df 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user_from_managed_identity.yaml @@ -25,9 +25,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:29 GMT + - Wed, 21 Apr 2021 01:03:41 GMT ms-cv: - - 3qpzL2TAgU2LX4OLE/ZWKQ.0 + - i1V3NBItW0+3BVjUvRgbMw.0 request-context: - appId= strict-transport-security: @@ -35,7 +35,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 91ms + - 192ms status: code: 201 message: Created @@ -61,15 +61,15 @@ interactions: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 date: - - Tue, 13 Apr 2021 17:54:30 GMT + - Wed, 21 Apr 2021 01:03:42 GMT ms-cv: - - 04FDSY1mSkeU92Los0y+zA.0 + - LTpN0ElayE2anISXsYUn0A.0 request-context: - appId= strict-transport-security: - max-age=2592000 x-processing-time: - - 591ms + - 559ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token.yaml index cdc9bb4ef31d..86e6b83ec35f 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token.yaml @@ -13,7 +13,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:29 GMT + - Wed, 21 Apr 2021 01:03:43 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -29,9 +29,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:30 GMT + - Wed, 21 Apr 2021 01:03:42 GMT ms-cv: - - ESJNBGhGTEWm2nfyGmja5g.0 + - qRo3jp67IUCPfCZMWCCiOg.0 request-context: - appId= strict-transport-security: @@ -39,7 +39,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 12ms + - 10ms status: code: 201 message: Created @@ -57,7 +57,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:29 GMT + - Wed, 21 Apr 2021 01:03:44 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -66,16 +66,16 @@ interactions: uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:29.7152371+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-22T01:03:42.4880688+00:00"}' headers: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:30 GMT + - Wed, 21 Apr 2021 01:03:42 GMT ms-cv: - - 8x1vXQTCY0qKMkC4Z/KGFg.0 + - f/in6N3GcUGnAXhB0syCrw.0 request-context: - appId= strict-transport-security: @@ -83,7 +83,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 28ms + - 149ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token_from_managed_identity.yaml index bfab4dfe09a7..af0da6165764 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token_from_managed_identity.yaml @@ -25,9 +25,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:32 GMT + - Wed, 21 Apr 2021 01:03:44 GMT ms-cv: - - DkbbkXtjlkOEK0yQgPG8ZA.0 + - /8iK7bJGjUi0wHSNAwuUvg.0 request-context: - appId= strict-transport-security: @@ -35,7 +35,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 11ms + - 63ms status: code: 201 message: Created @@ -58,16 +58,16 @@ interactions: uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:32.0766183+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-22T01:03:43.9098436+00:00"}' headers: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:33 GMT + - Wed, 21 Apr 2021 01:03:44 GMT ms-cv: - - ZOyy1+vBp0eAegnujOspGA.0 + - lFmF0NQQv0mEcihxGfvDNA.0 request-context: - appId= strict-transport-security: @@ -75,7 +75,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 135ms + - 152ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token_with_no_scopes.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token_with_no_scopes.yaml new file mode 100644 index 000000000000..5f659146f0bd --- /dev/null +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token_with_no_scopes.yaml @@ -0,0 +1,89 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + Date: + - Wed, 21 Apr 2021 01:03:45 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 + response: + body: + string: '{"identity": {"id": "sanitized"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Wed, 21 Apr 2021 01:03:44 GMT + ms-cv: + - 9vrmAbY5v0CAKw3yWG5Bmg.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 13ms + status: + code: 201 + message: Created +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + Date: + - Wed, 21 Apr 2021 01:03:46 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + response: + body: + string: '{"error": {"code": "ValidationError", "message": "Scopes: The Scopes + field is required.", "target": "Scopes"}}' + headers: + content-type: + - application/json + date: + - Wed, 21 Apr 2021 01:03:45 GMT + ms-cv: + - Tp8+MIEEKU+8PBZ/KK1LZQ.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 11ms + status: + code: 400 + message: Bad Request +version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens.yaml index f3be0a2823e3..3aa0310f73f2 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens.yaml @@ -13,7 +13,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:32 GMT + - Wed, 21 Apr 2021 01:03:46 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -29,9 +29,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:32 GMT + - Wed, 21 Apr 2021 01:03:45 GMT ms-cv: - - uR6j7ujUlkmDU4sMF9jubw.0 + - fuf/w29xP0WNPsRxaQzqoA.0 request-context: - appId= strict-transport-security: @@ -39,7 +39,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 22ms + - 13ms status: code: 201 message: Created @@ -57,7 +57,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:33 GMT + - Wed, 21 Apr 2021 01:03:46 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -66,16 +66,16 @@ interactions: uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:32.9248717+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-22T01:03:45.2383068+00:00"}' headers: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:33 GMT + - Wed, 21 Apr 2021 01:03:45 GMT ms-cv: - - dXFgv5bt8UugQoKws3faAw.0 + - yDf0VHpTCUOuwF4VOh6jYA.0 request-context: - appId= strict-transport-security: @@ -83,7 +83,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 148ms + - 144ms status: code: 200 message: OK @@ -99,7 +99,7 @@ interactions: Content-Length: - '0' Date: - - Tue, 13 Apr 2021 17:54:33 GMT + - Wed, 21 Apr 2021 01:03:47 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -113,15 +113,15 @@ interactions: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 date: - - Tue, 13 Apr 2021 17:54:33 GMT + - Wed, 21 Apr 2021 01:03:46 GMT ms-cv: - - 4HgQs8RX2keltldeWAixBg.0 + - x6iZdquF6U6B1JffH3SVog.0 request-context: - appId= strict-transport-security: - max-age=2592000 x-processing-time: - - 490ms + - 646ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens_from_managed_identity.yaml index b1fcbb1f1836..b86efc264de9 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens_from_managed_identity.yaml @@ -25,9 +25,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:35 GMT + - Wed, 21 Apr 2021 01:03:47 GMT ms-cv: - - WmL819euc02RGu6x3tAA5A.0 + - EXzyqcpSLEmW/V9CMYTdrA.0 request-context: - appId= strict-transport-security: @@ -35,7 +35,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 22ms + - 13ms status: code: 201 message: Created @@ -58,16 +58,16 @@ interactions: uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:34.775295+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-22T01:03:47.3930771+00:00"}' headers: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Tue, 13 Apr 2021 17:54:35 GMT + - Wed, 21 Apr 2021 01:03:48 GMT ms-cv: - - wv2ATiyGHEqcp4VT0y26NA.0 + - Ixbw0cZ9202QiXVlpIX4Xg.0 request-context: - appId= strict-transport-security: @@ -75,7 +75,7 @@ interactions: transfer-encoding: - chunked x-processing-time: - - 26ms + - 142ms status: code: 200 message: OK @@ -101,15 +101,15 @@ interactions: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 date: - - Tue, 13 Apr 2021 17:54:35 GMT + - Wed, 21 Apr 2021 01:03:48 GMT ms-cv: - - PAEN110k906wOeoSCXZaJA.0 + - siARyMOEtE+pYQ8qc+NsmQ.0 request-context: - appId= strict-transport-security: - max-age=2592000 x-processing-time: - - 86ms + - 314ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user.yaml index a629e0a5dfc7..7f2bd96fc4ae 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user.yaml @@ -9,7 +9,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:35 GMT + - Wed, 21 Apr 2021 01:03:49 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -22,8 +22,8 @@ interactions: headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:35 GMT - ms-cv: DVwrKeAUsUeqOYv7Vs+ltw.0 + date: Wed, 21 Apr 2021 01:03:48 GMT + ms-cv: vLH+ygW3XUa8wzACEaR+Bw.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_and_token.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_and_token.yaml index 0b81b567ca1d..6fdf410808e0 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_and_token.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_and_token.yaml @@ -9,7 +9,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:35 GMT + - Wed, 21 Apr 2021 01:03:49 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -19,16 +19,16 @@ interactions: response: body: string: '{"identity": {"id": "sanitized"}, "accessToken": {"token": "sanitized", - "expiresOn": "2021-04-14T17:54:35.9636866+00:00"}}' + "expiresOn": "2021-04-22T01:03:48.6583292+00:00"}}' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:36 GMT - ms-cv: ntcPefeAfkSlklnTTjlpkw.0 + date: Wed, 21 Apr 2021 01:03:49 GMT + ms-cv: kOV35dSPHEKdFd1cLyyQGA.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 421ms + x-processing-time: 271ms status: code: 201 message: Created diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_and_token_with_no_scopes.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_and_token_with_no_scopes.yaml new file mode 100644 index 000000000000..734bdbe3fa68 --- /dev/null +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_and_token_with_no_scopes.yaml @@ -0,0 +1,35 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Content-Length: + - '2' + Content-Type: + - application/json + Date: + - Wed, 21 Apr 2021 01:03:50 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 + response: + body: + string: '{"identity": {"id": "sanitized"}}' + headers: + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 + content-type: application/json; charset=utf-8 + date: Wed, 21 Apr 2021 01:03:49 GMT + ms-cv: oyaGnhQ3UEmQUwkoKSJAxg.0 + request-context: appId= + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 12ms + status: + code: 201 + message: Created + url: https://lakshmanscommunication-communication.communication.azure.com/identities?api-version=2021-03-07 +version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_from_managed_identity.yaml index 0f8b82b24228..923e8bf08762 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_from_managed_identity.yaml @@ -18,12 +18,12 @@ interactions: headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:37 GMT - ms-cv: SVtnqEBxEUeDJruAkkfcsA.0 + date: Wed, 21 Apr 2021 01:03:57 GMT + ms-cv: sZ0IpHj30kWgvOIETT0pSw.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 235ms + x-processing-time: 75ms status: code: 201 message: Created diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user.yaml index cf491cf71922..a1c3b5e80dca 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user.yaml @@ -9,7 +9,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:37 GMT + - Wed, 21 Apr 2021 01:03:57 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -22,12 +22,12 @@ interactions: headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:38 GMT - ms-cv: 1yFV4s+3E02VnBtVpTsgMw.0 + date: Wed, 21 Apr 2021 01:03:56 GMT + ms-cv: CJkZvR0IjU24z7Hl7wULlQ.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 11ms + x-processing-time: 12ms status: code: 201 message: Created @@ -38,7 +38,7 @@ interactions: Accept: - application/json Date: - - Tue, 13 Apr 2021 17:54:37 GMT + - Wed, 21 Apr 2021 01:03:57 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -50,11 +50,11 @@ interactions: string: '' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 - date: Tue, 13 Apr 2021 17:54:38 GMT - ms-cv: yrGfSuBG/E+5SV1IVD3agg.0 + date: Wed, 21 Apr 2021 01:03:56 GMT + ms-cv: CnKxXcEGq0OgIKxwDm9ImA.0 request-context: appId= strict-transport-security: max-age=2592000 - x-processing-time: 479ms + x-processing-time: 516ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user_from_managed_identity.yaml index 3d093973827c..ac4670d4c137 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user_from_managed_identity.yaml @@ -18,12 +18,12 @@ interactions: headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:40 GMT - ms-cv: SH4vZizCxkSGvnv/LRR9SA.0 + date: Wed, 21 Apr 2021 01:04:01 GMT + ms-cv: KTWJCXY3gUiYfQy7doRb8Q.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 12ms + x-processing-time: 13ms status: code: 201 message: Created @@ -42,11 +42,11 @@ interactions: string: '' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 - date: Tue, 13 Apr 2021 17:54:40 GMT - ms-cv: FyJH/NtpKEKiNRKEb8XvPQ.0 + date: Wed, 21 Apr 2021 01:04:02 GMT + ms-cv: FonWIeITCEGEaNxOB9+T0w.0 request-context: appId= strict-transport-security: max-age=2592000 - x-processing-time: 577ms + x-processing-time: 543ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token.yaml index 31995b988c54..ece1d84b7d7a 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token.yaml @@ -9,7 +9,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:40 GMT + - Wed, 21 Apr 2021 01:04:03 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -22,12 +22,12 @@ interactions: headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:41 GMT - ms-cv: Pj8FRADg+kiDEt1nR45Xpw.0 + date: Wed, 21 Apr 2021 01:04:01 GMT + ms-cv: fmX+9TYBPUm5ZkIKPaifcg.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 14ms + x-processing-time: 11ms status: code: 201 message: Created @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:41 GMT + - Wed, 21 Apr 2021 01:04:03 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -51,16 +51,16 @@ interactions: uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:40.9399447+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-22T01:04:01.7301111+00:00"}' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:41 GMT - ms-cv: 20UrFS+nmUuM9hckNxqX9Q.0 + date: Wed, 21 Apr 2021 01:04:02 GMT + ms-cv: c9LnBXull0+tsXKdnfOgAA.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 128ms + x-processing-time: 146ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token_from_managed_identity.yaml index a5e513fe81fb..cef3bc481f75 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token_from_managed_identity.yaml @@ -18,12 +18,12 @@ interactions: headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:45 GMT - ms-cv: 7i9QSGm+qU+VzI7p4eQEig.0 + date: Wed, 21 Apr 2021 01:04:03 GMT + ms-cv: TSIMcZz1E06I4UrDT9KTJQ.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 12ms + x-processing-time: 189ms status: code: 201 message: Created @@ -43,16 +43,16 @@ interactions: uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:45.0423527+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-22T01:04:03.4374044+00:00"}' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:45 GMT - ms-cv: FgTOvdMakkCOCXl3WaKySQ.0 + date: Wed, 21 Apr 2021 01:04:03 GMT + ms-cv: Gh+ByIBlWkGjuFkngm5tbw.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 126ms + x-processing-time: 26ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token_with_no_scopes.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token_with_no_scopes.yaml new file mode 100644 index 000000000000..beff73ce320b --- /dev/null +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token_with_no_scopes.yaml @@ -0,0 +1,68 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Content-Length: + - '2' + Content-Type: + - application/json + Date: + - Wed, 21 Apr 2021 01:04:05 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 + response: + body: + string: '{"identity": {"id": "sanitized"}}' + headers: + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 + content-type: application/json; charset=utf-8 + date: Wed, 21 Apr 2021 01:04:04 GMT + ms-cv: +Ld0uuJrsEy+Fmi0FwHE8A.0 + request-context: appId= + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 12ms + status: + code: 201 + message: Created + url: https://lakshmanscommunication-communication.communication.azure.com/identities?api-version=2021-03-07 +- request: + body: '{}' + headers: + Accept: + - application/json + Content-Length: + - '2' + Content-Type: + - application/json + Date: + - Wed, 21 Apr 2021 01:04:05 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + response: + body: + string: '{"error": {"code": "ValidationError", "message": "Scopes: The Scopes + field is required.", "target": "Scopes"}}' + headers: + content-type: application/json + date: Wed, 21 Apr 2021 01:04:04 GMT + ms-cv: o4QM5R8B1EaTu9t9KLIA2g.0 + request-context: appId= + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 19ms + status: + code: 400 + message: Bad Request + url: https://lakshmanscommunication-communication.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 +version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens.yaml index bd040c414f2f..5d128fe9e387 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens.yaml @@ -9,7 +9,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:45 GMT + - Wed, 21 Apr 2021 01:04:05 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -22,12 +22,12 @@ interactions: headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:45 GMT - ms-cv: YpWO++6ovkOt61REvEzWXA.0 + date: Wed, 21 Apr 2021 01:04:04 GMT + ms-cv: q+ucnkroYUqgGSLLb7AE/w.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 29ms + x-processing-time: 12ms status: code: 201 message: Created @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 13 Apr 2021 17:54:45 GMT + - Wed, 21 Apr 2021 01:04:05 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -51,16 +51,16 @@ interactions: uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:45.5089019+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-22T01:04:04.2125267+00:00"}' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:46 GMT - ms-cv: svbjN4vN+EmbtQxi2pcnCw.0 + date: Wed, 21 Apr 2021 01:04:04 GMT + ms-cv: gOgVb9xDOU6aJ58CkV4Eag.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 152ms + x-processing-time: 143ms status: code: 200 message: OK @@ -71,7 +71,7 @@ interactions: Accept: - application/json Date: - - Tue, 13 Apr 2021 17:54:45 GMT + - Wed, 21 Apr 2021 01:04:05 GMT User-Agent: - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -83,11 +83,11 @@ interactions: string: '' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 - date: Tue, 13 Apr 2021 17:54:46 GMT - ms-cv: 5tqpKlCa/ESvOY9qWXQP0A.0 + date: Wed, 21 Apr 2021 01:04:04 GMT + ms-cv: z3IGAket8EuW3k4420x+Jw.0 request-context: appId= strict-transport-security: max-age=2592000 - x-processing-time: 208ms + x-processing-time: 134ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens_from_managed_identity.yaml index fb454ef93117..18d8f3c30851 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens_from_managed_identity.yaml @@ -18,12 +18,12 @@ interactions: headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:48 GMT - ms-cv: lWjOWYpL90CS7wvt6sWZmw.0 + date: Wed, 21 Apr 2021 01:04:06 GMT + ms-cv: esqhi3WAnUSWE09C5oWopQ.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 111ms + x-processing-time: 14ms status: code: 201 message: Created @@ -43,16 +43,16 @@ interactions: uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:47.3442684+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-22T01:04:05.5521447+00:00"}' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Tue, 13 Apr 2021 17:54:48 GMT - ms-cv: sdMJ7daQx0GS9bI8pul/bw.0 + date: Wed, 21 Apr 2021 01:04:06 GMT + ms-cv: DThu30avp0m4zQe2A2DIvQ.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 123ms + x-processing-time: 147ms status: code: 200 message: OK @@ -71,11 +71,11 @@ interactions: string: '' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 - date: Tue, 13 Apr 2021 17:54:48 GMT - ms-cv: s2kwtg8TQkG8aJp6NDHeLg.0 + date: Wed, 21 Apr 2021 01:04:06 GMT + ms-cv: ELlNYXpYGk+PxAb32vSRJA.0 request-context: appId= strict-transport-security: max-age=2592000 - x-processing-time: 248ms + x-processing-time: 225ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/test_communication_identity_client.py b/sdk/communication/azure-communication-identity/tests/test_communication_identity_client.py index 1c0fd6abf10b..fad12f2faaf7 100644 --- a/sdk/communication/azure-communication-identity/tests/test_communication_identity_client.py +++ b/sdk/communication/azure-communication-identity/tests/test_communication_identity_client.py @@ -139,3 +139,43 @@ def test_delete_user(self, communication_connection_string): identity_client.delete_user(user) assert user.properties.get('id') is not None + + @CommunicationPreparer() + def test_create_user_and_token_with_no_scopes(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string(communication_connection_string) + + with pytest.raises(Exception) as ex: + user, token_response = identity_client.create_user_and_token(scopes=None) + + @CommunicationPreparer() + def test_delete_user_with_no_user(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_connection_string) + + with pytest.raises(Exception) as ex: + identity_client.delete_user(user=None) + + @CommunicationPreparer() + def test_revoke_tokens_with_no_user(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_connection_string) + + with pytest.raises(Exception) as ex: + identity_client.revoke_tokens(user=None) + + @CommunicationPreparer() + def test_get_token_with_no_user(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_connection_string) + + with pytest.raises(Exception) as ex: + token_response = identity_client.get_token(user=None, scopes=[CommunicationTokenScope.CHAT]) + + @CommunicationPreparer() + def test_get_token_with_no_scopes(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_connection_string) + user = identity_client.create_user() + + with pytest.raises(Exception) as ex: + token_response = identity_client.get_token(user, scopes=None) diff --git a/sdk/communication/azure-communication-identity/tests/test_communication_identity_client_async.py b/sdk/communication/azure-communication-identity/tests/test_communication_identity_client_async.py index 35dcb4d0e475..3d3eaa0c9a1a 100644 --- a/sdk/communication/azure-communication-identity/tests/test_communication_identity_client_async.py +++ b/sdk/communication/azure-communication-identity/tests/test_communication_identity_client_async.py @@ -139,3 +139,48 @@ async def test_delete_user(self, communication_connection_string): await identity_client.delete_user(user) assert user.properties.get('id') is not None + + @CommunicationPreparer() + async def test_create_user_and_token_with_no_scopes(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string(communication_connection_string) + + async with identity_client: + with pytest.raises(Exception) as ex: + user, token_response = await identity_client.create_user_and_token(scopes=None) + + @CommunicationPreparer() + async def test_delete_user_with_no_user(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_connection_string) + + async with identity_client: + with pytest.raises(Exception) as ex: + await identity_client.delete_user(user=None) + + @CommunicationPreparer() + async def test_revoke_tokens_with_no_user(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_connection_string) + + async with identity_client: + with pytest.raises(Exception) as ex: + await identity_client.revoke_tokens(user=None) + + @CommunicationPreparer() + async def test_get_token_with_no_user(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_connection_string) + + async with identity_client: + with pytest.raises(Exception) as ex: + token_response = await identity_client.get_token(user=None, scopes=[CommunicationTokenScope.CHAT]) + + @CommunicationPreparer() + async def test_get_token_with_no_scopes(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_connection_string) + + async with identity_client: + with pytest.raises(Exception) as ex: + user = await identity_client.create_user() + token_response = await identity_client.get_token(user, scopes=None)