EMRY-061: API token auth + TLS for the web dashboard #113
No reviewers
Labels
No labels
blocked
bug
compat
docs
documentation
duplicate
emry-cli
emry-core
emry-engine
emry-ingest
emry-py
emry-store
emry-tui
emry-web
enhancement
good first issue
gpu-compute
help wanted
hpc
infra
integrations
invalid
needs-design
P0-blocker
P1-core
P2-enhanced
P3-future
performance
pull-request
python
pytorch
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
femboy/emry!113
Loading…
Reference in a new issue
No description provided.
Delete branch "emry-061-web-auth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Opt-in transport security for
emry web, off by default (loopback, plain HTTP, no auth — existing behavior is unchanged).--auth-token <TOK>(orEMRY_AUTH_TOKEN)Authorization: Bearer <TOK>on every route except/healthz. The WebSocket (which can't set headers) accepts?token=<TOK>. Constant-time comparison.--tls-cert <PEM>/--tls-key <PEM>--host <IP>127.0.0.1); use0.0.0.0to expose the dashboard, e.g. in a container.How
New
emry-webmodulesecurity.rs:WebSecurity { token, tls }/TlsConfig { cert, key }(default = fully open plain HTTP)./healthzalways open) and a singleserve_routerthat applies the token layer and chooses TLS vs plain.serve_with_labels/serve_with_baseline/serve_projectnow take aWebSecurity; the CLI builds one from the flags (with theEMRY_AUTH_TOKENenv fallback, empty string treated as unset).The
--hostflag also fixes that the dashboard was previously hardcoded to127.0.0.1, which is needed for the Helm chart (k8s probes/Service hit the pod IP).Tests
?token=query accepted;/healthzopen without a token; no token configured ⇒ open.presented_tokenheader-vs-query precedence; constant-timect_eq.--host/--auth-token/--tls-*parse;--tls-certwithout--tls-keyrejected;web_securityenv fallback + TLS pairing.Coverage 90.38% (gate 90%). README gains a "securing the dashboard" note.
Closes #42