Skip to content

✨ Use scoped logins for CLI actions - #397

Merged
Robdel12 merged 3 commits into
mainfrom
rd/scoped-user-login
Nov 4, 2026
Merged

Robdel12 merged 3 commits into
mainfrom
rd/scoped-user-login

Conversation

@Robdel12

@Robdel12 Robdel12 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Builds on the project discovery work merged in #395.

Why

Signing in should be enough to use Vizzly within the permissions the user grants. Requiring another project credential for uploads made a valid login feel incomplete, while shared refresh state could make simultaneous CLI processes invalidate one another.

Approach

Save consented sessions by API origin, use native credential storage where available, and coordinate refresh across processes before rereading the saved successor. Persist refresh uncertainty before rotation so a dropped response, process exit, or failed save cannot cause a later command to replay a consumed token. Login supports explicit scope requests and headless terminals; whoami and permission errors report the actual grant. Selected-user failures never switch identities, while explicit CI tokens remain authoritative.

Project linking now saves the checkout destination without minting credentials. The same selected session reaches uploads, run screenshot forwarding, finalization, previews, and reporter cloud reads through supported SDK routes. Build-only uploads work without read permission, and submitted generic writes are not replayed after authentication failures.

Evidence

The full CLI suite passed 1,884 tests with six skips; the reporter browser suite passed 98 journeys with two skips. Build, published types, lint, formatting, and architecture checks passed. Additional local end-to-end verification used the real API for browser-approved login, four concurrent CLI processes sharing one refresh, user/token build attribution, read-only rejection before writes, a build-only run with screenshot forwarding and finalization, isolated logout, and a committed refresh with a dropped response whose successor remains valid because the later CLI process refuses replay. The production review also covers durable uncertain-refresh recovery through real HTTP, disk reload, and fresh CLI processes. Review covered process-owner death, repeated expiry windows, lock collisions, bounded authentication requests, and safe JSON projections.

Rollout

Release alongside the scoped-session API contract. Existing generic logins require one fresh browser consent; they are not silently upgraded. Project-token CI remains supported. Custom VIZZLY_HOME directories use isolated credential files by default. The duplicate authentication guide is removed; the README and command help retain the user workflow.

Base automatically changed from rd/project-discovery-ux to main November 4, 2026 06:42
Keep user sessions isolated by API origin and coordinate rotating credentials
across processes. Preserve granted permissions and report scope failures
without changing identity or replaying submitted writes.

Use the selected login for developer uploads and reporter reads; linking saves
only the checkout destination while explicit CI tokens remain authoritative.
Separate project names, qualified selectors, and organizations in the project list. Show the automatically selected credential, explain token precedence without requiring an auth flag, and suggest concrete commands for a single project. Remove the session identifier from normal whoami output while retaining its machine-readable contract.
Persist refresh uncertainty before sending a rotating credential and refuse reuse when the response or durable save is lost. Definite rejected requests remain retryable; successful replacement or new consent clears the marker. Cover fresh-store and subprocess recovery and remove the redundant authentication guide.
@Robdel12
Robdel12 force-pushed the rd/scoped-user-login branch from 6493f23 to 7a790f1 Compare November 4, 2026 06:44
@vizzly-testing

vizzly-testing Bot commented Nov 4, 2026

Copy link
Copy Markdown

Vizzly - Visual Test Results

CLI Reporter - Waiting for build

No builds received yet for this pull request.

CLI TUI - 1 change needs review
Result Count Review
Meaningful diffs 1 Required - inspect changed screenshots
Passed 4 No action - matched approved baselines
Meaningful diffs needing review (1)

vizzly-help · 1202×1430 · 0.2% diff

vizzly-help

Review changes


rd/scoped-user-login · 7a790f1d

@Robdel12
Robdel12 enabled auto-merge (squash) November 4, 2026 06:47
@Robdel12
Robdel12 merged commit 98e20a1 into main Nov 4, 2026
28 of 30 checks passed
@Robdel12
Robdel12 deleted the rd/scoped-user-login branch November 4, 2026 06:48
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