Add @vercel/blob/s3: OIDC-backed credentials provider for the AWS S3 SDK - #1105
Open
falcoagustin wants to merge 2 commits into
Open
falcoagustin wants to merge 2 commits into
falcoagustin wants to merge 2 commits into
Conversation
`blobS3Credentials()` exchanges the Blob auth in scope (OIDC or BLOB_READ_WRITE_TOKEN) for temporary S3-compatible credentials via the existing POST /blob/signed-token endpoint: the delegation token is the access key id and the client signing token is the secret. Returned as a provider function so the AWS SDK refreshes before expiry. Also exports issueBlobS3Credentials() and credentialsFromSignedToken(). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: bed448a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Blob is getting an S3-compatible API (vercel/api#90518). S3 SDKs authenticate with an access key + secret, and we want the same zero-config DX as
awsCredentialsProviderfrom@vercel/functions/oidc: no static keys, credentials derived from the deployment's OIDC identity and refreshed automatically. Read-write tokens are deliberately not accepted as S3 credentials.Solution
New subpath export
@vercel/blob/s3:blobS3Credentials(options?)returns a provider function for the AWS SDK'scredentialsoption. Each call exchanges the Vercel OIDC token (VERCEL_OIDC_TOKENor theoidcTokenoption, plusBLOB_STORE_IDorstoreId) for temporary credentials through the newPOST /blob/s3-credentialsendpoint. It throws a clear error when no OIDC token is available, even if a read-write token is. Options:operations,pathname(scope) anddurationMs(default 1 h, max 7 days).issueBlobS3Credentials()for a single credential set (for non-JS S3 clients). The result also carriesendpoint,bucketandregionso callers can configure a client without looking anything up.No new dependencies; the credential type is structural so
@aws-sdk/*stays out of the package. README documents the flow.🤖 Generated with Claude Code