Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chronoctl auth whoami #54

Merged
merged 2 commits into from
Mar 11, 2025
Merged

chronoctl auth whoami #54

merged 2 commits into from
Mar 11, 2025

Conversation

bbarnes52
Copy link
Contributor

@bbarnes52 bbarnes52 commented Mar 6, 2025

Adds chronoctl auth whoami which resolves a given token to the user to which it belongs. whoami supports the standard mechanisms for providing credentials, i.e. --api-token, CHRONOSPHERE_API_TOKEN, and local token storage. If multiple credentials are present, it determines which credential to resolve in the same manner as all other chronoctl commands.

Reviewable by commit

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@bbarnes52 bbarnes52 changed the title Refactor shared utilities into token package chronoctl auth whoami Mar 6, 2025
@bbarnes52 bbarnes52 force-pushed the 03-06-chronoctl_auth_whoami branch from 5c8b8cf to 5abed86 Compare March 6, 2025 19:46
@bbarnes52 bbarnes52 force-pushed the 03-06-chronoctl_auth_whoami branch 8 times, most recently from bc9bc69 to d40967d Compare March 6, 2025 22:51
@bbarnes52 bbarnes52 marked this pull request as ready for review March 6, 2025 22:59
@bbarnes52 bbarnes52 requested a review from a team as a code owner March 6, 2025 22:59
return errors.WithStack(err)
}
if resp.StatusCode != http.StatusOK {
return errors.New(string(body))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit suggest prefixing error with the http status here, in case the body has nothing useful

@bbarnes52 bbarnes52 force-pushed the 03-06-chronoctl_auth_whoami branch from d40967d to 6822763 Compare March 11, 2025 01:55
@bbarnes52 bbarnes52 merged commit 720b227 into main Mar 11, 2025
1 check passed
@bbarnes52 bbarnes52 deleted the 03-06-chronoctl_auth_whoami branch March 11, 2025 04:01
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.

3 participants