Skip to content

fix(aws): only strip the value that follows --profile - #707

Open
pcbeingused333 wants to merge 1 commit into
1Password:mainfrom
pcbeingused333:fix/aws-profile-strip-later-args
Open

pcbeingused333 wants to merge 1 commit into
1Password:mainfrom
pcbeingused333:fix/aws-profile-strip-later-args

Conversation

@pcbeingused333

Copy link
Copy Markdown

Overview

stripAndReturnProfileFlag (plugins/aws/cli_provisioner.go) removed every argument equal to the profile name, not only the value right after --profile. So aws --profile alice iam get-user --user-name alice reached the AWS CLI as aws iam get-user --user-name, with the final value missing. The --profile=alice form had the same problem.

The fix skips just the one value that follows --profile and leaves all other arguments as they are.

Type of change

  • Created a new plugin
  • Improved an existing plugin
  • Fixed a bug in an existing plugin
  • Improved contributor utilities or experience

Related Issue(s)

None. No issue was filed for this.

How To Test

cd plugins/aws && go test -run TestStripAndReturnProfileFlag .

There are two new cases in TestStripAndReturnProfileFlag, one for --profile alice and one for --profile=alice, each followed by --user-name alice. Both fail without the change and pass with it. You can also run aws --profile <name> iam get-user --user-name <name> through the plugin: the trailing <name> should now be kept.

Changelog

The AWS plugin no longer drops later command-line arguments that match the value passed to --profile.


This change was prepared with the assistance of an AI tool (Claude) and submitted by a human contributor who is responsible for it.

stripAndReturnProfileFlag dropped every later argument equal to the
profile name, so 'aws --profile alice iam get-user --user-name alice'
lost the trailing 'alice'. Skip just the value after --profile.

Signed-off-by: Alex Castillo <alex.castillog33@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant