Skip to content

Commit

Permalink
Log the error body from service token
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansick committed May 3, 2024
1 parent 0f284ac commit c40f8f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/noteburst/jupyterclient/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def create(
token_request_data = {
"username": username,
"name": "Noteburst",
"token_type": "user",
"token_type": "service",
"token_name": f"noteburst {float(time.time())!s}",
"scopes": scopes,
"expires": int(time.time() + lifetime),
Expand All @@ -115,6 +115,7 @@ async def create(
},
json=token_request_data,
)
print(r.json()) # noqa: T201
r.raise_for_status()
body = r.json()
return cls(
Expand Down
2 changes: 1 addition & 1 deletion tests/support/gafaelfawr.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def handler(request: httpx.Request) -> httpx.Response:
# so we can't check it here.
assert request_json == {
"username": ANY,
"token_type": "user",
"token_type": "service",
"token_name": ANY,
"scopes": ["exec:notebook"],
"expires": ANY,
Expand Down

0 comments on commit c40f8f1

Please sign in to comment.