feat(auth): add Spotify OAuth PKCE - #61
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed September 2, 2026, 7:18 PM ET / 23:18 UTC. ClawSweeper reviewWhat this changesThe PR adds opt-in Spotify Authorization Code with PKCE authentication for Web API requests, with per-profile token storage, refresh, CLI commands, tests, and documentation while retaining cookie authentication by default. Merge readiness⛔ Blocked before merge - 6 items remain Keep open: the earlier lifecycle-race finding is addressed on the current head, but this new persistent OAuth credential flow still needs attributable maintainer confirmation and successful real OAuth/Web API proof before merge. Priority: P2 Review scores
Verification
How this fits togetherSpogo is a script-first Spotify CLI whose commands select Connect or the public Web API. This change adds a local OAuth token provider for Web API calls, while Connect continues to obtain its session from browser cookies. flowchart LR
Command[CLI command] --> Choice[Engine and auth selection]
Choice --> Cookies[Browser cookie provider]
Choice --> Login[OAuth loopback login]
Login --> Cache[Per-profile token cache]
Cookies --> Web[Web API client]
Cache --> Web
Web --> Spotify[Spotify Web API]
Choice --> Connect[Cookie-backed Connect protocol]
Decision needed
Why: VISION.md requires an explicit product decision for credential flows, and the supplied snapshot has an author assertion of approval but no attributable maintainer record to audit. Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land a narrowly approved, cookie-default OAuth mode only after redacted built-CLI evidence shows successful login, token persistence, one authenticated Web API request, and rejected-state behavior without token exchange. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR introduces a new OAuth capability rather than reporting an existing-behavior defect. The supplied tests exercise simulated OAuth paths, but no successful real account flow is evidenced. Is this the best way to solve the issue? Unclear: the implementation preserves cookie defaults and scopes OAuth to the Web API, but it is the best solution only if a maintainer explicitly accepts the new credential contract and real built-CLI proof validates it. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning high; reviewed against 87a990da7e29. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com> Worked on by: - @VACInc
|
Closing this repair PR as superseded by #57. The current #57 head, The OAuth lifecycle implementation is identical between the two heads; |
Summary
mainand drop the search fix already landed in fix(search): decode Spotify plural result containers #59This replaces #57 because the managed maintainer identity could not write to the contributor fork. The original OAuth feature commit retains VACInc's authorship; the state-consistency repairs are separate commits.
Product decision
Maintainer direction on 2026-09-02 accepted this bounded OAuth mode for spogo's purpose: it is optional, local-only, limited to the existing Web API surface, and does not change the cookie-first default or make Connect depend on a hosted credential service. This satisfies the explicit product-decision requirement for new persistent credential flows in
VISION.md.Security
0700directory with0600files on POSIX systemsMoveFileExreplacement with write-through on WindowsCompatibility
Cookie authentication remains the default. OAuth selects the token provider for public Web API operations; Spotify Connect and internal endpoints still require browser cookies. Existing command names, output formats, and cookie-auth profiles remain unchanged.
Verification
Validated on exact head
3d11f9762853b0e7639aedc3d8ddb594d3faa200:go test ./...go test -race ./...go run golang.org/x/tools/cmd/deadcode@v0.49.0 -test ./...golangci-lint v2.13.2 run(0 issues)./scripts/check-coverage.sh 90(90.0%)node scripts/build-docs-site.mjsgo build ./cmd/spogoBuilt-CLI OAuth authority proof
The built CLI was run against its normal loopback callback and Spotify's real accounts token endpoint with dummy public values only:
400; the CLI remained waiting, proving no token exchange was triggered200, and reached Spotify's real token endpoint3; no credential or real token was used, printed, or persistedA successful authorization, persisted real token, and authenticated Web API request still require a human Spotify sign-in and remain the sole unfulfilled live-proof item.
Worked on by