Skip to content

feat(services/oss): support ECS RAM role credentials#7480

Merged
Xuanwo merged 1 commit into
apache:mainfrom
WenyXu:patch_reqsign
May 7, 2026
Merged

feat(services/oss): support ECS RAM role credentials#7480
Xuanwo merged 1 commit into
apache:mainfrom
WenyXu:patch_reqsign

Conversation

@WenyXu
Copy link
Copy Markdown
Member

@WenyXu WenyXu commented May 7, 2026

Which issue does this PR close?

Closes #.

apache/opendal-reqsign#742

Rationale for this change

OSS currently supports loading credentials from environment variables, static access keys, and OIDC assume-role flow. However, it doesn't include ECS RAM role credentials in the default credential chain.
This makes OSS fail to authenticate in Alibaba Cloud ECS environments where credentials are expected to come from the instance RAM role.

What changes are included in this PR?

Add EcsRamRoleCredentialProvider into OSS's default credential provider chain.
With this change, OSS now resolves credentials in the following order:

  1. Static access key and secret configured explicitly
  2. Environment-based credentials
  3. ECS RAM role credentials
  4. OIDC assume-role credentials

Are there any user-facing changes?

Yes. OSS can now authenticate with ECS RAM role credentials automatically when running inside supported Alibaba Cloud ECS environments, without requiring users to provide access key credentials explicitly.

AI Usage Statement

Copilot AI review requested due to automatic review settings May 7, 2026 07:58
@WenyXu WenyXu requested a review from Xuanwo as a code owner May 7, 2026 07:58
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels May 7, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the Aliyun OSS service’s default credential resolution chain to support Alibaba Cloud ECS instance RAM role credentials, enabling automatic authentication in ECS environments without explicitly configured access keys.

Changes:

  • Add EcsRamRoleCredentialProvider to the OSS default ProvideCredentialChain.
  • Update OSS credential resolution order to: explicit static keys (if configured) → env credentials → ECS RAM role credentials → OIDC assume-role credentials.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 7, 2026
@Xuanwo Xuanwo merged commit dc26789 into apache:main May 7, 2026
108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants