Skip to content

feature/SOF-8066 Fix: support API token auth for /users/me (list_accounts in JupyterLite) - #47

Merged
VsevolodX merged 1 commit into
mainfrom
fix/users-me-api-token-auth
Oct 7, 2026
Merged

VsevolodX merged 1 commit into
mainfrom
fix/users-me-api-token-auth

Conversation

@VsevolodX

Copy link
Copy Markdown
Member

Problem

With ACCOUNT_ID + AUTH_TOKEN auth (JupyterLite inside the web app), client.list_accounts() raised ValueError: Access token is required to fetch user data.

Changes

  • AuthContext.get_headers(): the single place that chooses the bearer header (OIDC) or the X-Account-Id/X-Auth-Token pair.
  • BaseEndpoint: removed _get_bearer_headers and the header rewriting in request(). get_headers() delegates to AuthContext. Endpoint constructors are unchanged.
  • APIClient._fetch_data: uses self.auth.get_headers().
  • Tests: new parametrized test_auth_context.py. test_list_accounts covers both auth types.

Behavior note: an OIDC_ACCESS_TOKEN set in the environment after authenticate() is no longer picked up by _fetch_data.

Requires the server counterpart: https://github.com/mat3ra/web-app/pull/2979

Verification

40 unit tests pass, ruff clean.

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@VsevolodX VsevolodX changed the title Fix: support API token auth for /users/me (list_accounts in JupyterLite) feature/SOF-8066 Fix: support API token auth for /users/me (list_accounts in JupyterLite) Oct 7, 2026
@VsevolodX
VsevolodX merged commit e237d4d into main Oct 7, 2026
3 checks passed
@VsevolodX
VsevolodX deleted the fix/users-me-api-token-auth branch October 7, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants