Skip to content

feat: add cdcx auth login browser-based OAuth#48

Open
troycdc wants to merge 1 commit into
mainfrom
feature/newport-beach
Open

feat: add cdcx auth login browser-based OAuth#48
troycdc wants to merge 1 commit into
mainfrom
feature/newport-beach

Conversation

@troycdc
Copy link
Copy Markdown
Collaborator

@troycdc troycdc commented May 25, 2026

Summary

  • Adds cdcx auth login command that opens browser for OAuth authentication against the Crypto.com Exchange broker API
  • Polls server for credentials after user completes authorization in browser, with ESC to cancel and 5-minute timeout
  • Stores received API key/secret in config with profile deduplication (overwrites existing profile if same api_key, otherwise creates account-{N})
  • Adds skip_serializing_if for empty envs in ProfileConfig to keep TOML clean

Changes

  • crates/cdcx-cli/src/groups/auth_login.rs — new module (implementation + 33 unit tests)
  • crates/cdcx-cli/Cargo.toml — add uuid, open, crossterm, reqwest deps
  • crates/cdcx-cli/src/cli_builder.rs — register login subcommand under auth
  • crates/cdcx-cli/src/main.rs — wire dispatch
  • crates/cdcx-core/src/config.rsskip_serializing_if = "HashMap::is_empty" on envs field

Test plan

  • cargo build compiles cleanly
  • cargo test -p cdcx-cli — 121 tests pass (33 new)
  • cargo clippy — no warnings
  • Manual test: cdcx auth login → select env → browser opens → complete OAuth → credentials stored
  • ESC cancellation works
  • Dedup: re-login with same account updates existing profile
  • Process exits cleanly after success

closes #49

🤖 Generated with Claude Code

Adds a new `auth login` subcommand that authenticates via browser OAuth
flow — opens the exchange broker authorization page, polls for credentials,
and stores them in the config file with deduplication support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​open@​5.3.59910093100100

View full report

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.

OAuth Flow for CLI API Key Setup

1 participant