Skip to content

Account page: use MIP from your own computer - #51

Merged
KFilippopolitis merged 5 commits into
masterfrom
feat/remote-api-token
Oct 19, 2026
Merged

KFilippopolitis merged 5 commits into
masterfrom
feat/remote-api-token

Conversation

@KFilippopolitis

@KFilippopolitis KFilippopolitis commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Adds a "Use MIP from your own computer" section to the account page, shown only when the notebook is enabled. It walks the user through:

  1. Create API token: opens JupyterHub's own token page (<jupyter context>/hub/token) in a new tab, with the instruction to enter custom:mip-platform-token in Permissions and choose an expiry (JupyterHub limits it to 30 days by default);
  2. a copyable setup snippet: pip install mip-client, export MIP_URL=<this portal>, mip login. mip login asks for the token without showing it and saves it to a file readable only by the user, so the token stays out of the shell history and out of the environment that every program, AI assistants included, can read. A note gives the PowerShell form of MIP_URL.

The portal never requests, stores or shows a token: the token is created on JupyterHub's page.

Part of the remote-access work; the token permission and client support are in the related mip-jupyter PR.

How it was tested

  • Unit tests for the account page (ng test --include src/app/pages/account-page/account-page.component.spec.ts): 5 pass.
  • On federation-handson, before the mip login change: the section renders, the token page is reachable through nginx (top-level /notebook/hub/token is proxied to the hub, not swallowed by the iframe redirects), and a token created there works from a laptop.

Deployment notes

  • The snippet needs the mip-client release from the related mip-jupyter PR (it adds mip login).

Related PRs

KFilippopolitis and others added 2 commits October 16, 2026 12:37
Shown when the notebook is enabled. Links to the Notebook page so Hub keeps
the sign-in, opens Hub's /hub/token page in a new tab to create a personal
API token, and offers a copyable MIP_URL/MIP_API_TOKEN setup snippet. The UI
never requests, stores or shows the token itself.

Co-Authored-By: Claude <noreply@anthropic.com>
await fixture.whenStable();

expect(writeText).toHaveBeenCalledWith(
`pip install mip-client\nexport MIP_URL=${window.location.origin}\nexport MIP_API_TOKEN=<paste your token here>`,
KFilippopolitis and others added 3 commits October 19, 2026 11:23
Quote the MIP_API_TOKEN placeholder so pasting it unedited is not parsed as a
redirection, say Python must run in the same terminal as the exports, give the
copy button and the new-tab token link screen-reader labels, and test the
clipboard failure message.

Co-Authored-By: Claude <noreply@anthropic.com>
Opening the Notebook page starts a notebook server just to save the sign-in,
and the Hub token page already signs the user in through Keycloak, so that
step is gone. Add the PowerShell form of the exports, clear the copy status
so a repeated copy is announced again, and style the token link as the
primary action per DESIGN.md.

Co-Authored-By: Claude <noreply@anthropic.com>
…ing the token

The setup snippet put the API token in an environment variable, where it
lands in the shell history and every program started from that terminal,
AI assistants included, can read it. `mip login` asks for it without
echoing and saves it to a file readable only by the user.
@KFilippopolitis
KFilippopolitis merged commit 526672e into master Oct 19, 2026
0 of 10 checks passed
@KFilippopolitis
KFilippopolitis deleted the feat/remote-api-token branch October 19, 2026 11:11
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