Skip to content

cli: Add WorkOS auth service models and expand dependency baseline#8

Merged
davidabram merged 18 commits intomainfrom
auth-workos
Mar 11, 2026
Merged

cli: Add WorkOS auth service models and expand dependency baseline#8
davidabram merged 18 commits intomainfrom
auth-workos

Conversation

@davidabram
Copy link
Member

No description provided.

Add secure file-based token storage with cross-platform path resolution,
  JSON serialization, and restrictive file permissions
Add complete OAuth 2.0 Device Authorization Flow (RFC 8628) runtime
Add `ensure_valid_token` to check token expiry and refresh expired
 access tokens via `/oauth/token` using `grant_type=refresh_token`.

Include skew-guarded expiry evaluation, retry-wrapped refresh calls,
 and terminal OAuth error mapping with actionable "Try:" guidance.
Pure formatting change with no behavioral impact.

Wraps lines exceeding style guide limits.
Add Auth command to clap schema with AuthSubcommand enum containing
  Login, Logout, and Status variants.
Add auth command parsing and dispatch
Move token deletion logic from auth_command into token_storage module,
  adding a public delete_tokens() function that returns true if a file
  was deleted, false if missing, and TokenStorageError on I/O failures.
Extend the config service to support auth-adjacent keys with deterministic
  env-over-config precedence. Implements workos_client_id as the first key.
Implement a generalized auth-config resolver supporting per-key
  precedence chains (env > config file > optional baked default).

Migrate workos_client_id to use the new resolver with fallback to
  client_sce_default.
Move IntegrationTempDir, CommandResult, and SetupIntegrationHarness
  utilities from setup_integration.rs into a new cli/tests/support/mod.rs.

Rename harness to BinaryIntegrationHarness and generalize visibility
  so config-precedence integration tests can reuse the same compiled-
  binary test infrastructure without duplication.
Add end-to-end tests validating the runtime configuration precedence
  (flags > env > config file > defaults) through compiled binary scenarios.
Add three integration tests verifying workos_client_id resolution
  through the precedence chain
Add flake app to run compiled-binary config precedence tests via
  nix run .#cli-config-precedence-integration-tests.
@davidabram davidabram merged commit 7333eeb into main Mar 11, 2026
6 checks passed
@davidabram davidabram deleted the auth-workos branch March 11, 2026 12:32
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