pub enum CargoAuthMode {
Auto,
Token,
Oidc,
}Expand description
How a publish.cargo block authenticates its cargo publish: a
long-lived crates.io API token, or GitHub Actions OIDC (crates.io Trusted
Publishing, which mints a short-lived token per run — no stored secret).
crates.io publishes through the cargo CLI, but the Trusted-Publishing
exchange (Actions id-token → crates.io mint-token) is performed by
anodizer itself: it mints one token before the dependency-order publish
loop, supplies it to every cargo publish via CARGO_REGISTRY_TOKEN, and
revokes it (best-effort) after the loop. The minted token is
workspace-scoped, so a single mint authorizes every crate whose
Trusted-Publisher config matches this repository/workflow.
Variants§
Auto
Use a token when one is available (CARGO_REGISTRY_TOKEN); otherwise,
when an OIDC context is present, mint a Trusted-Publishing token.
Errors only when neither is available.
Token
Always authenticate with the token; never attempt OIDC. Errors if
CARGO_REGISTRY_TOKEN is unset. This is anodizer’s historical
behaviour.
Oidc
Always authenticate with OIDC (Trusted Publishing); never fall back to
the token. Errors if the GitHub Actions OIDC request env
(ACTIONS_ID_TOKEN_REQUEST_URL / _TOKEN) is absent, so a
misconfigured Trusted Publisher fails the release loudly instead of
silently falling back to a token.
Trait Implementations§
Source§impl Clone for CargoAuthMode
impl Clone for CargoAuthMode
Source§fn clone(&self) -> CargoAuthMode
fn clone(&self) -> CargoAuthMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CargoAuthMode
Source§impl Debug for CargoAuthMode
impl Debug for CargoAuthMode
Source§impl Default for CargoAuthMode
impl Default for CargoAuthMode
Source§fn default() -> CargoAuthMode
fn default() -> CargoAuthMode
Source§impl<'de> Deserialize<'de> for CargoAuthMode
impl<'de> Deserialize<'de> for CargoAuthMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for CargoAuthMode
Source§impl JsonSchema for CargoAuthMode
impl JsonSchema for CargoAuthMode
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for CargoAuthMode
impl PartialEq for CargoAuthMode
Source§impl Serialize for CargoAuthMode
impl Serialize for CargoAuthMode
impl StructuralPartialEq for CargoAuthMode
Auto Trait Implementations§
impl Freeze for CargoAuthMode
impl RefUnwindSafe for CargoAuthMode
impl Send for CargoAuthMode
impl Sync for CargoAuthMode
impl Unpin for CargoAuthMode
impl UnsafeUnpin for CargoAuthMode
impl UnwindSafe for CargoAuthMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.