#31 [Feature]: Add OIDC workload login for CI
Originally created by: thomijasir
Originally owned by: thomijasir
Feature description
Allow a CI workload to exchange a trusted OIDC assertion for a short-lived Dopbase runtime credential.
Current behavior
CI jobs use long-lived runner tokens supplied through DOPBASE_TOKEN or --token.
Why we need this
Supported CI systems can issue signed workload assertions for each job. Exchanging those assertions removes the need to store a reusable Dopbase token in the CI secret store.
Proposed CLI interface
dopbase run ENVIRONMENT --oidc-token-file <FILE|-> -- commandDOPBASE_OIDC_TOKEN_FILE=/path/to/assertion dopbase run ENVIRONMENT -- command
Expected behavior
- Read the workload assertion from a private file or stdin, never from a command-line value.
- Exchange it with the active server for a short-lived credential scoped to the requested environment.
- Keep the exchanged credential in memory and never save it as a CLI session.
- Validate that the returned scope matches the resolved environment before fetching runtime secrets.
- Prefer an explicitly supplied runner token when both mechanisms are configured, and print a names-only warning about the ignored OIDC source.
- Return a non-interactive error when no usable assertion is available.
- Report credential expiry through sanitized debug output without printing either token.
Security and compatibility
- The server validates issuer, audience, signature, expiry, not-before time, replay identifiers, and configured claims.
- The exchanged credential has runtime-read permission only and a short fixed lifetime.
- Never write assertions or exchanged credentials to disk, cache metadata, output, or logs.
- Prevent a credential issued for one environment or server from being reused for another.
Out of scope
- Provider-specific browser login.
- Issuing write-capable workload credentials.
- Persisting OIDC credentials.
- Accepting unsigned or locally verified assertions without a server exchange.
Acceptance criteria
- [ ] A trusted workload can run a command without
DOPBASE_TOKEN. - [ ] Untrusted issuer, audience, claims, signature, replay, and expired assertions are rejected.
- [ ] The returned credential works only for its environment and lifetime.
- [ ] Assertions from stdin and private files work without prompts.
- [ ] No assertion or exchanged credential appears in process arguments, output, logs, or saved sessions.
- [ ] Existing runner-token flows remain compatible.
Test scenarios
- Add server exchange tests and CLI integration tests under
app/tests/cli/. - Cover trust policies, claim mapping, environment scope, expiry, replay, stdin, file permissions, source precedence, non-interactive behavior, cache key isolation, and redaction.
Documentation
Document trust configuration, CI examples, required claims, environment scope, credential lifetime, and migration from stored runner tokens.
Dependencies
Blocked on a server trust-policy model and OIDC exchange endpoint. The design must define supported issuers, audience rules, claim mapping, replay protection, and audit events.
Originally posted by: thomijasir
Closing as not planned. Runner tokens already give CI jobs and other machines a credential scoped to one environment, which can be revoked and set to expire, so exchanging workload OIDC assertions would add a second machine-auth path without enough benefit right now. Human single sign-on and browser CLI login are tracked in [#141].
Related
Tickets:
#141Ticket changed by: thomijasir