Skip to content

UID2-6717: Add /ops/operator_key_check endpoint for pre-startup validation#383

Closed
sunnywu wants to merge 2 commits intomainfrom
swu-UID2-6717-operator-key-pre-startup-validation
Closed

UID2-6717: Add /ops/operator_key_check endpoint for pre-startup validation#383
sunnywu wants to merge 2 commits intomainfrom
swu-UID2-6717-operator-key-pre-startup-validation

Conversation

@sunnywu
Copy link
Copy Markdown
Contributor

@sunnywu sunnywu commented Apr 1, 2026

Summary

  • Adds GET /ops/operator_key_check to uid2-core — a lightweight endpoint that authenticates the operator Bearer token (requires Role.OPERATOR) without needing a full attestation payload
  • Registers the route in CoreVerticle alongside /ops/healthcheck, without the attestation middleware
  • Supports the companion change in uid2-operator (IABTechLab/uid2-operator) that calls this endpoint before starting the enclave, enabling fast-fail on misconfigured operator keys

Jira: UID2-6717

Why

Currently, an invalid core_api_token is only discovered during the first attestation call — which happens asynchronously after the enclave has started. The operator then waits up to 12 hours before shutting down, with no actionable error message. This change provides a dedicated, low-cost endpoint that the operator can call synchronously at startup to validate its key before proceeding.

Deployment note: Deploy uid2-core (this PR) before the companion uid2-operator PR. The operator handles a 404 from this endpoint gracefully (logs a warning, continues) for backward compatibility during rolling deploys.

Test plan

  • CoreVerticleTest#operatorKeyCheckReturns200ForValidOperatorKey — valid OPERATOR key → 200
  • CoreVerticleTest#operatorKeyCheckReturns401ForUnknownKey — unknown/missing key → 401
  • Full CoreVerticleTest suite passes (100 tests, 0 failures)

🤖 Generated with Claude Code

sunnywu and others added 2 commits February 25, 2026 16:03
Add explicit gnutls upgrade in Dockerfile to address HIGH severity
vulnerability CVE-2026-1584 in gnutls 3.8.11-r0 (fixed in 3.8.12-r0)
in the alpine base image. The vulnerability allows Remote Denial of
Service via crafted ClientHello with invalid PSK.

Jira: UID2-6655

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…alidation

Adds a lightweight GET /ops/operator_key_check endpoint to uid2-core that
validates an operator's Bearer token (Role.OPERATOR) without requiring a full
attestation payload. This supports the operator's pre-startup key validation
check, enabling fast-fail with a clear error message when core_api_token is
misconfigured rather than discovering the failure 12 hours into attestation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sunnywu sunnywu closed this Apr 1, 2026
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.

1 participant