Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated sync identity client and tests #2

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def create_user_with_token(
~azure.communication.identity.CommunicationIdentityToken)
"""
return self._identity_service_client.communication_identity.create(
cls=lambda pr, u, e: CommunicationUserIdentifier(u.identity.id),
cls=lambda pr, u, e: (CommunicationUserIdentifier(u.identity.id), u.access_token),
create_token_with_scopes=scopes,
**kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interactions:
Content-Type:
- application/json
Date:
- Wed, 27 Jan 2021 23:54:39 GMT
- Thu, 28 Jan 2021 18:17:17 GMT
User-Agent:
- azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
x-ms-return-client-request-id:
Expand All @@ -22,22 +22,22 @@ interactions:
uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07
response:
body:
string: '{"identity": {"id": "8:acs:713bd27c-3c73-4c55-a3d2-11c120d32fa8_00000007-e626-e90a-6216-1f3a0d003bb4"}}'
string: '{"identity": {"id": "8:acs:f823ebe3-93ab-46d6-82a0-29e7f8e18877_00000007-ea18-6094-0e04-343a0d000438"}}'
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-03-07
content-type:
- application/json; charset=utf-8
date:
- Wed, 27 Jan 2021 23:54:40 GMT
- Thu, 28 Jan 2021 18:17:16 GMT
ms-cv:
- V3Rpav/bY0WZnu7vMclLog.0
- CvM4lDVC8ECvD7/H/t27oQ.0
strict-transport-security:
- max-age=2592000
transfer-encoding:
- chunked
x-processing-time:
- 229ms
- 17ms
status:
code: 201
message: Created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ interactions:
uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07
response:
body:
string: '{"identity": {"id": "8:acs:3de2c19f-8f12-45ac-a978-5fe327284a35_00000007-e627-f129-ac00-343a0d00b106"}}'
string: '{"identity": {"id": "8:acs:f8a47a4f-7f0a-4010-a42d-594ddb4d35f3_00000007-ea19-697d-8d33-3b3a0d000262"}}'
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-03-07
content-type:
- application/json; charset=utf-8
date:
- Wed, 27 Jan 2021 23:55:48 GMT
- Thu, 28 Jan 2021 18:18:24 GMT
ms-cv:
- iocVB67Og0KRosYwvJnZlg.0
- XgP1JYSRKE+0gaEXB6KWYA.0
strict-transport-security:
- max-age=2592000
transfer-encoding:
- chunked
x-processing-time:
- 183ms
- 495ms
status:
code: 201
message: Created
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
interactions:
- request:
body: '{"createTokenWithScopes": ["chat"]}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '35'
Content-Type:
- application/json
Date:
- Thu, 28 Jan 2021 18:19:32 GMT
User-Agent:
- azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
x-ms-return-client-request-id:
- 'true'
method: POST
uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07
response:
body:
string: '{"identity": {"id": "8:acs:f5294985-c25d-4372-80f9-bb43572e72b2_00000007-ea1a-6e54-6032-3b3a0d0002c2"},
"accessToken": {"token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwMiIsIng1dCI6IjNNSnZRYzhrWVNLd1hqbEIySmx6NTRQVzNBYyIsInR5cCI6IkpXVCJ9.eyJza3lwZWlkIjoiYWNzOmY1Mjk0OTg1LWMyNWQtNDM3Mi04MGY5LWJiNDM1NzJlNzJiMl8wMDAwMDAwNy1lYTFhLTZlNTQtNjAzMi0zYjNhMGQwMDAyYzIiLCJzY3AiOjE3OTIsImNzaSI6IjE2MTE4NTc5NzEiLCJpYXQiOjE2MTE4NTc5NzEsImV4cCI6MTYxMTk0NDM3MSwiYWNzU2NvcGUiOiJjaGF0IiwicmVzb3VyY2VJZCI6ImY1Mjk0OTg1LWMyNWQtNDM3Mi04MGY5LWJiNDM1NzJlNzJiMiJ9.PYfUH9RNvccMK-GvC2EFO8DZ3Zx916yPW0OfaAvrTbf1IToRuFEoKznlvwi7h2zqfqKrA6bNAXGHwRDA8H32uYgIiw5U-BeWc00xXQhTiVpwZgQDjR-my2U_1l8eblV7PZH7BJ35uf115HJQP-s5jQ202PqJwKwMvBS01RvttH4w3wSSXTPlgkdvSMTFA7T3nkY3cGHDuMnLHZepzspgca0MtrF0rxx0q4XQH1gWYKBN3hfDh2FMQmn-cqHH4cSrWwNLuaBnWGptUoYA0g00FAmjOX4gtT5xFyyZ9TvZoSSr332qP-_c8U-EmM4uIJTI8UR21cV-n3uz50FQhnsqRg",
"expiresOn": "2021-01-29T18:19:30.8206627+00:00"}}'
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-03-07
content-type:
- application/json; charset=utf-8
date:
- Thu, 28 Jan 2021 18:19:31 GMT
ms-cv:
- W/TJoPYQyUW0JJtdk5ZYIw.0
strict-transport-security:
- max-age=2592000
transfer-encoding:
- chunked
x-processing-time:
- 97ms
status:
code: 201
message: Created
version: 1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interactions:
Content-Type:
- application/json
Date:
- Wed, 27 Jan 2021 23:56:55 GMT
- Thu, 28 Jan 2021 18:20:40 GMT
User-Agent:
- azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
x-ms-return-client-request-id:
Expand All @@ -22,22 +22,22 @@ interactions:
uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07
response:
body:
string: '{"identity": {"id": "8:acs:b040bbd1-fb13-465b-a547-44c5ff20b980_00000007-e628-f9f8-3ef0-8b3a0d003d3d"}}'
string: '{"identity": {"id": "8:acs:ec8aa781-2f38-49c7-86a2-bfdece4cc21c_00000007-ea1b-789a-6a0b-343a0d00031a"}}'
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-03-07
content-type:
- application/json; charset=utf-8
date:
- Wed, 27 Jan 2021 23:56:55 GMT
- Thu, 28 Jan 2021 18:20:39 GMT
ms-cv:
- lv7eyX3+o0SgYHigmvhZNw.0
- rSGjhLYPdEu2zAqKwy2o1Q.0
strict-transport-security:
- max-age=2592000
transfer-encoding:
- chunked
x-processing-time:
- 214ms
- 32ms
status:
code: 201
message: Created
Expand All @@ -53,7 +53,7 @@ interactions:
Content-Length:
- '0'
Date:
- Wed, 27 Jan 2021 23:56:55 GMT
- Thu, 28 Jan 2021 18:20:40 GMT
User-Agent:
- azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
x-ms-return-client-request-id:
Expand All @@ -67,13 +67,13 @@ interactions:
api-supported-versions:
- 2020-07-20-preview2, 2021-03-07
date:
- Wed, 27 Jan 2021 23:56:56 GMT
- Thu, 28 Jan 2021 18:20:39 GMT
ms-cv:
- sVJZF/hnPUiFLBDEQt3jnQ.0
- qp5wpCjFTUmT7TUUWOESmA.0
strict-transport-security:
- max-age=2592000
x-processing-time:
- 777ms
- 608ms
status:
code: 204
message: No Content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ interactions:
uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07
response:
body:
string: '{"identity": {"id": "8:acs:f050eca7-6baa-4427-966b-21841aa36a78_00000007-e62a-1f3f-8337-3b3a0d009555"}}'
string: '{"identity": {"id": "8:acs:d09cd7e3-a33e-4e7b-9ab0-0edc3b9c7ae5_00000007-ea1c-84ff-6032-3b3a0d0002c6"}}'
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-03-07
content-type:
- application/json; charset=utf-8
date:
- Wed, 27 Jan 2021 23:58:10 GMT
- Thu, 28 Jan 2021 18:21:48 GMT
ms-cv:
- RivzvSMrYUCxdpIjJOqXeA.0
- z+d65i45k0Sfvh2myFd7aQ.0
strict-transport-security:
- max-age=2592000
transfer-encoding:
- chunked
x-processing-time:
- 193ms
- 596ms
status:
code: 201
message: Created
Expand All @@ -59,13 +59,13 @@ interactions:
api-supported-versions:
- 2020-07-20-preview2, 2021-03-07
date:
- Wed, 27 Jan 2021 23:58:12 GMT
- Thu, 28 Jan 2021 18:21:48 GMT
ms-cv:
- akcIQiMeskOt/X1QZdhizg.0
- V0oUwgZPAkO+7Sxm2/717w.0
strict-transport-security:
- max-age=2592000
x-processing-time:
- 1936ms
- 680ms
status:
code: 204
message: No Content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interactions:
Content-Type:
- application/json
Date:
- Wed, 27 Jan 2021 23:59:18 GMT
- Thu, 28 Jan 2021 18:22:56 GMT
User-Agent:
- azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
x-ms-return-client-request-id:
Expand All @@ -22,22 +22,22 @@ interactions:
uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07
response:
body:
string: '{"identity": {"id": "8:acs:8b7cf66e-98a2-4dc9-b44e-902ad4bd2a83_00000007-e62b-2a03-8d33-3b3a0d00aab4"}}'
string: '{"identity": {"id": "8:acs:fa9ae185-9f60-4454-8be7-5757cf514f4b_00000007-ea1d-8d6f-8d33-3b3a0d000285"}}'
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-03-07
content-type:
- application/json; charset=utf-8
date:
- Wed, 27 Jan 2021 23:59:19 GMT
- Thu, 28 Jan 2021 18:22:55 GMT
ms-cv:
- svjbdAEx+0CIrvFNZfZTNA.0
- FsWGFnXtdEyCvzh35+CEqw.0
strict-transport-security:
- max-age=2592000
transfer-encoding:
- chunked
x-processing-time:
- 20ms
- 18ms
status:
code: 201
message: Created
Expand All @@ -55,7 +55,7 @@ interactions:
Content-Type:
- application/json
Date:
- Wed, 27 Jan 2021 23:59:19 GMT
- Thu, 28 Jan 2021 18:22:57 GMT
User-Agent:
- azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0)
x-ms-return-client-request-id:
Expand All @@ -64,22 +64,22 @@ interactions:
uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07
response:
body:
string: '{"token": "sanitized", "expiresOn": "2021-01-28T23:59:19.164577+00:00"}'
string: '{"token": "sanitized", "expiresOn": "2021-01-29T18:22:55.4643038+00:00"}'
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-03-07
content-type:
- application/json; charset=utf-8
date:
- Wed, 27 Jan 2021 23:59:20 GMT
- Thu, 28 Jan 2021 18:22:56 GMT
ms-cv:
- q/mt/g2JeUiXEsC0OhWXNQ.0
- SUXqGX/Z4E6C6zfcxiWQEw.0
strict-transport-security:
- max-age=2592000
transfer-encoding:
- chunked
x-processing-time:
- 284ms
- 35ms
status:
code: 200
message: OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ interactions:
uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07
response:
body:
string: '{"identity": {"id": "8:acs:31fd4348-e9dd-4222-ae65-a61c9953759c_00000007-e62c-414b-0e04-343a0d00a745"}}'
string: '{"identity": {"id": "8:acs:24c5bf6f-a229-4275-b6a9-cae0d1f70ca4_00000007-ea1e-96a8-6032-3b3a0d0002d2"}}'
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-03-07
content-type:
- application/json; charset=utf-8
date:
- Thu, 28 Jan 2021 00:00:30 GMT
- Thu, 28 Jan 2021 18:24:04 GMT
ms-cv:
- BndpwMRlKkSHkEuCPG7OOw.0
- LHLZRP95jE2SbM8pXoqtnA.0
strict-transport-security:
- max-age=2592000
transfer-encoding:
- chunked
x-processing-time:
- 198ms
- 501ms
status:
code: 201
message: Created
Expand All @@ -56,22 +56,22 @@ interactions:
uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07
response:
body:
string: '{"token": "sanitized", "expiresOn": "2021-01-29T00:00:30.7153587+00:00"}'
string: '{"token": "sanitized", "expiresOn": "2021-01-29T18:24:03.353153+00:00"}'
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-03-07
content-type:
- application/json; charset=utf-8
date:
- Thu, 28 Jan 2021 00:00:31 GMT
- Thu, 28 Jan 2021 18:24:04 GMT
ms-cv:
- Ka0JSro0U0mjBhf0UNLzSg.0
- ypXqr3+DHEyTO0p32UznqA.0
strict-transport-security:
- max-age=2592000
transfer-encoding:
- chunked
x-processing-time:
- 328ms
- 25ms
status:
code: 200
message: OK
Expand Down
Loading