credential: document protocol updates
Document protocol changes after CVE-2020-11008, including the removal of references to the override of attributes which is no longer recommended after CVE-2020-5260 and that might be removed in the future. While at it do some improvements for clarity and consistency. Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Carlo Marcelo Arenas Belón committed
May 6, 2020 at 14:47 UTC
1aed817f99bf259ea18ec49829b8d46b914e0230
1 file changed
+21
-13
Documentation/git-credential.txt
+21
-13
@@ -103,17 +103,20 @@ INPUT/OUTPUT FORMAT
103
`git credential` reads and/or writes (depending on the action used)
104
credential information in its standard input/output. This information
105
can correspond either to keys for which `git credential` will obtain
106
-the login/password information (e.g. host, protocol, path), or to the
107
-actual credential data to be obtained (login/password).
106
+the login information (e.g. host, protocol, path), or to the actual
107
+credential data to be obtained (username/password).
108
109
The credential is split into a set of named attributes, with one
110
-attribute per line. Each attribute is
111
-specified by a key-value pair, separated by an `=` (equals) sign,
112
-followed by a newline. The key may contain any bytes except `=`,
113
-newline, or NUL. The value may contain any bytes except newline or NUL.
110
+attribute per line. Each attribute is specified by a key-value pair,
111
+separated by an `=` (equals) sign, followed by a newline.
112
+
113
+The key may contain any bytes except `=`, newline, or NUL. The value may
114
+contain any bytes except newline or NUL.
115
+
116
In both cases, all bytes are treated as-is (i.e., there is no quoting,
117
and one cannot transmit a value with newline or NUL in it). The list of
118
attributes is terminated by a blank line or end-of-file.
119
+
120
Git understands the following attributes:
121
122
`protocol`::
@@ -123,7 +126,8 @@ Git understands the following attributes:
126
127
`host`::
128
126
- The remote hostname for a network credential.
129
+ The remote hostname for a network credential. This includes
130
+ the port number if one was specified (e.g., "example.com:8088").
131
132
`path`::
133
@@ -134,7 +138,7 @@ Git understands the following attributes:
138
`username`::
139
140
The credential's username, if we already have one (e.g., from a
137
- URL, from the user, or from a previously run helper).
141
+ URL, the configuration, the user, or from a previously run helper).
142
143
`password`::
144
@@ -146,8 +150,12 @@ Git understands the following attributes:
150
value is parsed as a URL and treated as if its constituent parts
151
were read (e.g., `url=https://example.com` would behave as if
152
`protocol=https` and `host=example.com` had been provided). This
149
- can help callers avoid parsing URLs themselves. Note that any
150
- components which are missing from the URL (e.g., there is no
151
- username in the example above) will be set to empty; if you want
152
- to provide a URL and override some attributes, provide the URL
153
- attribute first, followed by any overrides.
153
+ can help callers avoid parsing URLs themselves.
154
+
155
+ Note that specifying a protocol is mandatory and if the URL
156
+ doesn't specify a hostname (e.g., "cert:///path/to/file") the
157
+ credential will contain a hostname attribute whose value is an
158
+ empty string.
159
+
160
+ Components which are missing from the URL (e.g., there is no
161
+ username in the example above) will be left unset.