pub struct DynamicStorageOptionsCredentialProvider { /* private fields */ }Expand description
AWS Credential Provider that uses StorageOptionsProvider
This adapter converts our generic StorageOptionsProvider trait into AWS-specific credentials that can be used with S3. It caches credentials and automatically refreshes them before they expire.
§Future Work
TODO: Support AWS/GCP/Azure together in a unified credential provider. Currently this is AWS-specific. Needs investigation of how GCP and Azure credential refresh mechanisms work and whether they can be unified with AWS’s approach.
See: https://github.com/lance-format/lance/pull/4905#discussion_r2474605265
Implementations§
Source§impl DynamicStorageOptionsCredentialProvider
impl DynamicStorageOptionsCredentialProvider
Sourcepub fn new(
provider: Arc<dyn StorageOptionsProvider>,
refresh_offset: Duration,
) -> Self
pub fn new( provider: Arc<dyn StorageOptionsProvider>, refresh_offset: Duration, ) -> Self
Create a new credential provider without initial credentials
§Arguments
provider- The storage options providerrefresh_offset- Duration before expiry to refresh credentials
Sourcepub fn new_with_initial_credential(
provider: Arc<dyn StorageOptionsProvider>,
refresh_offset: Duration,
credential: Arc<ObjectStoreAwsCredential>,
expires_at_millis: u64,
) -> Self
pub fn new_with_initial_credential( provider: Arc<dyn StorageOptionsProvider>, refresh_offset: Duration, credential: Arc<ObjectStoreAwsCredential>, expires_at_millis: u64, ) -> Self
Create a new credential provider with initial credentials from an explicit credential
§Arguments
provider- The storage options providerrefresh_offset- Duration before expiry to refresh credentialscredential- Initial credential to cacheexpires_at_millis- Expiration time in milliseconds since epoch (required for refresh)
Trait Implementations§
Source§impl CredentialProvider for DynamicStorageOptionsCredentialProvider
impl CredentialProvider for DynamicStorageOptionsCredentialProvider
Source§type Credential = AwsCredential
type Credential = AwsCredential
The type of credential returned by this provider
Source§fn get_credential<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<Arc<Self::Credential>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_credential<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ObjectStoreResult<Arc<Self::Credential>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return a credential
Auto Trait Implementations§
impl Freeze for DynamicStorageOptionsCredentialProvider
impl !RefUnwindSafe for DynamicStorageOptionsCredentialProvider
impl Send for DynamicStorageOptionsCredentialProvider
impl Sync for DynamicStorageOptionsCredentialProvider
impl Unpin for DynamicStorageOptionsCredentialProvider
impl !UnwindSafe for DynamicStorageOptionsCredentialProvider
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
Mutably borrows from an owned value. Read more
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>
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 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>
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 moreCreates a shared type from an unshared type.