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

fix(profile/token): 'profile token' command must check the validity of the stored token. #1339

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

kpfleming
Copy link
Contributor

@kpfleming kpfleming commented Nov 7, 2024

The 'fastly profile token' command did not check the validity (expiration) of the stored token, which meant that it would emit an invalid token if the stored session token (and refresh token) had expired. This PR changes the behavior so that the validity of the token is checked as it is for all commands which actually make use of the token.

Because this command is most often used in a non-interactive situation (in a script or some other automation), expired and soon-to-expire tokens just return errors, they don't prompt for re-authentication.

@kpfleming kpfleming force-pushed the cdtool-929 branch 2 times, most recently from d5233f6 to 7798bfd Compare November 7, 2024 21:56
@kpfleming kpfleming marked this pull request as ready for review November 7, 2024 22:13
@kpfleming kpfleming requested a review from phamann November 7, 2024 22:13
…f the stored token.

The 'fastly profile token' command did not check the validity
(expiration) of the stored token, which meant that it would emit an
invalid token if the stored session token (and refresh token) had
expired. This PR changes the behavior so that the validity of the
token is checked as it is for all commands which actually make use of
the token.
Copy link
Member

@phamann phamann left a comment

Choose a reason for hiding this comment

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

LGTM other than minor nit around the ttl

@kpfleming kpfleming requested a review from phamann November 8, 2024 16:18
Copy link
Member

@phamann phamann left a comment

Choose a reason for hiding this comment

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

LGTM

@kpfleming kpfleming merged commit 270451f into fastly:main Nov 8, 2024
6 checks passed
@kpfleming kpfleming deleted the cdtool-929 branch November 8, 2024 16:24
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.

2 participants