Skip to content

Commit 337f31f

Browse files
authored
Merge pull request #37 from languitar/feature/clarify-functionality-in-readme
docs: clarify general functioning in README
2 parents c9d1cad + e09cbca commit 337f31f

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
# pass-git-helper
44

5-
A [git] credential helper implementation that allows using [pass] as the credential backend for your git repositories.
6-
This is achieved by explicitly defining mappings between hosts and entries in the password store.
5+
A [git] credential helper implementation that allows using [pass] as the credential backend for your https-based git repositories.
6+
When [git] tries to interact with an https-based upstream and needs credentials, this helper will be called to look up the credentials from the user's password store.
7+
Instead of enforcing a specific layout of the password store, a configuration file with explicitly defining mappings between hosts and entries in the password store is used, giving full flexibility to the user on how to structure or reuse existing password databases for [git] authentication.
8+
pass-git-helper will use the mappings to find the correct entry in the user's password store based on the request URL and then provides [git] with the credentials from this entry.
79

810
## Preconditions
911

@@ -50,7 +52,7 @@ virtualenv /your/env
5052
## Usage
5153

5254
Create the file `~/.config/pass-git-helper/git-pass-mapping.ini`.
53-
This file uses ini syntax to specify the mapping of hosts to entries in the passwordstore database.
55+
This file uses ini syntax to specify the mapping of hosts to entries in the password store database.
5456
Section headers define patterns which are matched against the host part of a URL with a git repository.
5557
Matching supports wildcards (using the python [fnmatch module](https://docs.python.org/3.7/library/fnmatch.html)).
5658
Each section needs to contain a `target` entry pointing to the entry in the password store with the password (and optionally username) to use.
@@ -103,7 +105,7 @@ This is especially helpful for wildcard matches:
103105
target=git-logins/${host}
104106
```
105107

106-
The above configuration directive will lead to any host that did not match any previous section in the ini file to being looked up under the `git-logins` directory in your passwordstore.
108+
The above configuration directive will lead to any host that did not match any previous section in the ini file to being looked up under the `git-logins` directory in your password store.
107109

108110
Using the `includeIf` directive available in git >= 2.13, it is also possible to perform matching based on the current working directory by invoking `pass-git-helper` with a conditional `MAPPING-FILE`.
109111
To achieve this, edit your `.gitconfig`, e.g. like this:
@@ -115,7 +117,7 @@ To achieve this, edit your `.gitconfig`, e.g. like this:
115117
path=~/.config/git/gitconfig_user2
116118
```
117119

118-
With the following contents of `gitconfig_user1` (and `gitconfig_user2` repspectively), `mapping_user1.ini`, which could contain a `target` entry to e.g. `github.com/user1` would always be invoked in `~/src/user1`:
120+
With the following contents of `gitconfig_user1` (and `gitconfig_user2` respectively), `mapping_user1.ini`, which could contain a `target` entry to e.g. `github.com/user1` would always be invoked in `~/src/user1`:
119121

120122
```ini
121123
[user]
@@ -129,13 +131,13 @@ See also the offical [documentation](https://git-scm.com/docs/git-config#_includ
129131
### DEFAULT section
130132

131133
Defaults suitable for all entries of the mapping file can be specified in a special section of the configuration file named `[DEFAULT]`.
132-
Everything configure in this section will automatically be available for all further entries in the file, but can be overriden there, too.
134+
Everything configure in this section will automatically be available for all further entries in the file, but can be overridden there, too.
133135

134-
## Passwordstore Layout and Data Extraction
136+
## Password Store Layout and Data Extraction
135137

136138
### Password
137139

138-
As usual with [pass], this helper assumes that the password is contained in the first line of the passwordstore entry.
140+
As usual with [pass], this helper assumes that the password is contained in the first line of the password store entry.
139141
Though uncommon, it is possible to strip a prefix from the data of the first line (such as `password:` by specifying an amount of characters to leave out in the `skip_password` field for an entry or also in the `[DEFAULT]` section to apply for all entries:
140142

141143
```ini
@@ -153,7 +155,7 @@ target=special/noprefix
153155

154156
`pass-git-helper` can also provide the username necessary for authenticating at a server.
155157
In contrast to the password, no clear convention exists how username information is stored in password entries.
156-
Therefore, multiple strategies to extract the username are implemented and can be selected globally for the whole passwordstore in the `[DEFAULT]` section, or individually for certain entries using the `username_extractor` key:
158+
Therefore, multiple strategies to extract the username are implemented and can be selected globally for the whole password store in the `[DEFAULT]` section, or individually for certain entries using the `username_extractor` key:
157159

158160
```ini
159161
[DEFAULT]
@@ -188,14 +190,14 @@ Configuration:
188190

189191
#### Strategy "entry_name"
190192

191-
Returns the last path fragment of the passwordstore entry as the username.
193+
Returns the last path fragment of the password store entry as the username.
192194
For instance, if a regular [pass] call would be `pass show dev/github.com/languitar`, the returned username would be `languitar`.
193195

194196
No configuration options.
195197

196198
### File Encoding
197199

198-
By default, passwordstore entries are assumed to use UTF-8 encoding.
200+
By default, password store entries are assumed to use UTF-8 encoding.
199201
If all or some of your entries use a different encoding, use the `encoding` key (for instance, in the `DEFAULT` section) to specify the used encoding.
200202

201203
## Command Line Options

0 commit comments

Comments
 (0)