diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2024-04-17 02:02:28 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-17 07:39:06 +0200 |
commit | 6a6d6fb12e485a580fc3f219cbee1575481b56eb (patch) | |
tree | 59b62dc7ec3e3450e1d213d26c9511e86ef59559 /credential.h | |
parent | http: use new headers for each object request (diff) | |
download | git-6a6d6fb12e485a580fc3f219cbee1575481b56eb.tar.xz git-6a6d6fb12e485a580fc3f219cbee1575481b56eb.zip |
credential: add a field for pre-encoded credentials
At the moment, our credential code wants to find a username and password
for access, which, for HTTP, it will pass to libcurl to encode and
process. However, many users want to use authentication schemes that
libcurl doesn't support, such as Bearer authentication. In these
schemes, the secret is not a username and password pair, but some sort
of token that meets the production for authentication data in the RFC.
In fact, in general, it's useful to allow our credential helper to have
knowledge about what specifically to put in the protocol header. Thus,
add a field, credential, which contains data that's preencoded to be
suitable for the protocol in question. If we have such data, we need
neither a username nor a password, so make that adjustment as well.
It is in theory possible to reuse the password field for this. However,
if we do so, we must know whether the credential helper supports our new
scheme before sending it data, which necessitates some sort of
capability inquiry, because otherwise an uninformed credential helper
would store our preencoded data as a password, which would fail the next
time we attempted to connect to the remote server. This design is
substantially simpler, and we can hint to the credential helper that we
support this approach with a simple new field instead of needing to
query it first.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'credential.h')
-rw-r--r-- | credential.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/credential.h b/credential.h index dc96ca0318..9db892cf4d 100644 --- a/credential.h +++ b/credential.h @@ -138,6 +138,7 @@ struct credential { char *username; char *password; + char *credential; char *protocol; char *host; char *path; |