Skip to main content

StoreConfig

Enum StoreConfig 

Source
pub enum StoreConfig {
    LocalFs {
        root: String,
        key_prefix: Option<String>,
    },
    AwsS3 {
        bucket: String,
        region: String,
        endpoint_url: Option<String>,
        access_key_id: SecretString,
        secret_access_key: SecretString,
        session_token: Option<SecretString>,
        key_prefix: Option<String>,
        force_path_style: bool,
    },
    CloudflareR2 {
        bucket: String,
        account_id: String,
        endpoint_url: String,
        access_key_id: SecretString,
        secret_access_key: SecretString,
        key_prefix: Option<String>,
    },
    GcpGcs {
        bucket: String,
        service_account_key_path: String,
        key_prefix: Option<String>,
    },
    AzureAbs {
        account_name: String,
        container_name: String,
        access_key: SecretString,
        endpoint_url: Option<String>,
        key_prefix: Option<String>,
    },
}
Expand description

Provider selection plus credentials, as written in config files.

Serialization is transparent for secret fields and therefore writes the real credentials; only serialize a StoreConfig::redacted copy into display output.

§Credential precedence

The S3-compatible credential fields may be left out of the file and supplied through the standard environment instead — see StoreConfig::apply_env_credentials. A non-blank value in the file always wins; blank environment values are ignored. Loading a config is what decides whether that fallback applies, so each caller says for itself: the server’s loader applies it, the CLI’s profile loader does not (a profile stores what it was created with).

Variants§

§

LocalFs

Stores objects beneath a Unix-family directory using atomic filesystem replacement.

Fields

§root: String

Directory created or opened as the physical store root.

§key_prefix: Option<String>

Logical prefix applied inside root, or None to expose it directly.

§

AwsS3

Connects to AWS S3 or an explicitly configured S3-compatible endpoint.

Fields

§bucket: String

Bucket that acts as the physical store root.

§region: String

SigV4 signing region.

§endpoint_url: Option<String>

Service endpoint override, or None to derive the regional AWS endpoint.

§access_key_id: SecretString

Access-key id used for provider requests and direct-upload signing. Absent here means AWS_ACCESS_KEY_ID, for loaders that apply the environment fallback.

§secret_access_key: SecretString

Secret access key used for provider requests and direct-upload signing. Absent here means AWS_SECRET_ACCESS_KEY, for loaders that apply the environment fallback.

§session_token: Option<SecretString>

Temporary credential token, or None for long-lived credentials.

§key_prefix: Option<String>

Logical prefix applied inside the bucket, or None to expose its root.

§force_path_style: bool

Uses path-style bucket addressing when true; defaults to virtual-hosted style.

§

CloudflareR2

Connects to Cloudflare R2 through its S3-compatible endpoint.

Fields

§bucket: String

R2 bucket that acts as the physical store root.

§account_id: String

Cloudflare account identity used to validate provider configuration.

§endpoint_url: String

Account-level R2 S3 endpoint used with path-style bucket addressing.

§access_key_id: SecretString

S3-compatible access-key id used for requests and direct-upload signing. R2 speaks the S3 API, so an absent value here means AWS_ACCESS_KEY_ID too.

§secret_access_key: SecretString

S3-compatible secret used for requests and direct-upload signing. Absent here means AWS_SECRET_ACCESS_KEY.

§key_prefix: Option<String>

Logical prefix applied inside the bucket, or None to expose its root.

§

GcpGcs

Connects to Google Cloud Storage through its native generation-aware API.

Fields

§bucket: String

GCS bucket that acts as the physical store root.

§service_account_key_path: String

Filesystem path to the service-account JSON used for authentication.

§key_prefix: Option<String>

Logical prefix applied inside the bucket, or None to expose its root.

§

AzureAbs

Connects to Azure Blob Storage through its native shared-key API.

Fields

§account_name: String

Azure storage account used for addressing and signing.

§container_name: String

Blob container that acts as the physical store root.

§access_key: SecretString

Shared account key used for request authentication.

§endpoint_url: Option<String>

Azure-compatible endpoint override, or None for the public service.

§key_prefix: Option<String>

Logical prefix applied inside the container, or None to expose its root.

Implementations§

Source§

impl StoreConfig

Source

pub fn kind(&self) -> ConfiguredObjectStoreKind

The provider kind this configuration selects.

Source

pub fn direct_put_is_proven(&self) -> bool

Whether this endpoint is one whose direct-put preconditions the live conformance suite has actually proven.

direct_put hands a client a presigned URL and then trusts the provider to have enforced the signed checksum and create-only preconditions — completion never reads the bytes back. Only first-party AWS S3 and Cloudflare R2 endpoints have been run against that suite, so only they earn the trust. An endpoint override outside the provider’s own domain family is some other implementation of the S3 API and is not covered by those runs.

Providers without a presigner at all (local filesystem, GCS, Azure) never reach this question: direct_put is unavailable for them because ConfiguredObjectStore::transfer_issuer returns None.

Source

pub fn configured_object_store(&self) -> Result<ConfiguredObjectStore>

Builds the configured runtime object store for this provider.

Source

pub fn apply_env_credentials(&mut self)

Fills blank S3-compatible credential fields from the standard environment variables, so a config file need not carry secrets at all.

A non-blank value in the file always wins, and a blank environment value is ignored rather than stored and later rejected. Providers with no standard variable of their own — local filesystem, GCS, Azure — are untouched: inventing a name for them would be a guess.

Call this after decoding and before Self::validate, so a config that relies on the environment passes validation and one that does not is reported against the field it actually lacks.

Source

pub fn validate(&self) -> Result<(), StoreConfigError>

Checks required fields and URL shapes, reporting store.-rooted field paths.

Source

pub fn redacted(&self) -> Self

Returns a copy whose secret fields hold the redaction placeholder, for serialization into show-style display output.

Trait Implementations§

Source§

impl Clone for StoreConfig

Source§

fn clone(&self) -> StoreConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StoreConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for StoreConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for StoreConfig

Source§

impl PartialEq for StoreConfig

Source§

fn eq(&self, other: &StoreConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for StoreConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for StoreConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more