]> git.ipfire.org Git - thirdparty/curl.git/commit
creds: hold credentials
authorStefan Eissing <stefan@eissing.org>
Mon, 11 May 2026 12:25:52 +0000 (14:25 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 12 May 2026 14:05:15 +0000 (16:05 +0200)
commit8f71d0fde515aa4c68002477356c35bd79927729
tree8103c4823241b73255048375a7edc4ec67a8c223
parenta32a2b0b77c190981e1198c6b89b92430e231c37
creds: hold credentials

Authorizdation credentials are kept in `struct Curl_creds`. This contains:

* `user`: the username, maybe the empty string
* `passwd`: the password, maybe the empty string
* `sasl_authzid`: the SASL authz value, maybe the empty string
* `oauth_bearer`: the OAUTH bearer token, maybe the empty string
* `source`: where the credentials from from
* `refcount`: a reference counter to link/unkink creds

A `creds` with all values empty is equivalent to NULL, e.g. no `creds`
instance. With reference counting, `creds` can be linked/unlinked
in several places.

See docs/internals/CREDENTIALS.md for use.

Closes #21548
47 files changed:
docs/Makefile.am
docs/internals/CREDENTIALS.md [new file with mode: 0644]
lib/Makefile.inc
lib/connect.c
lib/creds.c [new file with mode: 0644]
lib/creds.h [new file with mode: 0644]
lib/curl_sasl.c
lib/ftp.c
lib/http.c
lib/http_aws_sigv4.c
lib/http_digest.c
lib/http_negotiate.c
lib/http_ntlm.c
lib/imap.c
lib/ldap.c
lib/mqtt.c
lib/netrc.c
lib/netrc.h
lib/openldap.c
lib/pop3.c
lib/rtsp.c
lib/smb.c
lib/socks.c
lib/socks.h
lib/telnet.c
lib/transfer.c
lib/transfer.h
lib/url.c
lib/urldata.h
lib/vauth/cleartext.c
lib/vauth/cram.c
lib/vauth/digest.c
lib/vauth/digest_sspi.c
lib/vauth/gsasl.c
lib/vauth/krb5_gssapi.c
lib/vauth/krb5_sspi.c
lib/vauth/ntlm.c
lib/vauth/ntlm_sspi.c
lib/vauth/oauth2.c
lib/vauth/spnego_gssapi.c
lib/vauth/spnego_sspi.c
lib/vauth/vauth.c
lib/vauth/vauth.h
lib/vssh/libssh.c
lib/vssh/libssh2.c
tests/libtest/lib1978.c
tests/unit/unit1304.c