apache / apache/opendal-reqsign

feat(azure-storage): Support non-Blob services with Config::from_env

Open
#525 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
169
Forks
75
Avg merge
1d 21h
Merged PRs (30d)
16

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`](https://github.com/Xuanwo/reqsign/blob/e88f8878b22ef6eb61edc33fc87d46e1866eeae2/services/azure-storage/src/config.rs#L78)), others are specific to blob storage (e.g. [`AZBLOB_ENDPOINT`](https://github.com/Xuanwo/reqsign/blob/e88f8878b22ef6eb61edc33fc87d46e1866eeae2/services/azure-storage/src/config.rs#L82)).

The `reqsign-azure-storage::Config` struct is already used to configure non-blob Azure Storage services (e.g. in OpenDAL's [`services-azdls`](https://github.com/apache/opendal/blob/cdb9871d16117b7b0645b7e31011ee350c9895e2/core/src/services/azdls/backend.rs#L25) and [`services-azfile`](https://github.com/apache/opendal/blob/cdb9871d16117b7b0645b7e31011ee350c9895e2/core/src/services/azfile/backend.rs#L25)). 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.

Contributor guide

Open the contributing guide

Research direction

Start in services/azure-storage/src/config.rs, focusing on Config::from_env and Config::try_from_connection_string, then read proposal #524 for the Service enum and its intended values. The work is done when environment parsing can select non-Blob Azure Storage services through a function such as Config::from_env_with_service, while the existing Config::from_env behavior is addressed as proposed.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, rust
Domain
cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.