-
Notifications
You must be signed in to change notification settings - Fork 14
Infer default credential providers #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm still not sure this is a good idea. I'd prefer to nudge people towards the Rust-native authentication if that meets their needs. And these APIs look and feel very hacky. |
I agree it would be preferable to re-use the rust-native authentication if possible. I've updated my request to enable Azure CLI fallback upstream, as this would solve my immediate use case. Regarding the auto-selection of vendor credential providers based on URL scheme, how much of the hacky feel is due to my sample code, which I admit is indeed hacky, and how much is 'essential hackiness', which could not be avoided even if the general idea was carefully rewritten? For example, I could imagine reducing the hackiness by just passing through the def from_url(
url: str,
*,
config: S3Config | GCSConfig | AzureConfig | None = None,
client_options: ClientConfig | None = None,
retry_config: RetryConfig | None = None,
credential_provider: S3CredentialProvider
| GCSCredentialProvider
| AzureCredentialProvider
| None = None,
vendor_default_credential_provider=False, # <-- Add option to use vendor default credential providers
**kwargs: Any,
) -> ObjectStore:
...
scheme = _parse_scheme(url)
if scheme == "s3":
return S3Store.from_url(
url,
config=config,
client_options=client_options,
retry_config=retry_config,
credential_provider=credential_provider,
vendor_default_credential_provider=vendor_default_credential_provider, # <-- pass through to stores
**kwargs,
)
... |
I think a better way to solve this is with something like an object store registry https://docs.rs/datafusion/latest/datafusion/datasource/object_store/trait.ObjectStoreRegistry.html So that users can register ways to handle different protocols. So maybe for generic |
Would obstore provide a default / pre-configured object store registry, and allow users to override/extend as required? |
There probably wouldn't be a default registry, or at least not with these credential providers, because we need them to remain optional dependencies. |
Originally posted by @daviewales in #267
The text was updated successfully, but these errors were encountered: