fix(connections): support ~/.aws/config profiles and credential_process for AWS IAM auth#1432
Merged
Merged
Conversation
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.
Addresses @imdkbj's report on #1401: AWS IAM "profile" auth only read
~/.aws/credentialsand only static keys, so profiles defined in~/.aws/config(SSO, login_session, assume-role, orcredential_process) were never picked up.Changes
resolveProfilenow reads~/.aws/config([profile NAME], and[default]) and~/.aws/credentials([NAME]), merging per the AWS precedence rule (credentials-file keys win).credential_processsupport. If the resolved profile hascredential_process, TablePro runs it and parses the standard JSON (Versionmust be 1,AccessKeyId,SecretAccessKey, optionalSessionToken/Expiration), matching the AWS CLI/SDK spec. This is the general escape hatch: SSO, IAM Identity Center, and assume-role all work throughaws configure export-credentials --format process, which is exactly the workaround in the report.Implementation notes (to spec, per AWS docs)
/usr/bin/env, not a shell (no injection; matches "runs the command as specified"). PATH is augmented with the common bin dirs so a GUI-launched app can still findaws.Versionand malformed output are rejected with clear messages.Tests
Unit tests for the command tokenizer (plain, double-quoted-with-spaces, blank) and the credential JSON parsing (temporary vs long-term,
Version != 1rejected, malformed/incomplete rejected). Validated the logic against the AWS spec.Docs: PostgreSQL and MySQL pages note that profiles can come from
~/.aws/configand usecredential_process.