Skip to content

authority_credentials

Structs

Enums


firma_sidecar::authority_credentials::CredentialSource

Section titled “firma_sidecar::authority_credentials::CredentialSource”

Enum

Mutually exclusive credential sources after schema validation.

Variants:

  • PreSharedKeyEnv(String) - Environment variable containing a pre-shared key.
  • PreSharedKeyFile(std::path::PathBuf) - File containing a pre-shared key.
  • Runtime{ env: String, run_id: firma_identifiers::RunId } - Runtime bearer environment variable and its validated run.

Traits: Eq

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Clone
    • fn clone(self: &Self) -> Self
  • PartialEq
    • fn eq(self: &Self, other: &Self) -> bool

firma_sidecar::authority_credentials::RedactedPreSharedKey

Section titled “firma_sidecar::authority_credentials::RedactedPreSharedKey”

Struct

Pre-shared key wrapper with redacted debug output.

Tuple Struct: ()

Traits: Eq

Trait Implementations:

  • Clone
    • fn clone(self: &Self) -> Self
  • PartialEq
    • fn eq(self: &Self, other: &Self) -> bool
  • Debug
    • fn fmt(self: &Self, formatter: & mut fmt::Formatter) -> fmt::Result

firma_sidecar::authority_credentials::ResolvedSidecarCredentials

Section titled “firma_sidecar::authority_credentials::ResolvedSidecarCredentials”

Struct

Resolved Sidecar credentials ready to attach to Authority requests.

Traits: Eq

Trait Implementations:

  • Clone
    • fn clone(self: &Self) -> Self
  • PartialEq
    • fn eq(self: &Self, other: &Self) -> bool
  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result

firma_sidecar::authority_credentials::RuntimeCredential

Section titled “firma_sidecar::authority_credentials::RuntimeCredential”

Struct

The runtime credential of one run: a bearer the Authority issued at activation, valid while that run is live.

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Clone
    • fn clone(self: &Self) -> Self

firma_sidecar::authority_credentials::SidecarCredential

Section titled “firma_sidecar::authority_credentials::SidecarCredential”

Enum

How a Sidecar authenticates to the Authority.

Variants:

  • PreSharedKey(ResolvedSidecarCredentials) - An enrolled Sidecar’s pre-shared key, sent in request bodies and
  • Runtime(RuntimeCredential) - One run’s runtime credential, sent as a bearer in the metadata

Methods:

  • fn run_id(self: &Self) -> Option<&RunId> - The run a runtime credential is scoped to.
  • fn runtime_bearer(self: &Self) -> Option<&str> - The runtime credential itself, for the one holder that hands it to
  • fn body_credentials(self: &Self) -> Option<SidecarCredentials> - The request body field a pre-shared key travels in; a runtime
  • fn authenticated<T>(credentials: Option<&Self>, message: T) -> tonic::Request<T> - message as the request credentials authenticates; keyless when

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Clone
    • fn clone(self: &Self) -> Self

firma_sidecar::authority_credentials::SidecarCredentialSource

Section titled “firma_sidecar::authority_credentials::SidecarCredentialSource”

Enum

Resolved credential source, kept for startup logging.

Variants:

  • Env(String) - PSK was read from an environment variable.
  • File(std::path::PathBuf) - PSK was read from a file.

Traits: Eq

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Clone
    • fn clone(self: &Self) -> Self
  • PartialEq
    • fn eq(self: &Self, other: &Self) -> bool

firma_sidecar::authority_credentials::SidecarCredentialsConfig

Section titled “firma_sidecar::authority_credentials::SidecarCredentialsConfig”

Struct

Validated source for Sidecar credentials: one pre-shared key source, or one run’s runtime credential.

Fields:

  • workspace_id: String - Workspace the Sidecar belongs to.
  • sidecar_id: String - Authority-assigned Sidecar identity.
  • source: CredentialSource - The single validated credential source.

Methods:

  • fn rebase_defaults(self: & mut Self, config_dir: &Path) - Re-base a relative PSK file path against the config directory.
  • fn resolve(self: &Self) -> Result<SidecarCredential, String> - Resolve the configured source into an in-memory credential.
  • fn runtime_credential_env_name(self: &Self) -> Option<&str> - The variable the runtime credential is read from, in runtime mode.
  • fn uses_runtime_credential(self: &Self) -> bool - Whether this configuration authenticates one run with its
  • fn runtime_credential(self: &Self, value: &str) -> Result<SidecarCredential, String> - The runtime credential value, scoped to the configured run:

Traits: Eq

Trait Implementations:

  • TryFrom
    • fn try_from(schema: SchemaSidecarCredentials) -> Result<Self, <Self as >::Error>
  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Clone
    • fn clone(self: &Self) -> Self
  • PartialEq
    • fn eq(self: &Self, other: &Self) -> bool

firma_sidecar::authority_credentials::SidecarCredentialsConfigError

Section titled “firma_sidecar::authority_credentials::SidecarCredentialsConfigError”

Enum

Error validating a [SidecarCredentialsConfig].

Variants:

  • EmptyWorkspaceId - workspace_id was empty.
  • EmptySidecarId - sidecar_id was empty.
  • MissingCredentialSource - No credential source was set.
  • MultipleCredentialSources - More than one credential source was set.
  • RuntimeCredentialAndRunMismatch - runtime_credential_env and run_id were not set together.
  • InvalidRunId - The run was not a canonical run identifier.

Traits: Error, Eq

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Display
    • fn fmt(self: &Self, __formatter: & mut ::core::fmt::Formatter) -> ::core::fmt::Result
  • Clone
    • fn clone(self: &Self) -> Self
  • PartialEq
    • fn eq(self: &Self, other: &Self) -> bool