Skip to content

Commit b3d0a25

Browse files
authored
update authorization (Azure#23426)
1 parent 4001cb5 commit b3d0a25

File tree

2 files changed

+52
-61
lines changed

2 files changed

+52
-61
lines changed

sdk/authorization/azure-mgmt-authorization/tests/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from dotenv import load_dotenv
3232

3333
from devtools_testutils import test_proxy, add_general_regex_sanitizer
34+
from devtools_testutils import add_header_regex_sanitizer, add_body_key_sanitizer
3435

3536
# Ignore async tests for Python < 3.5
3637
collect_ignore_glob = []
@@ -44,4 +45,7 @@ def add_sanitizers(test_proxy):
4445
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000")
4546
tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000")
4647
add_general_regex_sanitizer(regex=subscription_id, value="00000000-0000-0000-0000-000000000000")
47-
add_general_regex_sanitizer(regex=tenant_id, value="00000000-0000-0000-0000-000000000000")
48+
add_general_regex_sanitizer(regex=tenant_id, value="00000000-0000-0000-0000-000000000000")
49+
add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]")
50+
add_header_regex_sanitizer(key="Cookie", value="cookie;")
51+
add_body_key_sanitizer(json_path="$..access_token", value="access_token")

sdk/authorization/azure-mgmt-authorization/tests/recordings/test_cli_mgmt_authorization.pyTestMgmtAuthorizationtest_list_by_resource.json

