Show source-auth fields in the GUI only for sources that need them - #25
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pyopenreviewregistry entry declaresauth_fields:OPENREVIEW_TOKEN, orOPENREVIEW_USERNAME+OPENREVIEW_PASSWORD(each{env, label, secret, help}).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.pyAnalysisConfig.source_auth(dict);run_analysispasses it tomake_source.conflens/app.pyauth_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 intosource_authfor the run.Behaviour
Testing
ruffclean ·pytest73 passed (6 new): constructor/make_sourceauth, GUI-over-env precedence, blank→env fallback, and that only OpenReview exposes fields.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.