Repository navigation
feat: temporary credentials in storage, iam and the CLI - #430
Open
designcode wants to merge 6 commits into
Open
designcode wants to merge 6 commits into
designcode wants to merge 6 commits into
Conversation
A session token passed with its access key pair is now signed into every request, in both the S3 client and the HTTP client behind copy, move and updateObject. TIGRIS_STORAGE_SESSION_TOKEN supplies it from the environment. A session token on its own is still an OAuth token, and an OAuth token still wins over a key pair. A credentialProvider no longer needs organizationId, so it can return renewable temporary credentials. Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
createTemporaryCredentials calls STS GetFederationToken to issue credentials limited to one bucket, from an access level, exact actions, or a full policy. It checks the name, duration, policy size and actions before calling STS, and the result plugs into @tigrisdata/storage as static credentials or a credentialProvider. The shared HTTP client can now sign for a service other than s3, and reads the message out of XML error bodies with the AWS SDK's XML parser instead of reporting only the status text. iam now declares the AWS packages it pulls in through shared/ instead of bundling its own copies, so apps using it with @tigrisdata/storage load one copy of each. Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add `tigris credentials temporary <bucket> --name <name>` to issue STS credentials limited to one bucket, by access level, exact actions or a policy file, lasting --duration (default 1h). --export prints shell export lines, with --for aws for the AWS variable names. Logged in with OAuth, which can't issue them, the command offers to create an access key for the bucket (ReadOnly or ReadWrite, matching the grant) or to stop so the user can log in with an access key. The CLI also authenticates with temporary credentials from AWS_SESSION_TOKEN, TIGRIS_STORAGE_SESSION_TOKEN or an AWS profile, and explains what they can't do in access errors, whoami, credentials test and the IAM commands. Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bc7bba7. Configure here.
Contributor
[High impact] The PR appears safe to merge; no new blocking issues were found. SummaryAdds temporary credentials across storage, IAM, and the CLI.
Reviews (4) · Last reviewed commit: "fix(cli): resolve export endpoints befor..." · Reviewed by Greptile |
TIGRIS_STORAGE_SESSION_TOKEN only counts as temporary credentials when the key variables are set too; a leftover token no longer hides an OAuth session from the environment. The README example issues readwrite credentials, so its list call works. Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- credentials test passes temporary credentials whose policy only denies listing, such as write-only ones - --policy can't be combined with a bucket, --access or --actions - a key created through the OAuth flow is deleted when nothing is issued - access-keys create --env removes a session token left by temporary credentials Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failure there exited after the OAuth flow had created a key, before the cleanup that deletes it could run. Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 <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.

Adds support for Tigris temporary credentials (STS
GetFederationToken) across the SDKs and the CLI. One commit per package.@tigrisdata/storage: accept temporary credentialssessionTokentogether withaccessKeyIdandsecretAccessKeyis now signed as an STS session token (x-amz-security-token). On its own it is still an OAuth token, as before.TIGRIS_STORAGE_SESSION_TOKENalongside the key variables.credentialProviderno longer requires an organization, so it can return refreshing temporary credentials.sessionTokenkeeps priority over access keys from the environment.@tigrisdata/iam: issue temporary credentialscreateTemporaryCredentials(name, { bucket, access | actions | policy, durationSeconds })returns credentials ready to spread into the storage config.iamnow declares@smithy/signature-v4,@aws-crypto/sha256-jsand@aws-sdk/xml-builderinstead of bundling private copies (dist 84 KB → 31 KB). AGENTS.md documents the rule.@tigrisdata/cli: issue and use temporary credentialstigris credentials temporary <bucket> --name <name> --access read|write|readwrite(or--actions,--policy),--duration(default 1h),--export [--for aws].AWS_SESSION_TOKEN,TIGRIS_STORAGE_SESSION_TOKENor an AWS profile, and explains their limits in access errors,whoami,credentials testand the IAM commands.Testing
Changesets: storage minor, iam minor, CLI minor.
🤖 Generated with Claude Code
Note
High Risk
Touches authentication, credential classification (OAuth vs STS), and signing across packages, including a breaking semantic change when keys and OAuth session coexist; IAM/STS issuance requires access keys and affects permission boundaries.
Overview
Adds end-to-end temporary credentials (STS
GetFederationToken) across@tigrisdata/iam,@tigrisdata/storage, and the CLI.IAM exposes
createTemporaryCredentialswith bucket-scopedread/write/readwrite, customactions, or a JSONpolicy, plus STS client wiring and validation (duration, policy size, action allow-list). Shared HTTP signing now includesx-amz-security-tokenfor key+session pairs, supports anstsSigV4 service name, and surfaces XML gatewayMessagetext for S3/STS errors. IAM stops bundling duplicate crypto/XML deps in favor of declared shared versions.Storage distinguishes STS session tokens (with access keys) from OAuth tokens (session alone + org), reads
TIGRIS_STORAGE_SESSION_TOKEN, allowscredentialProviderwithoutorganizationId, and updates client caching/signing accordingly—including a behavior change: access keys plus OAuth session+org are now treated as temporary credentials, not OAuth.CLI adds
tigris credentials temporary(--access/--actions/--policy,--duration,--export [--for aws|tigris]), authenticates via env/profile session tokens, blocks IAM/access-key flows on temp creds with clearer errors, and improveswhoami,credentials test, and permission-denied messaging.Reviewed by Cursor Bugbot for commit b2b50e5. Bugbot is set up for automated code reviews on this repo. Configure here.