-
Notifications
You must be signed in to change notification settings - Fork 9
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
git-credential doesn't work with host have colon ":" #1
Comments
This is strange.
Did you try with the mime setting set to false in your config?
It might be a clash with the mime type or with the KV type.
|
I don't know. I clone a fresh gopass repository to try.
With this debug line: diff --git a/cmd/git-credential-gopass/git-credential.go b/cmd/git-credential-gopass/git-credential.go
index 03d0e00f..85e7101f 100644
--- a/cmd/git-credential-gopass/git-credential.go
+++ b/cmd/git-credential-gopass/git-credential.go
@@ -141,6 +141,7 @@ func (s *gc) Get(c *cli.Context) error {
}
// try git/host/username... If username is empty, simply try git/host
path := "git/" + fsutil.CleanFilename(cred.Host) + "/" + fsutil.CleanFilename(cred.Username)
+ fmt.Fprintln(os.Stderr, path)
if _, err := s.gp.Get(ctx, path, "latest"); err != nil {
// if the looked up path is a directory with only one entry (e.g. one user per host), take the subentry instead
ls, err := s.gp.List(ctx) I see this log:
So, at least I can have a workaround (actually, I prefer |
Just to make sure, please try setting:
gopass config mime false
|
|
I think this line is what causes my problem: path := "git/" + fsutil.CleanFilename(cred.Host) + "/" + fsutil.CleanFilename(cred.Username) I think we |
Yes, we should document that we can not allow arbitrary characters in the name of the secrets as the are mapped to filesystem paths. Feel free to send a PR documenting it in the place you'd expect to find this information. |
Imo this is still an error. PASS way: $ pass insert git/host.com:2299
Enter password for git/host.com:2299:
Retype password for git/host.com:2299:
$ pass list
Password Store
└── git
└── host.com:2299
Plain Gopass: $ gopass insert git/githost.org:3444
Enter password for git/githost.org:3444:
Retype password for git/githost.org:3444:
Warning: Password is too short
/projects/gopass-fork$ gopass list
gopass
├── git/
│ └── githost.org:3444 Credential Store: $ git-credential-gopass store <<_EOF
> protocol=smtp
> host=smtp.gmail.com:465
> [email protected]
> _EOF
$ gopass list
gopass
├── git/
│ └── smtp.gmail.com_465/
│ └── [email protected]
The hostname part is from a trustworthy source -> Git. So we could fix it quickly. But it would force a new major version. |
@jensklose Maybe it's just the |
I'm guessing that's a limitation where we need to ask ourselves how much cross platform we wanna be. Should we clean them away only on Windows? Pass being meant as a Unix tools doesn't have the same problem I guess. |
I guess this is a gopass problem too. ... but it is storable in nonWin Version, hmm. |
I have to admit I'm at a loss how the git credential helper protocol works. Why can't we look up a secret if we consistently replace a colon by an underscore? If not: Could someone provide me a more complete example of how that works? |
Because, we don't consistently replace.
|
Although these should be rare exceptions, inconsistent behavior is a problem. imo |
So we could try a fallback location to work around this issue (i.e. one where colons are not replaced, unless we're on Windows). |
I'm still experiencing whatever this problem is, alongside the problem of that there is no documentation of how this works, so when i set it up and use |
github becomes worst |
My problem is solved with #74 |
Summary
I'm testing for gopasspw/gopass#1670
My usual workflow involve
git-sendemail
and I'm usingpass
to store my password.When
git-sendemail
invoked, it will invoke a git-credential helper to get my password.Usually, I use this script https://raw.githubusercontent.com/sgn/dotfiles/414ac02ae383b52b4713b2870244afeebdcdbe0d/bin/git-credential-pass
I tried
gopass
but it doesn't work because the host sent by git has a colonSteps To Reproduce
Expected behavior
credential filled
Environment
Additional context
The text was updated successfully, but these errors were encountered: