Skip to content

fix(iam): auth validation in iam http client#75

Merged
designcode merged 2 commits intomainfrom
fix/auth-validation-in-iam-http-client
Mar 27, 2026
Merged

fix(iam): auth validation in iam http client#75
designcode merged 2 commits intomainfrom
fix/auth-validation-in-iam-http-client

Conversation

@designcode
Copy link
Copy Markdown
Collaborator

@designcode designcode commented Mar 27, 2026

Note

Medium Risk
Touches IAM client authentication/validation logic; mistakes could break IAM calls or unintentionally allow unauthenticated requests, though the change is localized to client creation.

Overview
Tightens createIAMClient validation to require either a sessionToken or access-key credentials (accessKeyId + secretAccessKey), and only enforces organizationId when a session token is used.

This unblocks IAM calls that authenticate via access keys while still failing fast on missing/invalid auth configuration, without changing the request logic of individual IAM operations (e.g., whoami, listAccessKeys).

Written by Cursor Bugbot for commit 1727b82. This will update automatically on new commits. Configure here.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 27, 2026

Greptile Summary

This PR fixes auth validation in the IAM HTTP client by replacing the ad-hoc skipCheck bypass with a proper dual-auth model that accepts either a session token (with organizationId) or access key credentials (accessKeyId + secretAccessKey).\n\nKey changes:\n- http-client.ts: Removes the skipCheck parameter. The new logic correctly gates on hasCredentials = accessKeyId && secretAccessKey, allowing credentials as a first-class alternative to session tokens. The organizationId requirement is now scoped only to session-token flows, which makes sense since credential-based flows don't need it for routing.\n- whoami.ts: Removes the skipCheck=true workaround. The old bypass was likely there because whoami was called with credentials (not a session token), which the old validation would have rejected since it only checked for sessionToken. The new credential-aware validation renders the skip unnecessary.\n- access-key/list.ts: Minor clarity improvement — explicitly passes false for isManagement instead of leaving it as undefined.\n- package.json / sub-packages: Routine dependency version bumps (commitlint, eslint, vitest, AWS SDK, @tigrisdata/storage).

Confidence Score: 5/5

Safe to merge — logic is correct, no regressions, and the auth validation is strictly improved.

All changes are either straightforward validation improvements or routine dependency bumps. The removal of skipCheck is well-motivated by the new credential-based auth path, no existing valid use-case is broken, and no P0/P1 issues were found.

No files require special attention.

Important Files Changed

Filename Overview
packages/iam/src/lib/http-client.ts Core auth validation refactored: removed the skipCheck workaround and added proper credential-based auth (accessKeyId + secretAccessKey) as an alternative to sessionToken; organizationId now only required when using sessionToken.
packages/iam/src/lib/whoami.ts Removed skipCheck=true workaround; whoami now goes through proper auth validation — now requires either credentials or sessionToken+organizationId.
packages/iam/src/lib/access-key/list.ts Minor clarity improvement: explicitly passes false for isManagement (previously undefined, which is functionally equivalent).
package.json Routine dev dependency bumps: commitlint, eslint, typescript-eslint, vitest.
packages/storage/package.json Routine AWS SDK dependency bumps to 3.1018.0 and smithy/signature-v4 to 5.3.12.
packages/keyv-tigris/package.json Bumped @tigrisdata/storage peer dependency from ^2.15.3 to ^2.15.6.
packages/react/package.json Bumped @tigrisdata/storage peer dependency from ^2.15.3 to ^2.15.6.

Reviews (1): Last reviewed commit: "fix(iam): auth validation in iam http cl..." | Re-trigger Greptile

@designcode designcode force-pushed the fix/auth-validation-in-iam-http-client branch from 1d81ba3 to 1727b82 Compare March 27, 2026 11:02
@designcode designcode merged commit 261dbe8 into main Mar 27, 2026
2 checks passed
@designcode designcode deleted the fix/auth-validation-in-iam-http-client branch March 27, 2026 11:06
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants