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
AwsS3
Connects to AWS S3 or an explicitly configured S3-compatible endpoint.
Fields
endpoint_url: Option<String>Service endpoint override, or None to derive the regional AWS endpoint.
access_key_id: SecretStringAccess-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: SecretStringSecret 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.
CloudflareR2
Connects to Cloudflare R2 through its S3-compatible endpoint.
Fields
access_key_id: SecretStringS3-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: SecretStringS3-compatible secret used for requests and direct-upload signing.
Absent here means AWS_SECRET_ACCESS_KEY.
GcpGcs
Connects to Google Cloud Storage through its native generation-aware API.
Fields
AzureAbs
Connects to Azure Blob Storage through its native shared-key API.
Fields
access_key: SecretStringShared account key used for request authentication.
Implementations§
Source§impl StoreConfig
impl StoreConfig
Sourcepub fn kind(&self) -> ConfiguredObjectStoreKind
pub fn kind(&self) -> ConfiguredObjectStoreKind
The provider kind this configuration selects.
Sourcepub fn direct_put_is_proven(&self) -> bool
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.
Sourcepub fn configured_object_store(&self) -> Result<ConfiguredObjectStore>
pub fn configured_object_store(&self) -> Result<ConfiguredObjectStore>
Builds the configured runtime object store for this provider.
Sourcepub fn apply_env_credentials(&mut self)
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.
Sourcepub fn validate(&self) -> Result<(), StoreConfigError>
pub fn validate(&self) -> Result<(), StoreConfigError>
Checks required fields and URL shapes, reporting store.-rooted field
paths.
Trait Implementations§
Source§impl Clone for StoreConfig
impl Clone for StoreConfig
Source§fn clone(&self) -> StoreConfig
fn clone(&self) -> StoreConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StoreConfig
impl Debug for StoreConfig
Source§impl<'de> Deserialize<'de> for StoreConfig
impl<'de> Deserialize<'de> for StoreConfig
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 StoreConfig
Source§impl PartialEq for StoreConfig
impl PartialEq for StoreConfig
Source§impl Serialize for StoreConfig
impl Serialize for StoreConfig
impl StructuralPartialEq for StoreConfig
Auto Trait Implementations§
impl Freeze for StoreConfig
impl RefUnwindSafe for StoreConfig
impl Send for StoreConfig
impl Sync for StoreConfig
impl Unpin for StoreConfig
impl UnsafeUnpin for StoreConfig
impl UnwindSafe for StoreConfig
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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