Skip to content

fix(object_storage): make credentials optional for ABS/OSS/OBS/COS#1753

Merged
gaius-qi merged 1 commit intomainfrom
feature/object-storage
Mar 30, 2026
Merged

fix(object_storage): make credentials optional for ABS/OSS/OBS/COS#1753
gaius-qi merged 1 commit intomainfrom
feature/object-storage

Conversation

@gaius-qi
Copy link
Copy Markdown
Member

Description

This pull request refactors the credential handling logic for various object storage backends in object_storage.rs. The main change is to require only the endpoint field as mandatory for Azure Blob Storage (ABS), Alibaba Cloud OSS, Huawei OBS, and Tencent COS backends, while making access key ID and secret optional. Credentials are now set conditionally if provided, and test cases are updated to reflect the new requirements.

Credential Handling Refactor:

  • Changed the initialization of ABS, OSS, OBS, and COS operators to require only the endpoint field as mandatory; access key ID and secret are now optional and set only if provided. This simplifies configuration and improves compatibility with different authentication methods. [1] [2] [3] [4] [5] [6] [7] [8]

  • Updated builder logic for each backend to set credentials (access_key_id, access_key_secret, etc.) only if they are present, instead of requiring them up front. [1] [2] [3] [4]

Test Updates:

  • Modified test cases to expect errors only when endpoint is missing, rather than when access keys are missing, aligning with the new credential requirements. [1] [2] [3] [4] [5] [6] [7] [8]

Documentation and Comments:

  • Updated and clarified comments to indicate that only the endpoint is required and that the default endpoint will be used if not provided for GCS.

Minor Code Cleanups:

  • Removed unnecessary newlines and improved formatting in test case definitions.

Bug Fixes:

  • Fixed a logic error where a block was terminated with a semicolon instead of a brace in the GCS endpoint configuration.

Related Issue

Motivation and Context

Screenshots (if appropriate)

@gaius-qi gaius-qi added this to the v2.5.0 milestone Mar 30, 2026
@gaius-qi gaius-qi self-assigned this Mar 30, 2026
@gaius-qi gaius-qi requested review from a team as code owners March 30, 2026 10:36
@gaius-qi gaius-qi requested review from chlins, jim3ma and mingcheng March 30, 2026 10:36
@gaius-qi gaius-qi added the enhancement New feature or request label Mar 30, 2026
@github-actions github-actions bot requested review from xujihui1985 and yxxhero March 30, 2026 10:36
@gaius-qi gaius-qi enabled auto-merge (squash) March 30, 2026 10:38
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.42%. Comparing base (ce8ac11) to head (d646d4e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1753      +/-   ##
==========================================
- Coverage   46.63%   46.42%   -0.22%     
==========================================
  Files          87       87              
  Lines       24807    24692     -115     
==========================================
- Hits        11569    11463     -106     
+ Misses      13238    13229       -9     
Files with missing lines Coverage Δ
dragonfly-client-backend/src/object_storage.rs 86.49% <100.00%> (-1.42%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gaius-qi gaius-qi merged commit 00f2bf7 into main Mar 30, 2026
9 checks passed
@gaius-qi gaius-qi deleted the feature/object-storage branch March 30, 2026 10:58
jonakeys pushed a commit to jonakeys/dragonfly-client that referenced this pull request Mar 30, 2026
…ragonflyoss#1753)

Signed-off-by: Gaius <gaius.qi@gmail.com>
Signed-off-by: Jonathan van der Steege <jonathan@jonakeys.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants