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.
Problem
As mentioned in #522,
Config::from_envassumes 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::Configstruct is already used to configure non-blob Azure Storage services (e.g. in OpenDAL'sservices-azdlsandservices-azfile). For this reason, I believe we should adaptConfig::from_envto make it support those other services too.Proposal
#524 proposes to add a
Serviceenum with different types of storage services. It starts using it as an argument toConfig::try_from_connection_string.Since
Config::from_envalready exists it would be easiest to add another function likeConfig::from_env_with_servicethat accepts this parameter too, potentially marking the current function as deprecated.