Expand description
Composer repository credentials, without an HTTP client.
AuthCredentials is one host’s credential and renders the header
Composer sends for it; parse_auth_object reads Composer’s auth shape
(top level of auth.json and COMPOSER_AUTH, config in composer.json)
into a map keyed by host; auth_key is the key a URL is looked up under.
Reading files and the environment is left to the caller.
Structs§
- Auth
Error - A malformed auth document. The message names where the value came from and the offending key path, never a secret.
Enums§
- Auth
Credentials - One repository host’s credential.
Debugnever shows the secret.
Functions§
- auth_
key - The key a URL’s credential is looked up under, as Composer does: the
host, with its port when the URL has one (
repo.magento.com,127.0.0.1:8080). Userinfo is dropped.Nonewhen there is no host (file://URLs, paths). - parse_
auth_ json - Parse an
auth.jsondocument (or theCOMPOSER_AUTHvalue). Empty or whitespace-only input is no credentials.sourcenames the document in error messages. - parse_
auth_ object - Parse Composer’s auth object —
{http-basic, bearer, github-oauth, gitlab-token, gitlab-oauth}, each a map from host to credential — into a map keyed by host. Other keys are ignored, so composer.json’s wholeconfigblock can be passed.sourceprefixes each error message.