Skip to content

fix: allow S3 storage to use default AWS credentials - #9893

Open
newlandj wants to merge 14 commits into
HumanSignal:developfrom
newlandj:fix/s3-optional-aws-credentials
Open

fix: allow S3 storage to use default AWS credentials#9893
newlandj wants to merge 14 commits into
HumanSignal:developfrom
newlandj:fix/s3-optional-aws-credentials

Conversation

@newlandj

@newlandj newlandj commented Aug 11, 2026

Copy link
Copy Markdown

Reason for change

The S3 storage forms require an access key ID and secret access key even though Label Studio already supports AWS's default credential chain. This prevents EKS Pod Identity, IRSA, environment credentials, and AWS profiles from being used.

Solution

  • allow the access key ID and secret access key to be blank in both S3 form configurations
  • add a focused unit test that verifies both fields accept blank values

Fixes #8847
Fixes #9130

Testing

  • Biome check for the changed TypeScript files
  • bun test --dom apps/labelstudio/src/pages/Settings/StorageSettings/providers/s3.test.ts (local dependency installation was incomplete; CI will run the test with the full frontend dependencies)

Acceptance criteria

  • An S3 import storage can be configured with blank access key and secret fields when the runtime has valid ambient AWS credentials.
  • An S3 export storage can be configured the same way.
  • The new storage form does not display required-field errors for blank AWS credential fields.
  • Explicit access key and secret values remain accepted.
  • The bucket field remains required.

Risks

Low. The change only restores optional validation for the two credential fields; backend credential resolution is unchanged.

Restore optional access key fields so environment credentials and IAM roles work in both storage forms.
@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

👷 Deploy request for label-studio-docs-new-theme pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c911984

@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

👷 Deploy request for heartex-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c911984

@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit c911984
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/6a7bf11a04eca2000838d91c
😎 Deploy Preview https://deploy-preview-9893--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit c911984
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/6a7bf11a5bddb900086ca05e
😎 Deploy Preview https://deploy-preview-9893--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the fix label Aug 11, 2026
Preserve explicit credential clearing, reject partial key pairs, and cover create and edit behavior for import and export storage.
@newlandj
newlandj marked this pull request as draft August 11, 2026 23:54
Avoid persisting connection-test values and protect session tokens while limiting credential-clearing behavior to S3.
Use only permission-checked storage state, validate partial updates, and keep explicit credentials separate from boto3's default chain.
Keep validation credentials out of the client cache while preserving complete prefixed environment credential aliases.
Carry the S3 no-cache marker through connection checks and preview candidates so canceled edits retain no clients.
Apply the S3 validation marker to export creation so failed candidates retain no clients.
Treat unrecognized AWS client errors as validation failures for create and update flows.
Convert botocore configuration and provider failures into user-facing validation errors.
Rely on the S3 serializer's sanitized connection check and map custom endpoint failures to form errors.
Keep the credential-clearing fix in its single caller and remove testing-only files from the PR.
Reuse existing prefixed environment lookup behavior and preserve the hook's original explanatory comments.
Keep the optional S3 credential fix focused by preserving the existing export API behavior.
Keep the public bug fix focused on form validation and add a direct regression test for blank credentials.
@newlandj
newlandj marked this pull request as ready for review August 12, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ux] Data source / target forms disallow AWS S3 access key and secret from environment Unable to use EKS service account role for S3 connections

1 participant