-
Notifications
You must be signed in to change notification settings - Fork 569
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
feat(credential-providers): source accountId from credential providers #6019
Conversation
...sources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.spec.ts
Show resolved
Hide resolved
...resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultStsRoleAssumers.ts
Outdated
Show resolved
Hide resolved
...resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultStsRoleAssumers.ts
Outdated
Show resolved
Hide resolved
...resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultStsRoleAssumers.ts
Outdated
Show resolved
Hide resolved
...resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultStsRoleAssumers.ts
Outdated
Show resolved
Hide resolved
@@ -20,7 +21,8 @@ export const isStaticCredsProfile = (arg: any): arg is StaticCredsProfile => | |||
typeof arg === "object" && | |||
typeof arg.aws_access_key_id === "string" && | |||
typeof arg.aws_secret_access_key === "string" && | |||
["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1; | |||
["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 && | |||
["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there doesn't seem to be any point to this check, or the aws_session_token one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
● isStaticCredsProfile › value at 'aws_session_token' is not of type string | undefined
expect(received).toEqual(expected) // deep equality
Expected: false
Received: true
30 | it.each(["aws_session_token"])("value at '%s' is not of type string | undefined", (key) => {
31 | [true, null, 1, NaN, {}].forEach((value) => {
> 32 | expect(isStaticCredsProfile({ ...getMockStaticCredsProfile(), [key]: value })).toEqual(false);
| ^
33 | });
34 | });
35 |
at src/resolveStaticCredentials.spec.ts:32:86
at Array.forEach (<anonymous>)
at src/resolveStaticCredentials.spec.ts:31:30
unit test seems to fail when i remove these checks (for both session token and accountId). we'll have to change the unit tests for these as well.
packages/credential-provider-ini/src/resolveStaticCredentials.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you change accountId and credentialScope to only be included if defined for credential objects?
*/ | ||
AssumedRoleId?: string; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added and left the interface here instead of a new file, since the overhead of copying a new file to clients seems more than having a single interface present here. if we find ourselves adding many STS interfaces, we should consider refactoring a little.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Issue
Internal JS-4633
Part 1
Description
Sources accountId from credential providers.
PR to update
AwsCredentialIdentity
interface: smithy-lang/smithy-typescript#1240Testing
To-Do:
AwsCredentialIdentity
interface PR above.spec.ts
forclient-sts
fromcodegen
dir manually (test file isn't being copied properly)By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.