Skip to main content

UnityObjectStoreFactory

Struct UnityObjectStoreFactory 

Source
pub struct UnityObjectStoreFactory { /* private fields */ }
Expand description

Factory that mints object_store instances backed by Unity Catalog credential vending.

Implementations§

Source§

impl UnityObjectStoreFactory

Source

pub fn builder() -> UnityObjectStoreFactoryBuilder

Source

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) → returns self cloned 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 injects header: name on 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.

Source

pub fn unity_client(&self) -> &UnityCatalogClient

Borrow the underlying UnityCatalogClient for catalog metadata operations (listing volumes, resolving table names, …).

Source

pub fn credentials_client(&self) -> &TemporaryCredentialClient

Borrow the underlying credential-vending client. Most users want for_url / for_volume / for_table / for_path instead.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> UnityObjectStoreFactory

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

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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