AuthPolicy
- class AuthPolicy
Description
How to authenticate against indexes. Build one with the static constructors; the default for every call is
none().Opening the OS credential store can raise a keychain prompt on some platforms, so a library call never does it unasked: only
from_env()with the defaultkeyring=Trueopts in.Inheritance:
Members defined in
AuthPolicy(5 members)RHTTP basic credentials for every URL matching
url_glob.A bearer token for every URL matching
url_glob. Globs do not cross/: usehttps://index.example/**for a whole host.labelis the name error messages use for this credential.The CLI’s own resolution: validated
SYSAND_CRED_<LABEL>groups (SYSAND_CRED_<LABEL>holds the URL glob,..._BEARER_TOKENor..._BASIC_USER/..._BASIC_PASSWORDthe credential), composed with the OS credential storesysand auth loginwrites unlesskeyring=False. Environment variables alone can never prompt. The variables are read when a call is made, not here.No credentials at all; a 401/403 raises
AuthError.Attributes
Methods
- static basic(*, url_glob: str, username: str, password: str) syside.experimental.remote.AuthPolicy
HTTP basic credentials for every URL matching
url_glob.
- static bearer(*, url_glob: str, token: str, label: str = 'python') syside.experimental.remote.AuthPolicy
A bearer token for every URL matching
url_glob. Globs do not cross/: usehttps://index.example/**for a whole host.labelis the name error messages use for this credential.
- static from_env(*, keyring: bool = True) syside.experimental.remote.AuthPolicy
The CLI’s own resolution: validated
SYSAND_CRED_<LABEL>groups (SYSAND_CRED_<LABEL>holds the URL glob,..._BEARER_TOKENor..._BASIC_USER/..._BASIC_PASSWORDthe credential), composed with the OS credential storesysand auth loginwrites unlesskeyring=False. Environment variables alone can never prompt. The variables are read when a call is made, not here.
- static none() syside.experimental.remote.AuthPolicy
No credentials at all; a 401/403 raises
AuthError.