feat(cli): add auth command to verify GP_ACCESS_TOKEN#25
Merged
Conversation
Expose check_auth() on API and client layers with GoProAuthStatus, and add gopro-api auth with Rich, JSON, and TSV output plus exit codes. Co-authored-by: Cursor <cursoragent@cursor.com>
Update CLI, configuration, architecture, and API reference pages for gopro-api auth and the new GoProAuthStatus model. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Move duplicated token verification helpers into AuthStatusResolver and use a context manager for the CLI spinner instead of manual dunder calls. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gopro-api authto check whetherGP_ACCESS_TOKENis configured and accepted by the GoPro cloud API (lightweightGET /media/search?per_page=1).check_auth()onGoProAPI,AsyncGoProAPI,GoProClient, andAsyncGoProClient, returning a newGoProAuthStatusmodel with token source, HTTP status, and message.--json, and--tsvoutput with exit codes0/1/2for scripting.Test plan
gopro-api authwith a valid token → exit0, panel shows authenticatedgopro-api authwithoutGP_ACCESS_TOKEN→ exit2gopro-api auth --json→ structured JSON on stdoutgopro-api auth --tsv→ tab-separated key/value rowsasync with AsyncGoProClient() as client: await client.check_auth()returnsGoProAuthStatusMade with Cursor