-
Notifications
You must be signed in to change notification settings - Fork 175
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
Set a better displaylabel for secretservice #324
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #324 +/- ##
==========================================
- Coverage 53.26% 53.10% -0.16%
==========================================
Files 9 9
Lines 674 676 +2
==========================================
Hits 359 359
- Misses 270 272 +2
Partials 45 45 ☔ View full report in Codecov by Sentry. |
secretservice/secretservice.go
Outdated
@@ -33,8 +33,10 @@ func (h Secretservice) Add(creds *credentials.Credentials) error { | |||
defer C.free(unsafe.Pointer(username)) | |||
secret := C.CString(creds.Secret) | |||
defer C.free(unsafe.Pointer(secret)) | |||
displayLabel := C.CString("Docker credentials for " + creds.ServerURL) |
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.
looking now at it; should it be either configurable, or more generic? (registry credentials for)?
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.
Or alternatively, we could use the name of the binary perhaps (docker-credentials-secretservice
by default)
Just thinking out loud here 🤗
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.
Hum yeah "Registry credentials" sounds better indeed
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.
Updated 👍
c805249
to
9c54706
Compare
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: Registry 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. Signed-off-by: Hugo Osvaldo Barrera <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
9c54706
to
5d54c65
Compare
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:
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.
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)