docker / docker-credential-helpers

Programs to keep Docker login credentials safe by storing in platform keystores
MIT License
1.09k stars 172 forks source link

Set a better displaylabel for secretservice #201

Closed WhyNotHugo closed 3 years ago

WhyNotHugo commented 3 years ago

Secretservice entries have a "label". This is intended to be a human-readable description. It's actually called "Description" in UIs like seahorse, and the listing of existing secrets shows this as a name for each one.

The entries stored by the credential helper set this to simply the repository URL. This is rather unfriendly, since entries like "gitlab.com" and "index.docker.io/v1" show up. Mixed in with entries from all other applications, it's hard to figure out what application owns each entry.

This commit changes the label used when saving entries to be something human-readable (this is the intent of the "label" field, btw). Because of the naming scheme, this also results in all entries being shown together by default (since UIs tend to sort lexicographically).

New entries will now be stores as:

Docker credentials for $REGISTRY_URL

Note that items stored by the secret service have multiple fields inside of them. One of those fields is called "label", and is used by the helper to filter items from the secret service. This "label" field is entirely unrelated to the items' label. The naming is most unfortunate.

WhyNotHugo commented 3 years ago

This is what entries look on a Seahorse (a UI to inspect one's secretservice storage).

Without this patch:

before

With this patch:

after

WhyNotHugo commented 3 years ago

Any feedback for this? I don't think the CI failure is related.