Skip to content

Commit

Permalink
bug 1564442: Raise if an error occured getting a token. (#956)
Browse files Browse the repository at this point in the history
* Raise if an error occured getting a token.

* Version bump.
  • Loading branch information
bhearsum committed Jul 9, 2019
1 parent 56b0891 commit e053c9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/balrogclient/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def _get_auth0_token(secrets, session):
payload = dict(client_id=secrets["client_id"], client_secret=secrets["client_secret"], audience=secrets["audience"], grant_type="client_credentials")
headers = {"Content-Type": "application/json"}
request = session.post(url, data=json.dumps(payload), headers=headers)
request.raise_for_status()
response = request.json()
# In order to know exact expiration we would need to decode the token, what
# requires more dependencies. Instead we use the returned "expires_in" in
Expand Down
2 changes: 1 addition & 1 deletion client/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="balrogclient",
version="0.5.0",
version="0.6.0",
description="Balrog Admin API Client",
author="Mozilla Release Engineers",
author_email="release+python@mozilla.com",
Expand Down

0 comments on commit e053c9a

Please sign in to comment.