apache / apache/opendal-reqsign
Add Azure Storage Config parsing from a connection string
- Dominant language
- Rust
- Stars
- 169
- Forks
- 75
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 16
Description
Azure Storage SDKs allow you to connect via [connection strings](https://learn.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string). They are basically stringified versions of a subset the `reqsign_azure_storage::Config` struct's fields.
This relates to https://github.com/apache/opendal/issues/6211 but I think it makes sense to also add it to `reqsign` as it's more or less analogous to the already existing `Config::from_env()`: https://github.com/Xuanwo/reqsign/blob/e88f8878b22ef6eb61edc33fc87d46e1866eeae2/services/azure-storage/src/config.rs#L89
### Implementation Note
The [endpoint](https://github.com/Xuanwo/reqsign/blob/e88f8878b22ef6eb61edc33fc87d46e1866eeae2/services/azure-storage/src/config.rs#L50) of the Config is dependent on the Storage service used. With Azure Blob Storage for example, a connection string could contain either `BlobEndpoint=https://myaccount.blob.core.windows.net` or `DefaultEndpointsProtocol =https;AccountName=myaccount;EndpointSuffix=core.windows.net`.
The current implementation of `Config::from_env` [seems to assume](https://github.com/Xuanwo/reqsign/blob/e88f8878b22ef6eb61edc33fc87d46e1866eeae2/services/azure-storage/src/config.rs#L82) that a user wants to connect to Blob Storage endpoints. A first version of connection string parsing can make the same assumption. This would translate to looking at `BlobEndpoint` or formatting an endpoint from it's parts in a format like `"{DefaultEndpointsProtocol}://{AccountName}.blob.{EndpointSuffix}"` (note the literal `blob`).
There are other Azure Storage services that require a feature-complete parsing function to look at different values (`QueueEndpoint`, `FileEndpoint` or `TableEndpoint`) or use different storage service names when building up the endpoint from its parts (e.g. `dfs` for ADLSv2).
Since the current version of `Config` really is a `BlobConfig`, I believe this warrants its own issue (I will create one soon).
Contributor guide
Research direction
Start in services/azure-storage/src/config.rs, especially Config::from_env and the Config endpoint handling described in the issue. Review the Azure connection-string format and existing Config fields, then implement the Blob Storage assumption using BlobEndpoint or the documented endpoint parts. Done means supported connection strings produce a usable Config for Blob Storage, with behavior covered by the relevant existing tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100