Re: [PATCH v2 2/6] credential: add WWW-Authenticate header to cred requests
- From
Matthew John Cheetham <mjcheetham@outlook.com>
- Date
- Nov 1, 2022, 23:07 UTC
- Message-ID
- <AS2PR03MB9815C34D7DB3C96CF1D0CC54C0369@AS2PR03MB9815.eurprd03.prod.outlook.com>
- In-Reply-To
- <08de9e0e-af08-2bc3-6693-7bf2b798f20a@jeffhostetler.com>
On 2022-10-28 11:22, Jeff Hostetler wrote:
Show 43 quoted lines
> On 10/21/22 1:07 PM, Matthew John Cheetham via GitGitGadget wrote:
>> From: Matthew John Cheetham <mjcheetham@outlook.com>
>>
>> Add the value of the WWW-Authenticate response header to credential
>> requests. Credential helpers that understand and support HTTP
>> authentication and authorization can use this standard header (RFC 2616
>> Section 14.47 [1]) to generate valid credentials.
>>
>> WWW-Authenticate headers can contain information pertaining to the
>> authority, authentication mechanism, or extra parameters/scopes that are
>> required.
>>
>> The current I/O format for credential helpers only allows for unique
>> names for properties/attributes, so in order to transmit multiple header
>> values (with a specific order) we introduce a new convention whereby a
>> C-style array syntax is used in the property name to denote multiple
>> ordered values for the same property.
>>
>> In this case we send multiple `wwwauth[n]` properties where `n` is a
>> zero-indexed number, reflecting the order the WWW-Authenticate headers
>> appeared in the HTTP response.
>
> Here (and maybe in the cover letter) you mention `wwwauth[n]` and `n`...
>> +`wwwauth[]`::
>> +
>> + When an HTTP response is received that includes one or more
>> + 'WWW-Authenticate' authentication headers, these can be passed to Git
>> + (and subsequent credential helpers) with these attributes.
>> + Each 'WWW-Authenticate' header value should be passed as a separate
>> + attribute 'wwwauth[]' where the order of the attributes is the same
>> + as they appear in the HTTP response.
>
> ...but here you don't include the `n`.
>
> [...]
>> +static void credential_write_strvec(FILE *fp, const char *key,
>> + const struct strvec *vec)
>> +{
>> + int i = 0;
>> + const char *full_key = xstrfmt("%s[]", key);
>
> ...nor here.
> Ah. This is an oversight in my v2 rebasing! Will fix in v3.
Thanks, Matthew