Skip to main content

Module auth

Module auth 

Source
Expand description

Registry authentication support.

Re-exportsยง

use crate::context::ConfigKey; ๐Ÿ”’
use crate::util::CargoResult; ๐Ÿ”’
use crate::util::GlobalContext; ๐Ÿ”’
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ยง

AuthorizationError
An authorization error from accessing a registry.

Enumsยง

AuthorizationErrorReason

Staticsยง

BUILT_IN_PROVIDERS ๐Ÿ”’
List of credential providers built-in to Cargo. Keep in sync with the match in credential_action.

Functionsยง

auth_token
Returns the token to use for the given registry. If a login_url is provided and a token is not available, the login_url will 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 by glib.
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.