Expand description
Registry authentication support.
Re-exportsยง
use crate::context::ConfigKey;๐use crate::util::CargoResult;๐use crate::util::GlobalContext;๐use crate::workspace::features::cargo_docs_link;๐use anyhow::Context as _;๐use anyhow::bail;๐use cargo_credential::Action;๐use cargo_credential::CacheControl;๐use cargo_credential::Credential;๐use cargo_credential::CredentialResponse;๐use cargo_credential::LoginOptions;๐use cargo_credential::Operation;๐use cargo_credential::RegistryInfo;๐use cargo_credential::Secret;๐use core::fmt;๐use std::error::Error;๐use time::Duration;๐use time::OffsetDateTime;๐use url::Url;๐use crate::context::Value;๐use crate::util::credential::adaptor::BasicProcessCredential;๐use crate::workspace::SourceId;๐use super::credential::process::CredentialProcessCredential;๐use super::credential::token::TokenCredential;๐use crate::context::ConfigRelativePathResolveExt;๐use crate::context::CredentialCacheValue;๐use crate::context::PathAndArgs;๐use crate::context::RegistryConfig;๐
Structsยง
- Authorization
Error - An authorization error from accessing a registry.
Enumsยง
Staticsยง
- BUILT_
IN_ ๐PROVIDERS - List of credential providers built-in to Cargo.
Keep in sync with the
matchincredential_action.
Functionsยง
- auth_
token - Returns the token to use for the given registry.
If a
login_urlis provided and a token is not available, thelogin_urlwill be included in the returned error. - auth_
token_ ๐optional - Returns the token to use for the given registry.
- cache_
token_ from_ commandline - Store a token in the cache for future calls.
- credential_
action ๐ - credential_
provider ๐ - Get the list of credential providers for a registry source.
- get_
credential_ ๐libsecret - Retrieves a cached instance of
LibSecretCredential. Must be cached to avoid repeated load/unload cycles, which are not supported byglib. - login
- Log in to the given registry.
- logout
- Log out from the given registry.
- resolve_
credential_ ๐alias - Use the
[credential-alias]table to see if the provider name has been aliased.