Skip to content

Conversation

@davcosentino
Copy link

Pull request to fix issue #162 (docker-credential-pass does not work with username containing forward-slash).

Based on @sebageek commit.

crazy-max and others added 4 commits May 10, 2023 02:27
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>
@davcosentino
Copy link
Author

cc @thaJeztah @crazy-max

_, 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))
Copy link
Member

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 😅)

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