Skip to content

Add browser-based auth flow#20

Merged
itssimon merged 5 commits into
mainfrom
dev-103-implement-a-browser-based-auth-flow-to-create-and-store-an
Apr 15, 2026
Merged

Add browser-based auth flow#20
itssimon merged 5 commits into
mainfrom
dev-103-implement-a-browser-based-auth-flow-to-create-and-store-an

Conversation

@itssimon

@itssimon itssimon commented Apr 15, 2026

Copy link
Copy Markdown
Member

Summary by cubic

Adds a browser-based auth flow to the CLI that opens the Apitally dashboard, lets the user select a team, and returns a newly created API key to save in ~/.apitally/auth.json. Aligns with DEV-103 by using the dashboard for team selection and creating a CLI-specific key, with a fallback to paste a key when running interactively.

  • New Features

    • Opens https://app.apitally.io/cli-auth?callback_port=<port> and runs a localhost callback server to receive { api_key } via JSON POST; includes CORS support and a 5-minute timeout.
    • Fallback: users can paste an API key in an interactive terminal; --api-key still saves directly without opening the browser.
    • Validates API key format before saving and prints colored success/error output when supported.
    • Hidden --app-url flag (APITALLY_APP_URL) to target other environments.
    • Updated CLI docs; added tests for callback handling and key validation.
  • Dependencies

    • Added open (launch default browser) and regex (API key validation).

Written for commit a5e9206. Summary will update on new commits.

@itssimon itssimon self-assigned this Apr 15, 2026
cubic-dev-ai[bot]

This comment was marked as resolved.

@sentry

sentry Bot commented Apr 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.60403% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.26%. Comparing base (a3c4f76) to head (a5e9206).

Files with missing lines Patch % Lines
src/main.rs 0.00% 7 Missing ⚠️
src/auth.rs 95.62% 6 Missing ⚠️
src/utils.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
+ Coverage   90.80%   91.26%   +0.45%     
==========================================
  Files          12       12              
  Lines        1817     1934     +117     
==========================================
+ Hits         1650     1765     +115     
- Misses        167      169       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@itssimon itssimon merged commit b68363e into main Apr 15, 2026
5 of 6 checks passed
@itssimon itssimon deleted the dev-103-implement-a-browser-based-auth-flow-to-create-and-store-an branch April 15, 2026 11:09
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