Skip to content

Commit

Permalink
Switch to creating Gafaelfawr service tokens
Browse files Browse the repository at this point in the history
Create Gafaelfawr service tokens instead of user tokens for
authenticated calls to JupyterHub and JupyterLab. Gafaelfawr
is standardizing on the new service token type for all
service-to-service authentication.
  • Loading branch information
rra committed May 1, 2024
1 parent 8ca7b85 commit 483836e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.d/20240501_080604_rra_DM_44136.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### New features

- Create Gafaelfawr service tokens instead of user tokens for authenticated calls to JupyterHub and JupyterLab. Gafaelfawr is standardizing on the new service token type for all service-to-service authentication.
2 changes: 1 addition & 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 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 483836e

Please sign in to comment.