pub struct UnityObjectStoreFactory { /* private fields */ }Expand description
Factory that mints object_store instances backed by Unity Catalog
credential vending.
Implementations§
Source§impl UnityObjectStoreFactory
impl UnityObjectStoreFactory
pub fn builder() -> UnityObjectStoreFactoryBuilder
Sourcepub fn with_forwarded_user(
&self,
header: &str,
user: Option<&str>,
) -> Result<Self>
pub fn with_forwarded_user( &self, header: &str, user: Option<&str>, ) -> Result<Self>
Derive a factory that forwards a trusted reverse-proxy identity header on every upstream Unity Catalog request (both the metadata lookups and the credential vend).
Intended for a service — e.g. the standalone storage byte-proxy — that sits behind the same reverse proxy as the upstream UC and has already validated the caller’s identity. Forwarding the header verbatim lets UC’s own reverse-proxy authenticator attribute the vend to the real end user.
Semantics:
user == None(anonymous request) → returnsselfcloned unchanged, so the upstream calls use whatever auth the base factory was built with (its static token, or unauthenticated). Zero added cost.user == Some(name)→ returns a factory whose upstream transport is unauthenticated and injectsheader: nameon every request. The base factory’s static token is intentionally dropped for these calls: the forwarded identity is the auth, not the proxy’s own principal.
header is the outgoing header name (typically the same
x-forwarded-user the proxy read the identity from). Returns an error if
header or name is not a valid HTTP header name / value.
Native-only: on wasm32 identity is forwarded by the browser session, so
this method is absent.
Sourcepub fn unity_client(&self) -> &UnityCatalogClient
pub fn unity_client(&self) -> &UnityCatalogClient
Borrow the underlying UnityCatalogClient for catalog metadata
operations (listing volumes, resolving table names, …).
Sourcepub fn credentials_client(&self) -> &TemporaryCredentialClient
pub fn credentials_client(&self) -> &TemporaryCredentialClient
Borrow the underlying credential-vending client. Most users want
for_url / for_volume /
for_table / for_path instead.
Sourcepub async fn for_url(&self, url: &str, op: Operation) -> Result<UCStore>
pub async fn for_url(&self, url: &str, op: Operation) -> Result<UCStore>
Build an UCStore for any supported URL.
See UCReference for the supported URL grammar. Raw cloud URLs
(s3://, gs://, abfss://, …) are routed to
for_path.
Sourcepub async fn for_table(
&self,
table: impl Into<TableReference>,
operation: TableOperation,
) -> Result<UCStore>
pub async fn for_table( &self, table: impl Into<TableReference>, operation: TableOperation, ) -> Result<UCStore>
Vend credentials for a table and return a prefixed store rooted at the table’s storage location.
The table argument accepts a Uuid, a String / &str
containing a three-level <catalog>.<schema>.<table> name, or any
TableReference.
Sourcepub async fn for_volume(
&self,
volume: impl Into<VolumeReference>,
operation: VolumeOperation,
) -> Result<UCStore>
pub async fn for_volume( &self, volume: impl Into<VolumeReference>, operation: VolumeOperation, ) -> Result<UCStore>
Vend credentials for a volume and return a prefixed store rooted at the volume’s storage location.
A volume whose storage location is a file:// path is served by a local
LocalFileSystem store and never hits the credential-vending API —
local storage has no cloud credential to vend.
Sourcepub async fn for_path(
&self,
path: &Url,
operation: PathOperation,
) -> Result<UCStore>
pub async fn for_path( &self, path: &Url, operation: PathOperation, ) -> Result<UCStore>
Vend credentials for a raw cloud URL (s3://, gs://, abfss://,
…). Uses temporary-path-credentials under the hood.
file:// URLs are served by a local LocalFileSystem store and
never hit the credential-vending API — local storage has no cloud
credential to vend.
Sourcepub async fn dry_run_path(
&self,
path: &Url,
operation: PathOperation,
) -> Result<UCStore>
pub async fn dry_run_path( &self, path: &Url, operation: PathOperation, ) -> Result<UCStore>
Vend credentials for a raw cloud URL with dry_run set to true.
The server validates that credentials could be issued but the
returned token is not usable for IO; useful for permission probes.
For file:// URLs there is nothing to probe — a local store is
returned directly, identical to for_path.
Trait Implementations§
Source§impl Clone for UnityObjectStoreFactory
impl Clone for UnityObjectStoreFactory
Source§fn clone(&self) -> UnityObjectStoreFactory
fn clone(&self) -> UnityObjectStoreFactory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for UnityObjectStoreFactory
impl !UnwindSafe for UnityObjectStoreFactory
impl Freeze for UnityObjectStoreFactory
impl Send for UnityObjectStoreFactory
impl Sync for UnityObjectStoreFactory
impl Unpin for UnityObjectStoreFactory
impl UnsafeUnpin for UnityObjectStoreFactory
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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