Skip to content

Commit 5970b73

Browse files
authored
Merge pull request #192 from cloudfoundry-community/fixes/crashed-login
Use new version of oauth client
2 parents 693707d + 6e0e8b6 commit 5970b73

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
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.4.0
3+
oauth2-client==1.4.2
44
websocket-client~=1.5.1
55
PyYAML==6.0
66
requests>=2.5.0

test/test_client.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,8 @@ 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(
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"),
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"),
7265
proxies=dict(http="", https=""),
7366
verify=True,
7467
)
@@ -91,10 +84,8 @@ def test_refresh_request_with_token_format_opaque(self):
9184
self.assertEqual("Bearer access-token", session.headers.get("Authorization"))
9285
requests.post.assert_called_with(
9386
requests.post.return_value.url,
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"),
87+
data=dict(grant_type="refresh_token", scope="", refresh_token="refresh-token", token_format="opaque"),
88+
headers=dict(Accept="application/json", Authorization="Basic Y2Y6"),
9889
proxies=dict(http="", https=""),
9990
verify=True,
10091
)
@@ -121,8 +112,8 @@ def test_refresh_request_with_token_from_cf_config(self):
121112
self.assertEqual("Bearer access-token", session.headers.get("Authorization"))
122113
requests.post.assert_called_with(
123114
requests.post.return_value.url,
124-
data=dict(grant_type="refresh_token", scope="", refresh_token="refresh-token", client_id="cf"),
125-
headers=dict(Accept="application/json"),
115+
data=dict(grant_type="refresh_token", scope="", refresh_token="refresh-token"),
116+
headers=dict(Accept="application/json", Authorization="Basic Y2Y6"),
126117
proxies=proxy,
127118
verify=True,
128119
)
@@ -153,9 +144,8 @@ def test_grant_password_request_with_login_hint(self):
153144
scope="",
154145
password="p@s$w0rd",
155146
login_hint="%7B%22origin%22%3A%22uaa%22%7D",
156-
client_id="cf",
157147
),
158-
headers=dict(Accept="application/json"),
148+
headers=dict(Accept="application/json", Authorization="Basic Y2Y6"),
159149
proxies=dict(http="", https=""),
160150
verify=True,
161151
)

0 commit comments

Comments
 (0)