Skip to content

Commit 58becac

Browse files
fix: include updates to properties from Google Auth lib (#249)
* Include updates to properties from Google Auth lib * test for scopes * updating real deps
1 parent dfaa869 commit 58becac

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

google_auth_oauthlib/helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ def credentials_from_session(session, client_config=None):
133133
token_url=client_config.get("token_uri"),
134134
client_id=client_config.get("client_id"),
135135
client_secret=client_config.get("client_secret"),
136+
token_info_url=client_config.get("token_info_url"),
137+
scopes=session.scope,
136138
)
137139
else:
138140
credentials = google.oauth2.credentials.Credentials(

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
TOOL_DEPENDENCIES = "click>=6.0.0"
2222

23-
DEPENDENCIES = ("google-auth>=2.13.0", "requests-oauthlib>=0.7.0")
23+
DEPENDENCIES = ("google-auth>=2.14.0", "requests-oauthlib>=0.7.0")
2424

2525

2626
with io.open("README.rst", "r") as fh:

testing/constraints-3.6.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
#
66
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
77
# Then this file should have foo==1.14.0
8-
google-auth==2.13.0
8+
google-auth==2.14.0
99
requests-oauthlib==0.7.0
1010
click==6.0.0

testing/constraints-3.7.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
#
66
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
77
# Then this file should have foo==1.14.0
8-
google-auth==2.13.0
8+
google-auth==2.14.0
99
requests-oauthlib==0.7.0
1010
click==6.0.0

tests/unit/test_helpers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def test_credentials_from_session(session):
9595
assert credentials._client_id == CLIENT_SECRETS_INFO["web"]["client_id"]
9696
assert credentials._client_secret == CLIENT_SECRETS_INFO["web"]["client_secret"]
9797
assert credentials._token_uri == CLIENT_SECRETS_INFO["web"]["token_uri"]
98+
assert credentials.scopes == session.scope
9899

99100

100101
def test_credentials_from_session_3pi(session):
@@ -107,6 +108,9 @@ def test_credentials_from_session_3pi(session):
107108

108109
client_secrets_info = CLIENT_SECRETS_INFO["web"].copy()
109110
client_secrets_info["3pi"] = True
111+
client_secrets_info[
112+
"token_info_url"
113+
] = "https://accounts.google.com/o/oauth2/introspect"
110114
credentials = helpers.credentials_from_session(session, client_secrets_info)
111115

112116
assert isinstance(credentials, external_account_authorized_user.Credentials)
@@ -116,6 +120,10 @@ def test_credentials_from_session_3pi(session):
116120
assert credentials._client_id == CLIENT_SECRETS_INFO["web"]["client_id"]
117121
assert credentials._client_secret == CLIENT_SECRETS_INFO["web"]["client_secret"]
118122
assert credentials._token_url == CLIENT_SECRETS_INFO["web"]["token_uri"]
123+
assert (
124+
credentials._token_info_url == "https://accounts.google.com/o/oauth2/introspect"
125+
)
126+
assert credentials.scopes == session.scope
119127

120128

121129
def test_bad_credentials(session):

0 commit comments

Comments
 (0)