Frederick888 / git-credential-keepassxc

Helper that allows Git (and shell scripts) to use KeePassXC as credential store
GNU General Public License v3.0
196 stars 8 forks source link

Group filter and Git detection #51

Closed Frederick888 closed 1 year ago

Frederick888 commented 2 years ago

Description

Closes #50

Detect Git HTTP operations (mainly fetch/push over HTTP/S) and use entries from git-credentials-keepassxc group (configured during git-credentials-keepassxc configure, by default Git).

Also offers a --group xyz option for get/set.

Changes

7065583 refactor: Move GitCredentialMessage ops to impl

296efde feat(get,store)!: Group filter from CLI or Git detection

When Git is requesting an HTTP/S credential, by default only return entries from the dedicated group configured by git-credential-keepassxc configure. This can be disabled by --no-git-detection.

Note since KeePassXC returns no database info here, group names configured for all databases are used regardless of where an entry is from. So it's better to simply use the same dedicated group name across the board (by default this is 'Git').

Also implements --group. This option overrides Git detection.

Requires KeePassXC >= 2.6.0 [1].

[1] https://github.com/keepassxreboot/keepassxc/pull/4111

5dfdde1 feat(get,store): Global filter options

Allow using --no-filter/--no-git-detection/--group in front of get/store. This can come handy if someone wants to use them in .gitconfig, as Git places these options in front of subcommands and there is no longer a need to write a custom wrapper.

Note conflicts_with = "" does not work when using these filter options at global position.

Checklist

Is this a breaking change?

Yes. If someone's been using a credential from other groups for such operations, it'll break cos we now return from the dedicated group only by default.