Lines changed: 47 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"Accept": "*/*",
88
"Accept-Encoding": "gzip, deflate",
99
"Connection": "keep-alive",
10-
"User-Agent": "azsdk-python-identity/1.7.2 Python/3.8.8 (Windows-10-10.0.19041-SP0)"
10+
"User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.6.2 (Windows-10-10.0.19041-SP0)"
1111
},
1212
"RequestBody": null,
1313
"StatusCode": 200,
@@ -17,18 +17,13 @@
1717
"Cache-Control": "max-age=86400, private",
1818
"Content-Length": "1753",
1919
"Content-Type": "application/json; charset=utf-8",
20-
"Date": "Fri, 31 Dec 2021 05:52:00 GMT",
20+
"Date": "Wed, 09 Mar 2022 06:51:39 GMT",
2121
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
22-
"Set-Cookie": [
23-
"fpc=AtnlA1GSgGxGmjHNPbQxV7o; expires=Sun, 30-Jan-2022 05:52:00 GMT; path=/; secure; HttpOnly; SameSite=None",
24-
"esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr4TFPbvtNW_99FFeKRnoQUjF6QiAj2DykHCWb5ihlpQXfJyE4q5jPig7-IsEfEGVt37B-MEAgUYO603bST4AT-edhhfN5oVO7TcTGLqFAr6daC1ko6QiVDZY3af8q3yyp5ypc2ao7BhHeofAkGpjJ-0Au-RldcJ8GzFtuz9fKpa4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None",
25-
"x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly",
26-
"stsservicecookie=estsfd; path=/; secure; samesite=none; httponly"
27-
],
22+
"Set-Cookie": "[set-cookie;]",
2823
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
2924
"X-Content-Type-Options": "nosniff",
30-
"x-ms-ests-server": "2.1.12261.17 - NCUS ProdSlices",
31-
"x-ms-request-id": "6e34d291-004b-4bb2-9add-ec68ad952201"
25+
"x-ms-ests-server": "2.1.12529.17 - SCUS ProdSlices",
26+
"x-ms-request-id": "164ac044-db41-487c-9432-0e95a70bf700"
3227
},
3328
"ResponseBody": {
3429
"token_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token",
@@ -105,8 +100,8 @@
105100
"Accept": "application/json",
106101
"Accept-Encoding": "gzip, deflate",
107102
"Connection": "keep-alive",
108-
"Cookie": "fpc=AtnlA1GSgGxGmjHNPbQxV7o; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd",
109-
"User-Agent": "azsdk-python-identity/1.7.2 Python/3.8.8 (Windows-10-10.0.19041-SP0)"
103+
"Cookie": "cookie;",
104+
"User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.6.2 (Windows-10-10.0.19041-SP0)"
110105
},
111106
"RequestBody": null,
112107
"StatusCode": 200,
@@ -116,17 +111,13 @@
116111
"Cache-Control": "max-age=86400, private",
117112
"Content-Length": "945",
118113
"Content-Type": "application/json; charset=utf-8",
119-
"Date": "Fri, 31 Dec 2021 05:52:01 GMT",
114+
"Date": "Wed, 09 Mar 2022 06:51:40 GMT",
120115
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
121-
"Set-Cookie": [
122-
"fpc=AtnlA1GSgGxGmjHNPbQxV7o; expires=Sun, 30-Jan-2022 05:52:01 GMT; path=/; secure; HttpOnly; SameSite=None",
123-
"x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly",
124-
"stsservicecookie=estsfd; path=/; secure; samesite=none; httponly"
125-
],
116+
"Set-Cookie": "[set-cookie;]",
126117
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
127118
"X-Content-Type-Options": "nosniff",
128-
"x-ms-ests-server": "2.1.12261.17 - SEASLR1 ProdSlices",
129-
"x-ms-request-id": "c7025f87-5230-4b1b-a3d3-5a8e0fd65c00"
119+
"x-ms-ests-server": "2.1.12559.5 - SEASLR1 ProdSlices",
120+
"x-ms-request-id": "fcb8cc6d-c865-4e5d-b3f3-f11469580400"
130121
},
131122
"ResponseBody": {
132123
"tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration",
@@ -181,47 +172,43 @@
181172
"RequestHeaders": {
182173
"Accept": "application/json",
183174
"Accept-Encoding": "gzip, deflate",
184-
"client-request-id": "26aff9ce-7722-4d73-8566-ae3f960c5f96",
175+
"client-request-id": "865a2fb0-9b9e-4e09-997f-02c6682c30e0",
185176
"Connection": "keep-alive",
186-
"Content-Length": "289",
177+
"Content-Length": "291",
187178
"Content-Type": "application/x-www-form-urlencoded",
188-
"Cookie": "fpc=AtnlA1GSgGxGmjHNPbQxV7o; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd",
189-
"User-Agent": "azsdk-python-identity/1.7.2 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
179+
"Cookie": "cookie;",
180+
"User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.6.2 (Windows-10-10.0.19041-SP0)",
190181
"x-client-cpu": "x64",
191182
"x-client-current-telemetry": "4|730,0|",
192183
"x-client-last-telemetry": "4|0|||",
193184
"x-client-os": "win32",
194185
"x-client-sku": "MSAL.Python",
195-
"x-client-ver": "1.16.0",
186+
"x-client-ver": "1.17.0",
196187
"x-ms-lib-capability": "retry-after, h429"
197188
},
198-
"RequestBody": "client_id=a2df54d5-ab03-4725-9b80-9a00b3b1967f\u0026grant_type=client_credentials\u0026client_info=1\u0026client_secret=0vj7Q~IsFayrD0V_8oyOfygU-GE3ELOabq95a\u0026claims=%7B%22access_token%22%3A\u002B%7B%22xms_cc%22%3A\u002B%7B%22values%22%3A\u002B%5B%22CP1%22%5D%7D%7D%7D\u0026scope=https%3A%2F%2Fmanagement.azure.com%2F.default",
189+
"RequestBody": "client_id=a2df54d5-ab03-4725-9b80-9a00b3b1967f\u0026grant_type=client_credentials\u0026client_info=1\u0026client_secret=0vj7Q%7EIsFayrD0V_8oyOfygU-GE3ELOabq95a\u0026claims=%7B%22access_token%22%3A\u002B%7B%22xms_cc%22%3A\u002B%7B%22values%22%3A\u002B%5B%22CP1%22%5D%7D%7D%7D\u0026scope=https%3A%2F%2Fmanagement.azure.com%2F.default",
199190
"StatusCode": 200,
200191
"ResponseHeaders": {
201192
"Cache-Control": "no-store, no-cache",
202-
"client-request-id": "26aff9ce-7722-4d73-8566-ae3f960c5f96",
203-
"Content-Length": "1391",
193+
"client-request-id": "865a2fb0-9b9e-4e09-997f-02c6682c30e0",
194+
"Content-Length": "93",
204195
"Content-Type": "application/json; charset=utf-8",
205-
"Date": "Fri, 31 Dec 2021 05:52:01 GMT",
196+
"Date": "Wed, 09 Mar 2022 06:51:40 GMT",
206197
"Expires": "-1",
207198
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
208199
"Pragma": "no-cache",
209-
"Set-Cookie": [
210-
"fpc=AtnlA1GSgGxGmjHNPbQxV7qZHqKEAQAAAIGRYNkOAAAA; expires=Sun, 30-Jan-2022 05:52:01 GMT; path=/; secure; HttpOnly; SameSite=None",
211-
"x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly",
212-
"stsservicecookie=estsfd; path=/; secure; samesite=none; httponly"
213-
],
200+
"Set-Cookie": "[set-cookie;]",
214201
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
215202
"X-Content-Type-Options": "nosniff",
216203
"x-ms-clitelem": "1,0,0,,",
217-
"x-ms-ests-server": "2.1.12261.17 - SCUS ProdSlices",
218-
"x-ms-request-id": "ccdba34f-137e-4f83-b37b-10c4980c0302"
204+
"x-ms-ests-server": "2.1.12529.17 - WUS2 ProdSlices",
205+
"x-ms-request-id": "8f51276e-c307-4ec1-b670-5d6d54ea2e01"
219206
},
220207
"ResponseBody": {
221208
"token_type": "Bearer",
222209
"expires_in": 3599,
223210
"ext_expires_in": 3599,
224-
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1yNS1BVWliZkJpaTdOZDFqQmViYXhib1hXMCIsImtpZCI6Ik1yNS1BVWliZkJpaTdOZDFqQmViYXhib1hXMCJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuYXp1cmUuY29tIiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhLyIsImlhdCI6MTY0MDkyOTYyMSwibmJmIjoxNjQwOTI5NjIxLCJleHAiOjE2NDA5MzM1MjEsImFpbyI6IkUyWmdZRGltTHBIME0reUE5OTZnM21mVFF5WDdBQT09IiwiYXBwaWQiOiJhMmRmNTRkNS1hYjAzLTQ3MjUtOWI4MC05YTAwYjNiMTk2N2YiLCJhcHBpZGFjciI6IjEiLCJpZHAiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC81NDgyNmIyMi0zOGQ2LTRmYjItYmFkOS1iN2I5M2EzZTljNWEvIiwiaWR0eXAiOiJhcHAiLCJvaWQiOiI4ODdjNDJiMS03OTQ2LTRjMjItYmFhNi0xNTA0M2U0YjEzMjMiLCJyaCI6IjAuQVRjQUltdUNWTlk0c2stNjJiZTVPajZjV3RWVTM2SURxeVZIbTRDYUFMT3hsbjgzQUFBLiIsInN1YiI6Ijg4N2M0MmIxLTc5NDYtNGMyMi1iYWE2LTE1MDQzZTRiMTMyMyIsInRpZCI6IjU0ODI2YjIyLTM4ZDYtNGZiMi1iYWQ5LWI3YjkzYTNlOWM1YSIsInV0aSI6IlQ2UGJ6SDRUZzAtemV4REVtQXdEQWciLCJ2ZXIiOiIxLjAiLCJ4bXNfY2MiOlsiQ1AxIl0sInhtc190Y2R0IjoxNDEyMjA2ODQwfQ.nDMpVOdgU55ga-LeEf4BoUQj0AH2uPavcK9ZWnOYyZWKx9fpgE5VEmxk_1aCoadEErO2hNXu7tA7ICHNgpA49Z2PhqSyc4VD6GCSpzgv-AH5YynTaBEd7Sf3KwrOafMPnOiHzUuxNe0MLMUEwWq55rPHHiOj_3e5EAL16KW9ubrao42Thi9cgL91z7IjWIBlMNyO9VGvXOdeFtCpFj0f0LcXePkBg8Q82_-Y1wO-oMcozsnrubPoXm8hc88yo1TRLrRm5hnrIbY3Ww-qSmga69-vz8XYyj0rHtvce2GjTOb9zaD6VBIbRPT9kUI_ZPqegIEgNj59M1qTKA4UjPeZmw"
211+
"access_token": "access_token"
225212
}
226213
},
227214
{
@@ -234,16 +221,18 @@
234221
"Connection": "keep-alive",
235222
"Content-Length": "22",
236223
"Content-Type": "application/json",
237-
"User-Agent": "azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
238-
"x-ms-client-request-id": "c3c6cd61-69fd-11ec-9f55-70b5e82527ff"
224+
"User-Agent": "azsdk-python-azure-mgmt-resource/20.1.0 Python/3.6.2 (Windows-10-10.0.19041-SP0)",
225+
"x-ms-client-request-id": "5ec8eba4-9f75-11ec-beab-c0b6f9946f2d"
226+
},
227+
"RequestBody": {
228+
"location": "eastus"
239229
},
240-
"RequestBody": "{\u0022location\u0022: \u0022eastus\u0022}",
241230
"StatusCode": 200,
242231
"ResponseHeaders": {
243232
"Cache-Control": "no-cache",
244233
"Content-Encoding": "gzip",
245234
"Content-Type": "application/json; charset=utf-8",
246-
"Date": "Fri, 31 Dec 2021 05:52:09 GMT",
235+
"Date": "Wed, 09 Mar 2022 06:51:48 GMT",
247236
"Expires": "-1",
248237
"Pragma": "no-cache",
249238
"Server": [
@@ -254,27 +243,25 @@
254243
"Transfer-Encoding": "chunked",
255244
"Vary": "Accept-Encoding",
256245
"X-Content-Type-Options": "nosniff",
257-
"x-ms-correlation-request-id": "3a90ff09-6a36-48a0-97d4-bb4eac61edc0",
258-
"x-ms-ratelimit-remaining-resource": "Microsoft.Compute/PutVM3Min;744,Microsoft.Compute/PutVM30Min;3728",
246+
"x-ms-correlation-request-id": "a3d83309-73ee-4051-9535-279e53cb1a9e",
247+
"x-ms-ratelimit-remaining-resource": "Microsoft.Compute/PutVM3Min;745,Microsoft.Compute/PutVM30Min;3729",
259248
"x-ms-ratelimit-remaining-subscription-writes": "1199",
260-
"x-ms-request-id": "8a0416a3-0676-4eb1-9a80-fcc1b6b039ec",
261-
"x-ms-routing-request-id": "SOUTHEASTASIA:20211231T055209Z:3a90ff09-6a36-48a0-97d4-bb4eac61edc0"
249+
"x-ms-request-id": "43365a2a-6278-4dc8-a86a-4fe49b22b314",
250+
"x-ms-routing-request-id": "SOUTHEASTASIA:20220309T065148Z:a3d83309-73ee-4051-9535-279e53cb1a9e"
262251
},
263-
"ResponseBody": [
264-
"{\r\n",
265-
" \u0022name\u0022: \u0022resourcexxx\u0022,\r\n",
266-
" \u0022id\u0022: \u0022/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/resourcexxx\u0022,\r\n",
267-
" \u0022type\u0022: \u0022Microsoft.Compute/availabilitySets\u0022,\r\n",
268-
" \u0022location\u0022: \u0022eastus\u0022,\r\n",
269-
" \u0022properties\u0022: {\r\n",
270-
" \u0022platformUpdateDomainCount\u0022: 5,\r\n",
271-
" \u0022platformFaultDomainCount\u0022: 3\r\n",
272-
" },\r\n",
273-
" \u0022sku\u0022: {\r\n",
274-
" \u0022name\u0022: \u0022Classic\u0022\r\n",
275-
" }\r\n",
276-
"}"
277-
]
252+
"ResponseBody": {
253+
"name": "resourcexxx",
254+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/availabilitySets/resourcexxx",
255+
"type": "Microsoft.Compute/availabilitySets",
256+
"location": "eastus",
257+
"properties": {
258+
"platformUpdateDomainCount": 5,
259+
"platformFaultDomainCount": 3
260+
},
261+
"sku": {
262+
"name": "Classic"
263+
}
264+
}
278265
}
279266
],
280267
"Variables": {}

0 commit comments

Comments
 (0)