Skip to content

Commit 6b86c64

Browse files
committed
Bump oauth2-client to v1.4.0
- Adopt tests to not check authorization header
1 parent 902934f commit 6b86c64

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
aiohttp>=3.8.0
22
protobuf>=3.20.0, < 5.0.0dev
3-
oauth2-client==1.2.1
3+
oauth2-client==1.4.0
44
websocket-client~=1.3.1
55
PyYAML==6.0
66
requests>=2.5.0

test/test_client.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,15 @@ def test_grant_password_request_with_token_format_opaque(self):
6060
self.assertEqual("Bearer access-token", session.headers.get("Authorization"))
6161
requests.post.assert_called_with(
6262
requests.post.return_value.url,
63-
data=dict(grant_type="password", username="somebody", scope="", password="p@s$w0rd", token_format="opaque"),
64-
headers=dict(Accept="application/json", Authorization="Basic Y2Y6"),
63+
data=dict(
64+
grant_type="password",
65+
username="somebody",
66+
scope="",
67+
password="p@s$w0rd",
68+
token_format="opaque",
69+
client_id="cf",
70+
),
71+
headers=dict(Accept="application/json"),
6572
proxies=dict(http="", https=""),
6673
verify=True,
6774
)
@@ -84,8 +91,10 @@ def test_refresh_request_with_token_format_opaque(self):
8491
self.assertEqual("Bearer access-token", session.headers.get("Authorization"))
8592
requests.post.assert_called_with(
8693
requests.post.return_value.url,
87-
data=dict(grant_type="refresh_token", scope="", refresh_token="refresh-token", token_format="opaque"),
88-
headers=dict(Accept="application/json", Authorization="Basic Y2Y6"),
94+
data=dict(
95+
grant_type="refresh_token", scope="", refresh_token="refresh-token", token_format="opaque", client_id="cf"
96+
),
97+
headers=dict(Accept="application/json"),
8998
proxies=dict(http="", https=""),
9099
verify=True,
91100
)
@@ -112,8 +121,8 @@ def test_refresh_request_with_token_from_cf_config(self):
112121
self.assertEqual("Bearer access-token", session.headers.get("Authorization"))
113122
requests.post.assert_called_with(
114123
requests.post.return_value.url,
115-
data=dict(grant_type="refresh_token", scope="", refresh_token="refresh-token"),
116-
headers=dict(Accept="application/json", Authorization="Basic Y2Y6"),
124+
data=dict(grant_type="refresh_token", scope="", refresh_token="refresh-token", client_id="cf"),
125+
headers=dict(Accept="application/json"),
117126
proxies=proxy,
118127
verify=True,
119128
)
@@ -144,8 +153,9 @@ def test_grant_password_request_with_login_hint(self):
144153
scope="",
145154
password="p@s$w0rd",
146155
login_hint="%7B%22origin%22%3A%22uaa%22%7D",
156+
client_id="cf",
147157
),
148-
headers=dict(Accept="application/json", Authorization="Basic Y2Y6"),
158+
headers=dict(Accept="application/json"),
149159
proxies=dict(http="", https=""),
150160
verify=True,
151161
)

0 commit comments

Comments
 (0)