Skip to content

Commit c709172

Browse files
committed
fix(core): set CREDENTIALS_CODE only for credentials object
1 parent 9b3ff7e commit c709172

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/core/src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,15 @@ export const resolveAwsSdkSigV4Config = <T>(
139139
});
140140
const boundProvider = bindCallerConfig(config, memoizedProvider);
141141
if (isUserSupplied && !boundProvider.attributed) {
142+
// Check if the original input was a credential object
143+
const isCredentialObject = typeof inputCredentials === "object" && inputCredentials !== null;
144+
142145
resolvedCredentials = async (options: Record<string, any> | undefined) => {
143146
const creds = await boundProvider(options);
144147
const attributedCreds = creds as AttributedAwsCredentialIdentity;
145-
// Only set CREDENTIALS_CODE if no source attribution exists
146-
if (!attributedCreds.$source || Object.keys(attributedCreds.$source).length === 0) {
148+
149+
// Only set CREDENTIALS_CODE if user provided a credential object
150+
if (isCredentialObject) {
147151
return setCredentialFeature(attributedCreds, "CREDENTIALS_CODE", "e");
148152
}
149153
return attributedCreds;

0 commit comments

Comments
 (0)