File tree Expand file tree Collapse file tree
packages/core/src/submodules/httpAuthSchemes/aws_sdk Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments