-
Notifications
You must be signed in to change notification settings - Fork 52
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
What should gh do if gitcreds_get()
returns a password that is not a PAT?
#133
Comments
gh's validation around the |
Yeah, AFAICT right now you get a silent "no pat". Should this be an error or a warning instead? |
Although it's part of a user-facing API for putting creds into the store, credentials certainly tries to catch this case: and even goes on to reject that cred (presumably to make sure there's no entry with a real username + a PAT in the store). |
I think it would reasonable to do that in gh and usethis, when you need a GH PAT. So maybe gh should have a But the git credential store is actually used for a lot of things already, not just PATs, so I don't think gitcreds should have such restrictions. |
Yes, I think so. I think usethis may also need one. I think any package that pulls from the store potentially needs to offer a humane way to put something there as well. You can, of course, recommend a function in another package for this. But with usethis, for example, we generally try to provide lots of scaffolding and make usethis feel like the storefront. |
Yeah, |
I think our current Lines 63 to 84 in d41174a
Which, I think, suggests that gh should offer this and usethis should recommend or wrap that. Because the |
Closed wrong issue.... |
@jennybc Do you remember if we wanted to do anything more about this? Or it is fine as it is now? |
I have definitely heard of people who enter a password when asked for a PAT, then are confused when things don't work. So I'm still a general fan of trying to catch this and emit a message that suggests what might be wrong. |
I was really confused about this error. TLDR: update gh, git_creds, and usethis |
Sending a password that is not a PAT can be a security issue, although we are sending it to the very same host we would send the PAT to, so maybe not a very serious issue?
Also, at the time of writing we don't know any situation when sending a non-PAT password in the
Authorization
header would do anything useful.So probably we should error?
The text was updated successfully, but these errors were encountered: