-
Notifications
You must be signed in to change notification settings - Fork 177
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 issue #162 (docker-credential-pass does not work with username containing forward-slash) #267
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com> Signed-off-by: Davide Cosentino <davide.cosentino@oracle.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com> Signed-off-by: Davide Cosentino <davide.cosentino@oracle.com>
Linters 'deadcode', 'structcheck', 'varcheck' are deprecated since v1.49.0 and had been replaced by 'unused'. Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com> Signed-off-by: Davide Cosentino <davide.cosentino@oracle.com>
Signed-off-by: Davide Cosentino <davide.cosentino@oracle.com>
_, err := p.runPass(creds.Secret, "insert", "-f", "-m", path.Join(PASS_FOLDER, encoded, creds.Username)) | ||
username := creds.Username | ||
if strings.Contains(username, "/") { | ||
username = base64.URLEncoding.EncodeToString([]byte(creds.Username)) |
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.
Do we know if pass supports spaces in usernames? If it does, perhaps we could swap "/"
for " "
(as I don't think we support spaces in usernames, so that would be non-ambiguous).
Advantage would be that the username would still be readable (I don't use pass
myself, but ISTR there's tools to manage credentials in pass
, which would otherwise see a base64-encoded username (which is not very user-friendly 😅)
Pull request to fix issue #162 (docker-credential-pass does not work with username containing forward-slash).
Based on @sebageek commit.