Skip to content

fix: credentials: don't store creds for local credential tools #239

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

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

g-linville
Copy link
Member

@g-linville g-linville commented Apr 12, 2024

for #240

There was a problem where sometimes credential tools without github.com at the front of their name were having their credentials stored anyway. This change also skips the credential lookup for non-GitHub tools, since we aren't going to store the credentials for those anyway.

)

// Only try to look up the cred if the tool is on GitHub.
if strings.HasPrefix(credToolName, "github.com") {
Copy link
Member

Choose a reason for hiding this comment

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

nit: I suggest using a constant instead of a literal since we're using it in multiple places.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. Decided to just define a function.

Signed-off-by: Grant Linville <[email protected]>
@g-linville g-linville requested a review from njhale April 12, 2024 19:45
@g-linville g-linville merged commit 9e8d144 into gptscript-ai:main Apr 12, 2024
@g-linville g-linville deleted the cred-local-fix branch April 12, 2024 21:19
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