Skip to content

feat(auth): support first-party device login - #120

Draft
danew wants to merge 2 commits into
mainfrom
dane/ste-3049-device-auth-minimal
Draft

danew wants to merge 2 commits into
mainfrom
dane/ste-3049-device-auth-minimal

Conversation

@danew

@danew danew commented Oct 22, 2026

Copy link
Copy Markdown

Summary

Add the first-party steel-cli device grant to the existing native CLI:

  • Resumable browser approval with bounded non-interactive polling; no localhost callback.

  • Private, atomic credential state, process-serialized refresh rotation, interrupted-refresh replay protection, and revocation on logout.

  • Shared Bearer authorization while preserving existing API-key automation and its Steel-Api-Key header.

  • Production defaults with independent environment overrides:

    Setting Default
    STEEL_AUTH_ISSUER https://auth.steel.dev
    STEEL_AUTH_AUDIENCE https://api.steel.dev
    STEEL_API_URL https://api.steel.dev/v1

STEEL_CONFIG_DIR isolates test profiles. Saved credentials cannot silently move to another issuer/audience/transport. Session-scoped connection credentials remain separate from product access tokens.

Scope

Most existing command changes are mechanical credential adaptations at shared/raw HTTP, multipart, daemon, and WebSocket call sites. Init only returns while authorization is pending instead of continuing as authenticated. Existing installer, skill installation/catalog behavior, setup orchestration and telemetry design are unchanged.

Includes the small CDP URL normalization required by token-only session URLs: root query URLs must generate GET /?..., not GET ?.... Connection credentials are redacted from display. No hostname override or startup-retry policy is added.

No evaluation tooling, transcripts, private environment configuration, account/session data, dependency changes, MCP enablement or signup provisioning is included. Prompt/skill steering is separate work.

Verification

  • cargo test --all-targets passed (offline fixtures; existing ignored tests remain ignored).
  • Focused device tests cover production defaults/independent overrides, saved pending continuation, refresh single-flight/rotation, uncertain-refresh non-replay, private state, revocation and backoff/expiry.
  • Native binary integration covers Bearer API calls, token-only CDP request-target serialization and explicit session release.
  • Formatting and diff whitespace checks passed.
  • cargo clippy --all-targets -- -D warnings -A clippy::cognitive_complexity passed. Unmodified large command-dispatch functions still trigger that lint under fully strict Clippy; no unrelated refactor is included.

Review / rollout

Draft for scoped API/credential-lifecycle review. This replacement branch has not yet had a fresh live end-to-end validation; automated fixtures are not a production or cross-client readiness claim. Verify service/client registration and run the isolated candidate evaluation before release. A stable native CLI release is needed before the public installer distributes this behavior. This PR does not merge, release or deploy anything.

@danew
danew requested a review from junhsss October 22, 2026 02:46
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