From de4d69b513f6766e93ee2ca2e336954e8d343eaf Mon Sep 17 00:00:00 2001 From: "Jiefeng Chen (WICRESOFT NORTH AMERICA LTD)" Date: Thu, 29 Sep 2022 14:23:20 +0800 Subject: [PATCH] delete --- ...Securitytest_security_operations_list.json | 247 ------------------ .../tests/test_mgmt_security_applications.py | 58 ++-- sdk/security/ci.yml | 1 - 3 files changed, 29 insertions(+), 277 deletions(-) delete mode 100644 sdk/security/azure-mgmt-security/tests/recordings/test_mgmt_security_applications.pyTestMgmtSecuritytest_security_operations_list.json diff --git a/sdk/security/azure-mgmt-security/tests/recordings/test_mgmt_security_applications.pyTestMgmtSecuritytest_security_operations_list.json b/sdk/security/azure-mgmt-security/tests/recordings/test_mgmt_security_applications.pyTestMgmtSecuritytest_security_operations_list.json deleted file mode 100644 index 8b7a705faec6..000000000000 --- a/sdk/security/azure-mgmt-security/tests/recordings/test_mgmt_security_applications.pyTestMgmtSecuritytest_security_operations_list.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0/.well-known/openid-configuration", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "*/*", - "Accept-Encoding": "gzip, deflate", - "Connection": "keep-alive", - "User-Agent": "azsdk-python-identity/1.11.0b4 Python/3.8.10 (Windows-10-10.0.22000-SP0)" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Access-Control-Allow-Methods": "GET, OPTIONS", - "Access-Control-Allow-Origin": "*", - "Cache-Control": "max-age=86400, private", - "Content-Length": "1753", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 07:28:15 GMT", - "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", - "Set-Cookie": "[set-cookie;]", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-ests-server": "2.1.13672.11 - SEASLR1 ProdSlices", - "X-XSS-Protection": "0" - }, - "ResponseBody": { - "token_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token", - "token_endpoint_auth_methods_supported": [ - "client_secret_post", - "private_key_jwt", - "client_secret_basic" - ], - "jwks_uri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/v2.0", - "request_uri_parameter_supported": false, - "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", - "authorization_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/authorize", - "device_authorization_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/devicecode", - "http_logout_supported": true, - "frontchannel_logout_supported": true, - "end_session_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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": "cookie;", - "User-Agent": "azsdk-python-identity/1.11.0b4 Python/3.8.10 (Windows-10-10.0.22000-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": "Wed, 28 Sep 2022 07:28:15 GMT", - "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", - "Set-Cookie": "[set-cookie;]", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-ests-server": "2.1.13672.11 - 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/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip, deflate", - "client-request-id": "2431974b-a616-4e2d-825d-9b4b69ec0c61", - "Connection": "keep-alive", - "Content-Length": "288", - "Content-Type": "application/x-www-form-urlencoded", - "Cookie": "cookie;", - "User-Agent": "azsdk-python-identity/1.11.0b4 Python/3.8.10 (Windows-10-10.0.22000-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=00000000-0000-0000-0000-000000000000\u0026grant_type=client_credentials\u0026client_info=1\u0026client_secret=00000000-0000-0000-0000-000000000000\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", - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-store, no-cache", - "client-request-id": "2431974b-a616-4e2d-825d-9b4b69ec0c61", - "Content-Length": "114", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 07:28:15 GMT", - "Expires": "-1", - "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", - "Pragma": "no-cache", - "Set-Cookie": "[set-cookie;]", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-clitelem": "1,0,0,,", - "x-ms-ests-server": "2.1.13672.11 - KRC ProdSlices", - "X-XSS-Protection": "0" - }, - "ResponseBody": { - "token_type": "Bearer", - "expires_in": 86399, - "ext_expires_in": 86399, - "refresh_in": 43199, - "access_token": "access_token" - } - }, - { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Security/applications?api-version=2022-07-01-preview", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip, deflate", - "Connection": "keep-alive", - "User-Agent": "azsdk-python-mgmt-security/2.0.0 Python/3.8.10 (Windows-10-10.0.22000-SP0)" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Encoding": "gzip", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 28 Sep 2022 07:28:21 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "Transfer-Encoding": "chunked", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "14ea8e4c-cc8c-4e99-81fc-0c4647fc5fe5", - "x-ms-ratelimit-remaining-subscription-resource-requests": "749", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220928T072821Z:14ea8e4c-cc8c-4e99-81fc-0c4647fc5fe5" - }, - "ResponseBody": { - "value": [] - } - } - ], - "Variables": {} -} diff --git a/sdk/security/azure-mgmt-security/tests/test_mgmt_security_applications.py b/sdk/security/azure-mgmt-security/tests/test_mgmt_security_applications.py index ea7e4c51b999..8cf964cd09af 100644 --- a/sdk/security/azure-mgmt-security/tests/test_mgmt_security_applications.py +++ b/sdk/security/azure-mgmt-security/tests/test_mgmt_security_applications.py @@ -1,29 +1,29 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -from contextlib import suppress - -import pytest - -from azure.mgmt.security.v2022_07_01_preview import SecurityCenter -import azure.mgmt.security.models -from azure.core.exceptions import HttpResponseError -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -class TestMgmtSecurity(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.mgmt_client = self.create_mgmt_client(SecurityCenter) - - @recorded_by_proxy - def test_security_operations_list(self): - # it proves that we can normally send request but maybe needs additional parameters - with suppress(HttpResponseError): - result = self.mgmt_client.applications.list() - assert list(result) is not None \ No newline at end of file +# # coding: utf-8 +# +# # ------------------------------------------------------------------------- +# # Copyright (c) Microsoft Corporation. All rights reserved. +# # Licensed under the MIT License. See License.txt in the project root for +# # license information. +# # -------------------------------------------------------------------------- +# from contextlib import suppress +# +# import pytest +# +# from azure.mgmt.security.v2022_07_01_preview import SecurityCenter +# import azure.mgmt.security.models +# from azure.core.exceptions import HttpResponseError +# from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy +# +# AZURE_LOCATION = "eastus" +# +# +# class TestMgmtSecurity(AzureMgmtRecordedTestCase): +# def setup_method(self, method): +# self.mgmt_client = self.create_mgmt_client(SecurityCenter) +# +# @recorded_by_proxy +# def test_security_operations_list(self): +# # it proves that we can normally send request but maybe needs additional parameters +# with suppress(HttpResponseError): +# result = self.mgmt_client.applications.list() +# assert list(result) is not None \ No newline at end of file diff --git a/sdk/security/ci.yml b/sdk/security/ci.yml index 96961985982c..91c6c3cd25d0 100644 --- a/sdk/security/ci.yml +++ b/sdk/security/ci.yml @@ -25,7 +25,6 @@ pr: extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml - TestProxy: true parameters: ServiceDirectory: security Artifacts: