pub struct S3OriginConfig {
pub bucket: String,
pub region: String,
pub endpoint_url: Option<OriginUrl>,
pub path_style: bool,
pub prefix: String,
pub credentials: Option<S3Credentials>,
}Expand description
Validated, runtime-ready configuration for an S3Origin.
This is the cache-crate’s parallel of decdn_common::config::ResolvedS3Config
— the wiring layer in decdn-node does the conversion when constructing
the engine. Keeping the type here means decdn-cache doesn’t depend on
decdn-common (which would be circular: common -> cache is the
established direction so the resolved-config types can carry parsed
OriginUrls).
Construction is field-init at the call site; the wiring layer enforces
that the values come from decdn_common::config::resolve_origin, the
only producer that runs the bucket-name / region / endpoint-URL
validators.
The Debug impl is manual rather than derived: it forwards every
field through the S3Credentials redaction wrapper so an incidental
tracing::debug!(?cfg) or panic-backtrace formatter cannot leak the
access-key / secret-key bytes. The #[derive(Debug)] would print them
in cleartext (the wrapped Strings lost their SecretString discipline
at the resolve→runtime boundary in decdn-node). Mirrors the pattern
established by decdn_common::config::secret::SecretString (same crate
can’t be intra-doc-linked because decdn-cache deliberately does not
depend on decdn-common).
Fields§
§bucket: StringBucket name. Validated DNS-safe at config-resolve time.
region: StringAWS region.
endpoint_url: Option<OriginUrl>Custom endpoint URL for non-AWS S3-compatible services
(R2, B2, MinIO). Parsed and trailing-slash-normalized.
path_style: booltrue selects path-style addressing (https://endpoint/{bucket}/{key}),
required by MinIO and some on-prem providers. The SDK default
(false) is virtual-hosted-style (https://{bucket}.s3.amazonaws.com/{key}).
prefix: StringTrailing-slash-normalized object key prefix prepended to every fetched object. Empty string means no prefix.
credentials: Option<S3Credentials>Credential source. None is treated identically to
Some(S3Credentials::DefaultChain { profile: None }) — the SDK’s
stock chain (env, profile, container/instance role).
Trait Implementations§
Source§impl Clone for S3OriginConfig
impl Clone for S3OriginConfig
Auto Trait Implementations§
impl Freeze for S3OriginConfig
impl RefUnwindSafe for S3OriginConfig
impl Send for S3OriginConfig
impl Sync for S3OriginConfig
impl Unpin for S3OriginConfig
impl UnsafeUnpin for S3OriginConfig
impl UnwindSafe for S3OriginConfig
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,
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