From c40f8f12beb5dd371c59ba309e93de54e72f7f43 Mon Sep 17 00:00:00 2001 From: Jonathan Sick Date: Fri, 3 May 2024 18:11:34 -0400 Subject: [PATCH] Log the error body from service token --- src/noteburst/jupyterclient/user.py | 3 ++- tests/support/gafaelfawr.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/noteburst/jupyterclient/user.py b/src/noteburst/jupyterclient/user.py index 03a4bd7..e349087 100644 --- a/src/noteburst/jupyterclient/user.py +++ b/src/noteburst/jupyterclient/user.py @@ -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), @@ -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( diff --git a/tests/support/gafaelfawr.py b/tests/support/gafaelfawr.py index d7b4ced..2a31b17 100644 --- a/tests/support/gafaelfawr.py +++ b/tests/support/gafaelfawr.py @@ -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,