Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Creds with Session Tokens #5

Open
hsnopi opened this issue May 10, 2019 · 3 comments
Open

Error on Creds with Session Tokens #5

hsnopi opened this issue May 10, 2019 · 3 comments

Comments

@hsnopi
Copy link

hsnopi commented May 10, 2019

Hello,
I use a lot of creds with session tokens. Whenever I deal with a credentials file with a session token it fails.
[foo]
aws_access_key_id=
aws_secret_access_key=
aws_session_token=

Execution of 'CLI Default' command has failed: Invalid input: credentials schema is invalid.

I believe the error is here...
if (Object.keys(credentials).length !== 2 ||
!credentials.hasOwnProperty('aws_access_key_id') ||
!credentials.hasOwnProperty('aws_secret_access_key')) {
throw new Error('Invalid input: credentials schema is invalid.');
}

You might be able to fix it by simply making the !==2 be <2. This allows for any new record type AWS introduces but also captures the minimum. It assumes the AWS CLI will ignore any parameter which it doesn't need.

Thanks!

@hsnopi
Copy link
Author

hsnopi commented May 10, 2019

so I made that change locally on my system and it worked. I didn't deal with the test cases. I just needed it to work.
I'm not sure how contributes work here. Like, is there a vetting process to be a contributor?

@h-vera
Copy link

h-vera commented May 17, 2019

Where was the file that you modified?

@therealpat
Copy link

I believe he is talking about this file, on my windows machine inside my local profile the path is "..vscode\extensions\mark-tucker.aws-cli-configure-0.3.0\node_modules\aws-profile-handler\index.js

He's suggesting the this section should look like :

    if (Object.keys(credentials).length < 2 ||
        !this.isValidSchema(credentials) &&
        !this.isValidAltSchema(credentials)) {
        throw new Error('Invalid input: credentials schema is invalid.');
    }

I've also modified this file with the suggested change and the extension now works for me with session tokens in my profiles.

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

No branches or pull requests

3 participants