Skip to content

Commit 8445817

Browse files
authored
update (Azure#22310)
1 parent 7be685d commit 8445817

File tree

6 files changed

+379
-110
lines changed

6 files changed

+379
-110
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
-e ../../../tools/azure-sdk-tools
2-
-e ../../../tools/azure-devtools
2+
-e ../../../tools/azure-devtools
3+
../../identity/azure-identity
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# --------------------------------------------------------------------------
2+
#
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
#
5+
# The MIT License (MIT)
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the ""Software""), to
9+
# deal in the Software without restriction, including without limitation the
10+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11+
# sell copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in
15+
# all copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23+
# IN THE SOFTWARE.
24+
#
25+
# --------------------------------------------------------------------------
26+
import os
27+
import platform
28+
import pytest
29+
import sys
30+
31+
from dotenv import load_dotenv
32+
33+
from devtools_testutils import test_proxy, add_general_regex_sanitizer
34+
35+
# Ignore async tests for Python < 3.5
36+
collect_ignore_glob = []
37+
if sys.version_info < (3, 5) or platform.python_implementation() == "PyPy":
38+
collect_ignore_glob.append("*_async.py")
39+
40+
load_dotenv()
41+
42+
@pytest.fixture(scope="session", autouse=True)
43+
def add_sanitizers(test_proxy):
44+
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000")
45+
tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000")
46+
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")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,321 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0/.well-known/openid-configuration",
5+
"RequestMethod": "GET",
6+
"RequestHeaders": {
7+
"Accept": "*/*",
8+
"Accept-Encoding": "gzip, deflate",
9+
"Connection": "keep-alive",
10+
"User-Agent": "azsdk-python-identity/1.7.2 Python/3.8.8 (Windows-10-10.0.19041-SP0)"
11+
},
12+
"RequestBody": null,
13+
"StatusCode": 200,
14+
"ResponseHeaders": {
15+
"Access-Control-Allow-Methods": "GET, OPTIONS",
16+
"Access-Control-Allow-Origin": "*",
17+
"Cache-Control": "max-age=86400, private",
18+
"Content-Length": "1753",
19+
"Content-Type": "application/json; charset=utf-8",
20+
"Date": "Tue, 04 Jan 2022 05:33:48 GMT",
21+
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
22+
"Set-Cookie": [
23+
"fpc=AimtGYQKPspOkzEXfkt3Piw; expires=Thu, 03-Feb-2022 05:33:49 GMT; path=/; secure; HttpOnly; SameSite=None",
24+
"esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr3uRYAWNQ8a4Rk2bL5bfdTJEcX9fNsA6y23YO95EdpE41FqstWC7cSy4aavPX9idZxkwwkKjf31WTgdA74po_L4ZCaiYKca2q_iLrS-pDxVDGRa5bMOxbKEt7i23Z7zoi8QJfGo2yLyT5Gtt4ZihUCqpwtPbL0yxUgGAfpDJiB8sgAA; 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+
],
28+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
29+
"X-Content-Type-Options": "nosniff",
30+
"x-ms-ests-server": "2.1.12261.17 - WUS2 ProdSlices",
31+
"x-ms-request-id": "903178ec-7beb-46b8-8d2e-755dad6b0200"
32+
},
33+
"ResponseBody": {
34+
"token_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token",
35+
"token_endpoint_auth_methods_supported": [
36+
"client_secret_post",
37+
"private_key_jwt",
38+
"client_secret_basic"
39+
],
40+
"jwks_uri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/discovery/v2.0/keys",
41+
"response_modes_supported": [
42+
"query",
43+
"fragment",
44+
"form_post"
45+
],
46+
"subject_types_supported": [
47+
"pairwise"
48+
],
49+
"id_token_signing_alg_values_supported": [
50+
"RS256"
51+
],
52+
"response_types_supported": [
53+
"code",
54+
"id_token",
55+
"code id_token",
56+
"id_token token"
57+
],
58+
"scopes_supported": [
59+
"openid",
60+
"profile",
61+
"email",
62+
"offline_access"
63+
],
64+
"issuer": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0",
65+
"request_uri_parameter_supported": false,
66+
"userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo",
67+
"authorization_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/authorize",
68+
"device_authorization_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/devicecode",
69+
"http_logout_supported": true,
70+
"frontchannel_logout_supported": true,
71+
"end_session_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/logout",
72+
"claims_supported": [
73+
"sub",
74+
"iss",
75+
"cloud_instance_name",
76+
"cloud_instance_host_name",
77+
"cloud_graph_host_name",
78+
"msgraph_host",
79+
"aud",
80+
"exp",
81+
"iat",
82+
"auth_time",
83+
"acr",
84+
"nonce",
85+
"preferred_username",
86+
"name",
87+
"tid",
88+
"ver",
89+
"at_hash",
90+
"c_hash",
91+
"email"
92+
],
93+
"kerberos_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/kerberos",
94+
"tenant_region_scope": "NA",
95+
"cloud_instance_name": "microsoftonline.com",
96+
"cloud_graph_host_name": "graph.windows.net",
97+
"msgraph_host": "graph.microsoft.com",
98+
"rbac_url": "https://pas.windows.net"
99+
}
100+
},
101+
{
102+
"RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize",
103+
"RequestMethod": "GET",
104+
"RequestHeaders": {
105+
"Accept": "application/json",
106+
"Accept-Encoding": "gzip, deflate",
107+
"Connection": "keep-alive",
108+
"Cookie": "fpc=AimtGYQKPspOkzEXfkt3Piw; 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)"
110+
},
111+
"RequestBody": null,
112+
"StatusCode": 200,
113+
"ResponseHeaders": {
114+
"Access-Control-Allow-Methods": "GET, OPTIONS",
115+
"Access-Control-Allow-Origin": "*",
116+
"Cache-Control": "max-age=86400, private",
117+
"Content-Length": "945",
118+
"Content-Type": "application/json; charset=utf-8",
119+
"Date": "Tue, 04 Jan 2022 05:33:48 GMT",
120+
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
121+
"Set-Cookie": [
122+
"fpc=AimtGYQKPspOkzEXfkt3Piw; expires=Thu, 03-Feb-2022 05:33:49 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+
],
126+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
127+
"X-Content-Type-Options": "nosniff",
128+
"x-ms-ests-server": "2.1.12261.17 - SEASLR1 ProdSlices",
129+
"x-ms-request-id": "ab800d36-9487-492e-b40d-f24b5aad7b00"
130+
},
131+
"ResponseBody": {
132+
"tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration",
133+
"api-version": "1.1",
134+
"metadata": [
135+
{
136+
"preferred_network": "login.microsoftonline.com",
137+
"preferred_cache": "login.windows.net",
138+
"aliases": [
139+
"login.microsoftonline.com",
140+
"login.windows.net",
141+
"login.microsoft.com",
142+
"sts.windows.net"
143+
]
144+
},
145+
{
146+
"preferred_network": "login.partner.microsoftonline.cn",
147+
"preferred_cache": "login.partner.microsoftonline.cn",
148+
"aliases": [
149+
"login.partner.microsoftonline.cn",
150+
"login.chinacloudapi.cn"
151+
]
152+
},
153+
{
154+
"preferred_network": "login.microsoftonline.de",
155+
"preferred_cache": "login.microsoftonline.de",
156+
"aliases": [
157+
"login.microsoftonline.de"
158+
]
159+
},
160+
{
161+
"preferred_network": "login.microsoftonline.us",
162+
"preferred_cache": "login.microsoftonline.us",
163+
"aliases": [
164+
"login.microsoftonline.us",
165+
"login.usgovcloudapi.net"
166+
]
167+
},
168+
{
169+
"preferred_network": "login-us.microsoftonline.com",
170+
"preferred_cache": "login-us.microsoftonline.com",
171+
"aliases": [
172+
"login-us.microsoftonline.com"
173+
]
174+
}
175+
]
176+
}
177+
},
178+
{
179+
"RequestUri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token",
180+
"RequestMethod": "POST",
181+
"RequestHeaders": {
182+
"Accept": "application/json",
183+
"Accept-Encoding": "gzip, deflate",
184+
"client-request-id": "f486646f-a102-40ef-bdb9-6697925d91b5",
185+
"Connection": "keep-alive",
186+
"Content-Length": "289",
187+
"Content-Type": "application/x-www-form-urlencoded",
188+
"Cookie": "fpc=AimtGYQKPspOkzEXfkt3Piw; 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)",
190+
"x-client-cpu": "x64",
191+
"x-client-current-telemetry": "4|730,0|",
192+
"x-client-last-telemetry": "4|0|||",
193+
"x-client-os": "win32",
194+
"x-client-sku": "MSAL.Python",
195+
"x-client-ver": "1.16.0",
196+
"x-ms-lib-capability": "retry-after, h429"
197+
},
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",
199+
"StatusCode": 200,
200+
"ResponseHeaders": {
201+
"Cache-Control": "no-store, no-cache",
202+
"client-request-id": "f486646f-a102-40ef-bdb9-6697925d91b5",
203+
"Content-Length": "1391",
204+
"Content-Type": "application/json; charset=utf-8",
205+
"Date": "Tue, 04 Jan 2022 05:33:48 GMT",
206+
"Expires": "-1",
207+
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
208+
"Pragma": "no-cache",
209+
"Set-Cookie": [
210+
"fpc=AimtGYQKPspOkzEXfkt3PiyZHqKEAQAAADzTZdkOAAAA; expires=Thu, 03-Feb-2022 05:33:49 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+
],
214+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
215+
"X-Content-Type-Options": "nosniff",
216+
"x-ms-clitelem": "1,0,0,,",
217+
"x-ms-ests-server": "2.1.12261.17 - SCUS ProdSlices",
218+
"x-ms-request-id": "26469378-23c1-4d1f-963b-8bb2507dae02"
219+
},
220+
"ResponseBody": {
221+
"token_type": "Bearer",
222+
"expires_in": 3599,
223+
"ext_expires_in": 3599,
224+
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1yNS1BVWliZkJpaTdOZDFqQmViYXhib1hXMCIsImtpZCI6Ik1yNS1BVWliZkJpaTdOZDFqQmViYXhib1hXMCJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuYXp1cmUuY29tIiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhLyIsImlhdCI6MTY0MTI3NDEyOSwibmJmIjoxNjQxMjc0MTI5LCJleHAiOjE2NDEyNzgwMjksImFpbyI6IkUyWmdZSWlRYnI5Z2NkSHBQT2VYR3ZGNnBhcTNBQT09IiwiYXBwaWQiOiJhMmRmNTRkNS1hYjAzLTQ3MjUtOWI4MC05YTAwYjNiMTk2N2YiLCJhcHBpZGFjciI6IjEiLCJpZHAiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC81NDgyNmIyMi0zOGQ2LTRmYjItYmFkOS1iN2I5M2EzZTljNWEvIiwiaWR0eXAiOiJhcHAiLCJvaWQiOiI4ODdjNDJiMS03OTQ2LTRjMjItYmFhNi0xNTA0M2U0YjEzMjMiLCJyaCI6IjAuQVRjQUltdUNWTlk0c2stNjJiZTVPajZjV3RWVTM2SURxeVZIbTRDYUFMT3hsbjgzQUFBLiIsInN1YiI6Ijg4N2M0MmIxLTc5NDYtNGMyMi1iYWE2LTE1MDQzZTRiMTMyMyIsInRpZCI6IjU0ODI2YjIyLTM4ZDYtNGZiMi1iYWQ5LWI3YjkzYTNlOWM1YSIsInV0aSI6ImVKTkdKc0VqSDAyV080dXlVSDJ1QWciLCJ2ZXIiOiIxLjAiLCJ4bXNfY2MiOlsiQ1AxIl0sInhtc190Y2R0IjoxNDEyMjA2ODQwfQ.JVfs-mrVSIz9vuelSx3JJ1Xk4Yia8A3QTE3lhVr7okXIqo1lKEP4DeZOslwKTxfQkl6dvZxtrAGp1zMrGp2SKRTr3uhwzHPdgI0SoEeZ25zqKD4d1PMP-ggKLERlEZMqFQrXPw5STFXJx20rlruxA3NfQX2_X4fCd0-tTEeMTx6susLLikzkRsCRdN1hDRv7JaYgOaYHkVe-0q_R6dhARd9yWS-HFVVK1AyVYHGk-z5yF4Srlk66uQC4qGGyOmFjvaNhgQFSER_KwkaGLEdZ-2IOznWd6FBTCaAnvvufuRt-r95FU2L-iPq7_ApFeeCtfnnXgMs_GfEtEQM6KW4_mA"
225+
}
226+
},
227+
{
228+
"RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/81542896/providers/Microsoft.Scheduler/jobCollections/myjobcollection?api-version=2016-03-01",
229+
"RequestMethod": "PUT",
230+
"RequestHeaders": {
231+
"Accept": "application/json, text/json",
232+
"Accept-Encoding": "gzip, deflate",
233+
"Authorization": "Sanitized",
234+
"Connection": "keep-alive",
235+
"Content-Length": "63",
236+
"Content-Type": "application/json",
237+
"User-Agent": "azsdk-python-mgmt-scheduler/7.0.0b1 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
238+
"x-ms-client-request-id": "e43ecfbb-6d1f-11ec-b11b-70b5e82527ff"
239+
},
240+
"RequestBody": "{\u0022location\u0022: \u0022westus\u0022, \u0022properties\u0022: {\u0022sku\u0022: {\u0022name\u0022: \u0022Free\u0022}}}",
241+
"StatusCode": 201,
242+
"ResponseHeaders": {
243+
"Cache-Control": "no-cache",
244+
"Content-Length": "290",
245+
"Content-Type": "application/json; charset=utf-8",
246+
"Date": "Tue, 04 Jan 2022 05:34:00 GMT",
247+
"Expires": "-1",
248+
"Pragma": "no-cache",
249+
"Server": "Microsoft-IIS/8.5",
250+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
251+
"X-AspNet-Version": "4.0.30319",
252+
"X-Content-Type-Options": "nosniff",
253+
"x-ms-correlation-request-id": "63d17273-2c93-45b6-be02-db0b0ab39daf",
254+
"x-ms-ratelimit-burst-remaining-scheduler-writes": "59",
255+
"x-ms-ratelimit-remaining-subscription-resource-requests": "299",
256+
"x-ms-request-id": "866d6e2c-3f37-45d6-a355-5efe42c1f43f",
257+
"x-ms-routing-request-id": "SOUTHEASTASIA:20220104T053400Z:63d17273-2c93-45b6-be02-db0b0ab39daf",
258+
"X-Powered-By": "ASP.NET"
259+
},
260+
"ResponseBody": {
261+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/81542896/providers/Microsoft.Scheduler/jobCollections/myjobcollection",
262+
"type": "Microsoft.Scheduler/jobCollections",
263+
"name": "myjobcollection",
264+
"location": "West US",
265+
"properties": {
266+
"sku": {
267+
"name": "Free"
268+
},
269+
"state": "Enabled"
270+
}
271+
}
272+
},
273+
{
274+
"RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/81542896/providers/Microsoft.Scheduler/jobCollections/myjobcollection?api-version=2016-03-01",
275+
"RequestMethod": "GET",
276+
"RequestHeaders": {
277+
"Accept": "application/json, text/json",
278+
"Accept-Encoding": "gzip, deflate",
279+
"Authorization": "Sanitized",
280+
"Connection": "keep-alive",
281+
"User-Agent": "azsdk-python-mgmt-scheduler/7.0.0b1 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
282+
"x-ms-client-request-id": "eb75a150-6d1f-11ec-814c-70b5e82527ff"
283+
},
284+
"RequestBody": null,
285+
"StatusCode": 200,
286+
"ResponseHeaders": {
287+
"Cache-Control": "no-cache",
288+
"Content-Encoding": "gzip",
289+
"Content-Type": "application/json; charset=utf-8",
290+
"Date": "Tue, 04 Jan 2022 05:34:00 GMT",
291+
"Expires": "-1",
292+
"Pragma": "no-cache",
293+
"Server": "Microsoft-IIS/8.5",
294+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
295+
"Transfer-Encoding": "chunked",
296+
"Vary": "Accept-Encoding",
297+
"X-AspNet-Version": "4.0.30319",
298+
"X-Content-Type-Options": "nosniff",
299+
"x-ms-correlation-request-id": "db906721-b16c-402f-a03f-726de8becbe9",
300+
"x-ms-ratelimit-burst-remaining-scheduler-reads": "249",
301+
"x-ms-ratelimit-remaining-subscription-reads": "11999",
302+
"x-ms-request-id": "98905be5-fdfa-44cb-b024-57111945df59",
303+
"x-ms-routing-request-id": "SOUTHEASTASIA:20220104T053400Z:db906721-b16c-402f-a03f-726de8becbe9",
304+
"X-Powered-By": "ASP.NET"
305+
},
306+
"ResponseBody": {
307+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/81542896/providers/Microsoft.Scheduler/jobCollections/myjobcollection",
308+
"type": "Microsoft.Scheduler/jobCollections",
309+
"name": "myjobcollection",
310+
"location": "West US",
311+
"properties": {
312+
"sku": {
313+
"name": "Free"
314+
},
315+
"state": "Enabled"
316+
}
317+
}
318+
}
319+
],
320+
"Variables": {}
321+
}

0 commit comments

Comments
 (0)