Skip to content

Commit 1f6a400

Browse files
committed
chore(credential-provider-ini): pass through logger
1 parent 2cea970 commit 1f6a400

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

packages/credential-provider-ini/src/resolveProfileData.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ describe(resolveProfileData.name, () => {
114114
[isAssumeRoleProfile, isStaticCredsProfile, isWebIdentityProfile].forEach((isProfileFn) => {
115115
(isProfileFn as jest.Mock).mockReturnValue(false);
116116
});
117+
(isSsoProfile as unknown as jest.Mock).mockReturnValue(true);
118+
117119
(resolveSsoCredentials as jest.Mock).mockImplementation(() => Promise.resolve(mockCreds));
118120
const receivedCreds = await resolveProfileData(mockProfileName, mockProfiles, mockOptions);
119121
expect(receivedCreds).toStrictEqual(mockCreds);
120-
expect(resolveSsoCredentials).toHaveBeenCalledWith(mockProfileName);
122+
expect(resolveSsoCredentials).toHaveBeenCalledWith(mockProfileName, mockOptions);
121123
});
122124
});

packages/credential-provider-ini/src/resolveProfileData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const resolveProfileData = async (
5151
}
5252

5353
if (isSsoProfile(data)) {
54-
return await resolveSsoCredentials(profileName);
54+
return await resolveSsoCredentials(profileName, options);
5555
}
5656

5757
// If the profile cannot be parsed or contains neither static credentials

packages/credential-provider-ini/src/resolveSsoCredentials.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import type { SsoProfile } from "@aws-sdk/credential-provider-sso";
2+
import type { CredentialProviderOptions } from "@aws-sdk/types";
23
import type { Profile } from "@smithy/types";
34

45
/**
56
* @internal
67
*/
7-
export const resolveSsoCredentials = async (profile: string) => {
8+
export const resolveSsoCredentials = async (profile: string, options: CredentialProviderOptions = {}) => {
89
const { fromSSO } = await import("@aws-sdk/credential-provider-sso");
910
return fromSSO({
1011
profile,
12+
logger: options.logger,
1113
})();
1214
};
1315

packages/credential-provider-ini/src/resolveWebIdentityCredentials.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ export const resolveWebIdentityCredentials = async (
3434
roleArn: profile.role_arn,
3535
roleSessionName: profile.role_session_name,
3636
roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
37+
logger: options.logger,
3738
})()
3839
);

0 commit comments

Comments
 (0)