Skip to content

Commit

Permalink
fixup! Add first cut of git-credential-fdoss
Browse files Browse the repository at this point in the history
Simplify wording of formatSecretVal doc string. Add link to secret
encoding in git-credential-libsecret.

Addresses: #3 (comment)
  • Loading branch information
camh- committed Aug 27, 2024
1 parent 197f504 commit e52566a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,9 @@ func makeAttrs(gc *GitCredential) map[string]string {
// formatSecretVal encodes the secret and/or variable parts of a GitCredential
// into a string suitable for storing with the secret service. Variable parts,
// such as the password expiry time, cannot be encoded as an attribute as they
// need to match when looking up and such variable parts cannot be used for
// that.
// need to match on lookup.
//
// The format for encoding multiple values is the same as used by
// The format for [encoding] multiple values is the same as used by
// git-credential-libsecret so as to be compatible with it.
//
// Note: This format is not compatible with the unencrypted keyring format of
Expand All @@ -242,6 +241,8 @@ func makeAttrs(gc *GitCredential) map[string]string {
// as if you are going to store your passwords in plain text, you may as well
// use git-credential-store. However, one may want all their credentials
// together in one place stored in plain text for easier exploitation.
//
// [encoding]: https://github.com/git/git/blob/159f2d50e75c17382c9f4eb7cbda671a6fa612d1/contrib/credential/libsecret/git-credential-libsecret.c#L212
func formatSecretVal(gc *GitCredential) string {
secret := gc.Password
if gc.PasswordExpiryUTC != "" {
Expand Down

0 comments on commit e52566a

Please sign in to comment.