-
-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Problem
As mentioned in #522, Config::from_env
assumes that a user intents to parse an Azure Blob Storage config:
https://github.com/Xuanwo/reqsign/blob/e88f8878b22ef6eb61edc33fc87d46e1866eeae2/services/azure-storage/src/config.rs#L89
While some of the environment variables looked at are generic (e.g. AZURE_TENANT_ID
), others are specific to blob storage (e.g. AZBLOB_ENDPOINT
).
The reqsign-azure-storage::Config
struct is already used to configure non-blob Azure Storage services (e.g. in OpenDAL's services-azdls
and services-azfile
). For this reason, I believe we should adapt Config::from_env
to make it support those other services too.
Proposal
#524 proposes to add a Service
enum with different types of storage services. It starts using it as an argument to Config::try_from_connection_string
.
Since Config::from_env
already exists it would be easiest to add another function like Config::from_env_with_service
that accepts this parameter too, potentially marking the current function as deprecated.