-
Notifications
You must be signed in to change notification settings - Fork 293
enhance: update credentials framework for OAuth support #305
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
enhance: update credentials framework for OAuth support #305
Conversation
d36a144
to
6443c29
Compare
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
b922d5e
to
ec67482
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few nits, but otherwise LGTM!
sort.Strings(envVars) | ||
_, _ = fmt.Fprintf(w, "%s\t%s\t%s\n", cred.Context, cred.ToolName, strings.Join(envVars, ", ")) | ||
} | ||
_, _ = w.Write([]byte("CONTEXT\tCREDENTIAL\tEXPIRES IN\tENV\n")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: does the linter complain if you omit _, _ =
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. golangci-lint complains, and GoLand underlines it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except one small question
Signed-off-by: Grant Linville <[email protected]>
This adds support for expiration and refresh tokens to the credential framework. All of these changes are backwards compatible with existing credentials, though new credentials will be stored in a slightly different format.
Notable changes:
gptscript cred
output looks a little nicer and displays more information.