Skip to content

Commit 21faf0a

Browse files
committed
thanks, Bryan
1 parent 9aaf36b commit 21faf0a

5 files changed

Lines changed: 22 additions & 17 deletions

File tree

sdk/identity/azure-identity/HISTORY.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Unreleased
2+
3+
- All credential pipelines include `ProxyPolicy`
4+
([#8945](https://github.com/Azure/azure-sdk-for-python/pull/8945))
5+
6+
17
# 2019-11-27 1.1.0
28

39
- Constructing `DefaultAzureCredential` no longer raises `ImportError` on Python

sdk/identity/azure-identity/tests/test_auth_code.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@
1717
def test_policies_configurable():
1818
policy = Mock(spec_set=SansIOHTTPPolicy, on_request=Mock())
1919

20+
def send(*_, **__):
21+
return mock_response(json_payload=build_aad_response(access_token="**"))
22+
2023
credential = AuthorizationCodeCredential(
21-
"tenant-id",
22-
"client-id",
23-
"auth-code",
24-
"http://localhost",
25-
policies=[policy],
26-
transport=Mock(send=lambda *_, **__: mock_response(json_payload=build_aad_response(access_token="**"))),
24+
"tenant-id", "client-id", "auth-code", "http://localhost", policies=[policy], transport=Mock(send=send)
2725
)
2826

2927
credential.get_token("scope")

sdk/identity/azure-identity/tests/test_certificate_credential.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@
2121
def test_policies_configurable():
2222
policy = Mock(spec_set=SansIOHTTPPolicy, on_request=Mock())
2323

24+
def send(*_, **__):
25+
return mock_response(json_payload=build_aad_response(access_token="**"))
26+
2427
credential = CertificateCredential(
25-
"tenant-id",
26-
"client-id",
27-
CERT_PATH,
28-
policies=[ContentDecodePolicy(), policy],
29-
transport=Mock(send=lambda *_, **__: mock_response(json_payload=build_aad_response(access_token="**"))),
28+
"tenant-id", "client-id", CERT_PATH, policies=[ContentDecodePolicy(), policy], transport=Mock(send=send)
3029
)
3130

3231
credential.get_token("scope")

sdk/identity/azure-identity/tests/test_client_secret_credential.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
def test_policies_configurable():
1919
policy = Mock(spec_set=SansIOHTTPPolicy, on_request=Mock())
2020

21+
def send(*_, **__):
22+
return mock_response(json_payload=build_aad_response(access_token="**"))
23+
2124
credential = ClientSecretCredential(
22-
"tenant-id",
23-
"client-id",
24-
"client-secret",
25-
policies=[ContentDecodePolicy(), policy],
26-
transport=Mock(send=lambda *_, **__: mock_response(json_payload=build_aad_response(access_token="**"))),
25+
"tenant-id", "client-id", "client-secret", policies=[ContentDecodePolicy(), policy], transport=Mock(send=send)
2726
)
2827

2928
credential.get_token("scope")

sdk/identity/azure-identity/tests/test_shared_cache_credential.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@
2626
def test_policies_configurable():
2727
policy = Mock(spec_set=SansIOHTTPPolicy, on_request=Mock())
2828

29+
def send(*_, **__):
30+
return mock_response(json_payload=build_aad_response(access_token="**"))
31+
2932
credential = SharedTokenCacheCredential(
3033
_cache=populated_cache(get_account_event("test@user", "uid", "utid")),
3134
policies=[policy],
32-
transport=Mock(send=lambda *_, **__: mock_response(json_payload=build_aad_response(access_token="**"))),
35+
transport=Mock(send=send),
3336
)
3437

3538
credential.get_token("scope")

0 commit comments

Comments
 (0)