Skip to content

Commit 5af5cc6

Browse files
bk2204gitster
authored andcommitted
docs: indicate new credential protocol fields
Now that we have new fields (authtype and credential), let's document them for users and credential helper implementers. Indicate specifically what common values of authtype are and what values are allowed. Note that, while common, digest and NTLM authentication are insecure because they require unsalted, uniterated password hashes to be stored. Tell users that they can continue to use a username and password even if the new capability is supported. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2ae6dc6 commit 5af5cc6

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

Documentation/git-credential.txt

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,39 @@ empty string.
178178
Components which are missing from the URL (e.g., there is no
179179
username in the example above) will be left unset.
180180

181+
`authtype`::
182+
This indicates that the authentication scheme in question should be used.
183+
Common values for HTTP and HTTPS include `basic`, `bearer`, and `digest`,
184+
although the latter is insecure and should not be used. If `credential`
185+
is used, this may be set to an arbitrary string suitable for the protocol in
186+
question (usually HTTP).
187+
+
188+
This value should not be sent unless the appropriate capability (see below) is
189+
provided on input.
190+
191+
`credential`::
192+
The pre-encoded credential, suitable for the protocol in question (usually
193+
HTTP). If this key is sent, `authtype` is mandatory, and `username` and
194+
`password` are not used. For HTTP, Git concatenates the `authtype` value and
195+
this value with a single space to determine the `Authorization` header.
196+
+
197+
This value should not be sent unless the appropriate capability (see below) is
198+
provided on input.
199+
200+
`ephemeral`::
201+
This boolean value indicates, if true, that the value in the `credential`
202+
field should not be saved by the credential helper because its usefulness is
203+
limited in time. For example, an HTTP Digest `credential` value is computed
204+
using a nonce and reusing it will not result in successful authentication.
205+
This may also be used for situations with short duration (e.g., 24-hour)
206+
credentials. The default value is false.
207+
+
208+
The credential helper will still be invoked with `store` or `erase` so that it
209+
can determine whether the operation was successful.
210+
+
211+
This value should not be sent unless the appropriate capability (see below) is
212+
provided on input.
213+
181214
`wwwauth[]`::
182215

183216
When an HTTP response is received by Git that includes one or more
@@ -189,7 +222,21 @@ attribute 'wwwauth[]', where the order of the attributes is the same as
189222
they appear in the HTTP response. This attribute is 'one-way' from Git
190223
to pass additional information to credential helpers.
191224

192-
Unrecognised attributes are silently discarded.
225+
`capability[]`::
226+
This signals that the caller supports the capability in question.
227+
This can be used to provide better, more specific data as part of the
228+
protocol.
229+
+
230+
The only capability currently supported is `authtype`, which indicates that the
231+
`authtype`, `credential`, and `ephemeral` values are understood. It is not
232+
obligatory to use these values in such a case, but they should not be provided
233+
without this capability.
234+
+
235+
Callers of `git credential` and credential helpers should emit the
236+
capabilities they support unconditionally, and Git will gracefully
237+
handle passing them on.
238+
239+
Unrecognised attributes and capabilities are silently discarded.
193240

194241
GIT
195242
---

0 commit comments

Comments
 (0)