Skip to content

Take the DANDI API key in the GUI - #567

Closed
pauladkisson wants to merge 2 commits into
mainfrom
dandi_key
Closed

pauladkisson wants to merge 2 commits into
mainfrom
dandi_key

Conversation

@pauladkisson

Copy link
Copy Markdown
Collaborator
Details (AI-generated)

Closes #566.

  • A DANDI API key field. A password field at the top of the DANDI panel. A pasted key is set as DANDI_API_KEY for the GuPPy process, so it applies to the rest of the session, and it is never written to disk.
  • A check before streaming. _stream_nwb calls the new require_dandi_api_key() (utils/dandi_auth.py), which looks for a key in DANDI_API_KEY and then the keyring dandi login writes to, the same places dandi checks. Without one it raises a ValueError naming the field, so dandi never reaches its input() prompt.
  • Label Stores shows the error. Its click handler now catches ValueError and shows a notification, as the other page-opening handlers already do. Step 2 already reports worker errors this way.
  • Docs. The analyze-dandi-data how-to now leads with the field, with dandi login or the environment variable as ways to skip pasting the key on each launch.

Searching, listing and previewing don't authenticate, so they still work without a key. I confirmed that a keyring lookup inside the container image from #560 returns nothing without prompting.

test_dandi_auth, test_dandi_file_panel, test_home, test_store_labeling and test_dandi_nwb_recording_extractor pass. In Playwright the field renders as a masked input above the DANDI search. I didn't run a full stream with a real key.

🤖 Generated with Claude Code

pauladkisson and others added 2 commits October 15, 2026 14:51
The DANDI panel gets a DANDI API key field; a pasted key is used for
the rest of the GuPPy session and is not saved. Before streaming, GuPPy
checks for a key in DANDI_API_KEY or the keyring and raises a
ValueError naming the field when there is none, so the dandi library
never falls back to its terminal prompt. Label Stores now surfaces such
errors as a notification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pauladkisson
pauladkisson marked this pull request as ready for review October 15, 2026 21:54
@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@pauladkisson

Copy link
Copy Markdown
Collaborator Author

Superseded by #568. Public dandisets stream without a key, so GuPPy no longer asks for one.

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.

Label Stores asks for a DANDI API key that public dandisets don't need

1 participant