pub enum NpmAuthMode {
Auto,
Token,
Oidc,
}Expand description
Credential-selection strategy for an NpmConfig entry.
Controls whether the publisher authenticates with a long-lived registry
token (NPM_TOKEN / cfg.token) or with GitHub Actions OIDC (npm Trusted
Publishing), evaluated per published package — in optional-deps mode
that means the metapackage and every per-platform sub-package are decided
independently, so a metapackage with a configured Trusted Publisher can use
OIDC while brand-new sub-packages (which Trusted Publishing cannot create)
fall back to the token.
Variants§
Auto
Decide per package at publish time (default). The registry is probed for
each package’s existence: a package that already exists prefers OIDC
(Trusted Publishing) when an OIDC context is present, otherwise the
token; a brand-new package always uses the token (Trusted Publishing
cannot create a package that does not yet exist) and hard-errors if no
token is set. When OIDC is chosen for an existing package and the
publish fails, auto retries that package with the token (if available)
and emits a loud warning that Trusted Publishing was not exercised.
Token
Always authenticate with the token (NPM_TOKEN / cfg.token); never
attempt OIDC. Errors if no token is available. This is anodizer’s
historical behaviour.
Oidc
Always authenticate with OIDC (Trusted Publishing); never fall back to the token. Errors if the OIDC request env is absent. Use when every package in this entry has a configured Trusted Publisher and you want a failed exchange to fail the release loudly rather than silently fall back to a token.
Trait Implementations§
Source§impl Clone for NpmAuthMode
impl Clone for NpmAuthMode
Source§fn clone(&self) -> NpmAuthMode
fn clone(&self) -> NpmAuthMode
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 NpmAuthMode
Source§impl Debug for NpmAuthMode
impl Debug for NpmAuthMode
Source§impl Default for NpmAuthMode
impl Default for NpmAuthMode
Source§fn default() -> NpmAuthMode
fn default() -> NpmAuthMode
Source§impl<'de> Deserialize<'de> for NpmAuthMode
impl<'de> Deserialize<'de> for NpmAuthMode
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 NpmAuthMode
Source§impl JsonSchema for NpmAuthMode
impl JsonSchema for NpmAuthMode
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 NpmAuthMode
impl PartialEq for NpmAuthMode
Source§impl Serialize for NpmAuthMode
impl Serialize for NpmAuthMode
impl StructuralPartialEq for NpmAuthMode
Auto Trait Implementations§
impl Freeze for NpmAuthMode
impl RefUnwindSafe for NpmAuthMode
impl Send for NpmAuthMode
impl Sync for NpmAuthMode
impl Unpin for NpmAuthMode
impl UnsafeUnpin for NpmAuthMode
impl UnwindSafe for NpmAuthMode
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.