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

Migrating Azure Attestation Service Test framework from vcrpy to test server based framework #26220

Merged
merged 10 commits into from
Oct 18, 2022
6 changes: 6 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,12 @@
"fset"
]
},
{
"filename": "sdk/attestation/azure-security-attestation/tests/conftest.py",
"words":[
"sharedwus"
]
},
{
"filename": "sdk/confidentialledger/test-resources.bicep",
"words": [
Expand Down
13 changes: 13 additions & 0 deletions sdk/attestation/azure-security-attestation/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pytest
from devtools_testutils import add_general_string_sanitizer,test_proxy

# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method
@pytest.fixture(scope="session", autouse=True)
def start_proxy(test_proxy):
add_general_string_sanitizer(target="sharedwus", value="fakeresource")
add_general_string_sanitizer(target="policies/SgxEnclave:reset", value="policies/Tpm:reset")
add_general_string_sanitizer(target="policies/OpenEnclave:reset", value="policies/Tpm:reset")
add_general_string_sanitizer(target="policies/SgxEnclave", value="policies/Tpm")
add_general_string_sanitizer(target="policies/OpenEnclave", value="policies/Tpm")
return

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
{
"Entries": [
{
"RequestUri": "https://login.microsoftonline.com/tenant/v2.0/.well-known/openid-configuration",
"RequestMethod": "GET",
"RequestHeaders": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"User-Agent": "azsdk-python-identity/1.10.0 Python/3.10.7 (Windows-10-10.0.19044-SP0)"
},
"RequestBody": null,
"StatusCode": 200,
"ResponseHeaders": {
"Access-Control-Allow-Methods": "GET, OPTIONS",
"Access-Control-Allow-Origin": "*",
"Cache-Control": "max-age=86400, private",
"Content-Length": "1543",
"Content-Type": "application/json; charset=utf-8",
"Date": "Fri, 16 Sep 2022 17:22:12 GMT",
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
"Set-Cookie": [
"fpc=AswhFbSVUL9HhEUm0Ry4vrI; expires=Sun, 16-Oct-2022 17:22:12 GMT; path=/; secure; HttpOnly; SameSite=None",
"esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrc0nlzMU0VuJI17_WtusVKyUI4TjnXgtdJur55d6GhJM_UR7XH8m6662ed6jjejGgZXP-uCpdBTJFMEK8hGopFH_NMi3XxoAxweAYFVyJH3Qi2ngri57V23lOQ6rK6Xc1jeP_I0fkYbG8ed33ydd2udPoMsOccR3lqq1VDL-egGogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None",
"x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly",
"stsservicecookie=estsfd; path=/; secure; samesite=none; httponly"
],
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"x-ms-ests-server": "2.1.13672.7 - SEASLR2 ProdSlices",
"X-XSS-Protection": "0"
},
"ResponseBody": {
"token_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/token",
"token_endpoint_auth_methods_supported": [
"client_secret_post",
"private_key_jwt",
"client_secret_basic"
],
"jwks_uri": "https://login.microsoftonline.com/tenant/discovery/v2.0/keys",
"response_modes_supported": [
"query",
"fragment",
"form_post"
],
"subject_types_supported": [
"pairwise"
],
"id_token_signing_alg_values_supported": [
"RS256"
],
"response_types_supported": [
"code",
"id_token",
"code id_token",
"id_token token"
],
"scopes_supported": [
"openid",
"profile",
"email",
"offline_access"
],
"issuer": "https://login.microsoftonline.com/tenant/v2.0",
"request_uri_parameter_supported": false,
"userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo",
"authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/authorize",
"device_authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode",
"http_logout_supported": true,
"frontchannel_logout_supported": true,
"end_session_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/logout",
"claims_supported": [
"sub",
"iss",
"cloud_instance_name",
"cloud_instance_host_name",
"cloud_graph_host_name",
"msgraph_host",
"aud",
"exp",
"iat",
"auth_time",
"acr",
"nonce",
"preferred_username",
"name",
"tid",
"ver",
"at_hash",
"c_hash",
"email"
],
"kerberos_endpoint": "https://login.microsoftonline.com/tenant/kerberos",
"tenant_region_scope": "WW",
"cloud_instance_name": "microsoftonline.com",
"cloud_graph_host_name": "graph.windows.net",
"msgraph_host": "graph.microsoft.com",
"rbac_url": "https://pas.windows.net"
}
},
{
"RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize",
"RequestMethod": "GET",
"RequestHeaders": {
"Accept": "application/json",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Cookie": "fpc=AswhFbSVUL9HhEUm0Ry4vrI; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd",
"User-Agent": "azsdk-python-identity/1.10.0 Python/3.10.7 (Windows-10-10.0.19044-SP0)"
},
"RequestBody": null,
"StatusCode": 200,
"ResponseHeaders": {
"Access-Control-Allow-Methods": "GET, OPTIONS",
"Access-Control-Allow-Origin": "*",
"Cache-Control": "max-age=86400, private",
"Content-Length": "945",
"Content-Type": "application/json; charset=utf-8",
"Date": "Fri, 16 Sep 2022 17:22:12 GMT",
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
"Set-Cookie": [
"fpc=AswhFbSVUL9HhEUm0Ry4vrI; expires=Sun, 16-Oct-2022 17:22:12 GMT; path=/; secure; HttpOnly; SameSite=None",
"x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly",
"stsservicecookie=estsfd; path=/; secure; samesite=none; httponly"
],
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"x-ms-ests-server": "2.1.13622.7 - KRC ProdSlices",
"X-XSS-Protection": "0"
},
"ResponseBody": {
"tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration",
"api-version": "1.1",
"metadata": [
{
"preferred_network": "login.microsoftonline.com",
"preferred_cache": "login.windows.net",
"aliases": [
"login.microsoftonline.com",
"login.windows.net",
"login.microsoft.com",
"sts.windows.net"
]
},
{
"preferred_network": "login.partner.microsoftonline.cn",
"preferred_cache": "login.partner.microsoftonline.cn",
"aliases": [
"login.partner.microsoftonline.cn",
"login.chinacloudapi.cn"
]
},
{
"preferred_network": "login.microsoftonline.de",
"preferred_cache": "login.microsoftonline.de",
"aliases": [
"login.microsoftonline.de"
]
},
{
"preferred_network": "login.microsoftonline.us",
"preferred_cache": "login.microsoftonline.us",
"aliases": [
"login.microsoftonline.us",
"login.usgovcloudapi.net"
]
},
{
"preferred_network": "login-us.microsoftonline.com",
"preferred_cache": "login-us.microsoftonline.com",
"aliases": [
"login-us.microsoftonline.com"
]
}
]
}
},
{
"RequestUri": "https://login.microsoftonline.com/tenant/oauth2/v2.0/token",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Accept-Encoding": "gzip, deflate",
"client-request-id": "6302ee70-ce08-464b-8f17-29029a528695",
"Connection": "keep-alive",
"Content-Length": "222",
"Content-Type": "application/x-www-form-urlencoded",
"Cookie": "fpc=AswhFbSVUL9HhEUm0Ry4vrI; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd",
"User-Agent": "azsdk-python-identity/1.10.0 Python/3.10.7 (Windows-10-10.0.19044-SP0)",
"x-client-cpu": "x64",
"x-client-current-telemetry": "4|730,0|",
"x-client-last-telemetry": "4|0|||",
"x-client-os": "win32",
"x-client-sku": "MSAL.Python",
"x-client-ver": "1.18.0",
"x-ms-lib-capability": "retry-after, h429"
},
"RequestBody": "client_id=xxxx\u0026grant_type=client_credentials\u0026client_info=1\u0026client_secret=secret\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%2Fattest.azure.net%2F.default",
"StatusCode": 200,
"ResponseHeaders": {
"Cache-Control": "no-store, no-cache",
"client-request-id": "6302ee70-ce08-464b-8f17-29029a528695",
"Content-Length": "111",
"Content-Type": "application/json; charset=utf-8",
"Date": "Fri, 16 Sep 2022 17:22:13 GMT",
"Expires": "-1",
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
"Pragma": "no-cache",
"Set-Cookie": [
"fpc=AswhFbSVUL9HhEUm0Ry4vrJxWF_wAQAAAMSnttoOAAAA; expires=Sun, 16-Oct-2022 17:22:13 GMT; path=/; secure; HttpOnly; SameSite=None",
"x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly",
"stsservicecookie=estsfd; path=/; secure; samesite=none; httponly"
],
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"x-ms-clitelem": "1,0,0,,",
"x-ms-ests-server": "2.1.13734.8 - KRSLR1 ProdSlices",
"X-XSS-Protection": "0"
},
"ResponseBody": {
"token_type": "Bearer",
"expires_in": 86399,
"ext_expires_in": 86399,
"refresh_in": 43199,
"access_token": "Sanitized"
}
},
{
"RequestUri": "https://fakeresource.wus.attest.azure.net/.well-known/openid-configuration",
"RequestMethod": "GET",
"RequestHeaders": {
"Accept": "application/json",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"User-Agent": "azsdk-python-security-attestation/1.0.0b2 Python/3.10.7 (Windows-10-10.0.19044-SP0)"
},
"RequestBody": null,
"StatusCode": 200,
"ResponseHeaders": {
"Content-Length": "582",
"Content-Type": "application/json; charset=utf-8",
"Date": "Fri, 16 Sep 2022 17:22:13 GMT",
"Server": "Kestrel",
"x-ms-maa-service-version": "1.11.02043.302"
},
"ResponseBody": {
"response_types_supported": [
"token",
"none"
],
"id_token_signing_alg_values_supported": [
"RS256"
],
"revocation_endpoint": "https://fakeresource.wus.attest.azure.net/revoke",
"issuer": "https://fakeresource.wus.attest.azure.net",
"jwks_uri": "https://fakeresource.wus.attest.azure.net/certs",
"claims_supported": [
"cnf",
"nonce",
"x-ms-ver",
"x-ms-attestation-type",
"x-ms-policy-hash",
"x-ms-policy-signer",
"x-ms-sgx-is-debuggable",
"x-ms-sgx-mrenclave",
"x-ms-sgx-mrsigner",
"x-ms-sgx-svn",
"x-ms-sgx-ehd",
"x-ms-sgx-collateral",
"is-debuggable",
"sgx-mrsigner",
"sgx-mrenclave",
"product-id",
"svn",
"tee"
]
}
}
],
"Variables": {}
}
Loading