Skip to content
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

Group filter and Git detection #51

Closed
wants to merge 3 commits into from
Closed

Group filter and Git detection #51

wants to merge 3 commits into from

Conversation

Frederick888
Copy link
Owner

@Frederick888 Frederick888 commented Oct 2, 2022

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] keepassxreboot/keepassxc#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

  • I have rebased my branch so that it has no conflicts
  • I have added tests where appropriate
  • Commit messages are compliant with Conventional Commits

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.

@Frederick888 Frederick888 force-pushed the group-detect branch 2 times, most recently from 8efbda4 to b06e8f4 Compare October 3, 2022 12:43
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] keepassxreboot/keepassxc#4111
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 = "<subcommand option>" does not work when using
these filter options at global position.
@Frederick888 Frederick888 deleted the group-detect branch January 27, 2023 13:32
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.

Offer credentials from Git group only (CLI flag & automatically)
1 participant