Skip to content

Show source-auth fields in the GUI only for sources that need them - #25

Merged
picaultj merged 1 commit into
mainfrom
feat/gui-source-auth
Aug 10, 2026
Merged

Show source-auth fields in the GUI only for sources that need them#25
picaultj merged 1 commit into
mainfrom
feat/gui-source-auth

Conversation

@picaultj

@picaultj picaultj commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

Adds authentication fields to the GUI only for sources that require them. OpenReview needs credentials (its anonymous note queries are challenge-gated — see #17), while ACL / EMNLP / NAACL / IJCAI / PSCC / DBLP are public and show nothing extra.

The list of fields is data-driven from the source registry, so the UI stays a thin presentation layer.

Changes

conflens/sources.py

  • openreview registry entry declares auth_fields: OPENREVIEW_TOKEN, or OPENREVIEW_USERNAME + OPENREVIEW_PASSWORD (each {env, label, secret, help}).
  • New auth_fields(source) helper → [] for public sources.
  • OpenReviewSource(auth=…): GUI-supplied creds (keyed by env-var name) are preferred over the environment; blank values fall back to env.
  • make_source(..., auth=…) threads them through (ignored by public sources).

conflens/pipeline.py

  • AnalysisConfig.source_auth (dict); run_analysis passes it to make_source.

conflens/app.py

  • Renders credential inputs only when the selected source declares auth_fields — rebuilt on source change, hidden for public sources. Password fields are masked, and a caption notes that a blank field falls back to its environment variable. Values are collected into source_auth for the run.

Behaviour

  • Pick OpenReview → token / username / password fields appear.
  • Pick ACL / EMNLP / IJCAI / … → no extra fields (unchanged UI).
  • Env vars still work; a value typed in the GUI overrides the env for that run.

Testing

  • ruff clean · pytest 73 passed (6 new): constructor/make_source auth, GUI-over-env precedence, blank→env fallback, and that only OpenReview exposes fields.
  • NiceGUI boots → HTTP 200 with the dynamic auth container.

Note

Docs for OpenReview auth wording are handled separately in #24; I kept this PR to code + tests to avoid overlapping edits. Once both land, the OpenReview note can mention the in-GUI fields too.

OpenReview requires credentials (its anonymous note queries are challenge-gated),
while ACL / EMNLP / NAACL / IJCAI / PSCC / DBLP are public. Surface credential
inputs in the GUI conditionally, driven by the source registry:

- sources.py: declare `auth_fields` on the openreview registry entry (token, or
  username + password, keyed by env-var name) and add an `auth_fields(source)`
  helper. OpenReviewSource takes an optional `auth` dict and prefers it over the
  environment (empty fields fall back to env). make_source threads `auth` through.
- pipeline.py: AnalysisConfig gains `source_auth`; run_analysis passes it to
  make_source.
- app.py: render credential inputs only when the selected source declares
  auth_fields (rebuilt on source change; hidden for public sources), and collect
  them into the run config. Password fields are masked; a caption notes blank
  fields fall back to the matching environment variable.

Tests: auth threading (constructor/make_source, GUI-over-env precedence, blank →
env fallback) and that only OpenReview exposes auth fields.
@picaultj
picaultj merged commit 0abf79a into main Aug 10, 2026
3 of 4 checks passed
@picaultj
picaultj deleted the feat/gui-source-auth branch August 10, 2026 07:59
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