@aws-sdk/credential-provider-process
Advanced tools
Comparing version 3.614.0 to 3.620.1
@@ -37,3 +37,4 @@ "use strict"; | ||
// src/getValidatedProcessCredentials.ts | ||
var getValidatedProcessCredentials = /* @__PURE__ */ __name((profileName, data) => { | ||
var getValidatedProcessCredentials = /* @__PURE__ */ __name((profileName, data, profiles) => { | ||
var _a; | ||
if (data.Version !== 1) { | ||
@@ -52,2 +53,6 @@ throw Error(`Profile ${profileName} credential_process did not return Version 1.`); | ||
} | ||
let accountId = data.AccountId; | ||
if (!accountId && ((_a = profiles == null ? void 0 : profiles[profileName]) == null ? void 0 : _a.aws_account_id)) { | ||
accountId = profiles[profileName].aws_account_id; | ||
} | ||
return { | ||
@@ -58,3 +63,4 @@ accessKeyId: data.AccessKeyId, | ||
...data.Expiration && { expiration: new Date(data.Expiration) }, | ||
...data.CredentialScope && { credentialScope: data.CredentialScope } | ||
...data.CredentialScope && { credentialScope: data.CredentialScope }, | ||
...accountId && { accountId } | ||
}; | ||
@@ -78,3 +84,3 @@ }, "getValidatedProcessCredentials"); | ||
} | ||
return getValidatedProcessCredentials(profileName, data); | ||
return getValidatedProcessCredentials(profileName, data, profiles); | ||
} catch (error) { | ||
@@ -81,0 +87,0 @@ throw new import_property_provider.CredentialsProviderError(error.message, { logger }); |
@@ -1,2 +0,2 @@ | ||
export const getValidatedProcessCredentials = (profileName, data) => { | ||
export const getValidatedProcessCredentials = (profileName, data, profiles) => { | ||
if (data.Version !== 1) { | ||
@@ -15,2 +15,6 @@ throw Error(`Profile ${profileName} credential_process did not return Version 1.`); | ||
} | ||
let accountId = data.AccountId; | ||
if (!accountId && profiles?.[profileName]?.aws_account_id) { | ||
accountId = profiles[profileName].aws_account_id; | ||
} | ||
return { | ||
@@ -22,3 +26,4 @@ accessKeyId: data.AccessKeyId, | ||
...(data.CredentialScope && { credentialScope: data.CredentialScope }), | ||
...(accountId && { accountId }), | ||
}; | ||
}; |
@@ -20,3 +20,3 @@ import { CredentialsProviderError } from "@smithy/property-provider"; | ||
} | ||
return getValidatedProcessCredentials(profileName, data); | ||
return getValidatedProcessCredentials(profileName, data, profiles); | ||
} | ||
@@ -23,0 +23,0 @@ catch (error) { |
@@ -1,2 +0,2 @@ | ||
import { AwsCredentialIdentity } from "@smithy/types"; | ||
import { AwsCredentialIdentity, ParsedIniData } from "@smithy/types"; | ||
import { ProcessCredentials } from "./ProcessCredentials"; | ||
@@ -6,2 +6,2 @@ /** | ||
*/ | ||
export declare const getValidatedProcessCredentials: (profileName: string, data: ProcessCredentials) => AwsCredentialIdentity; | ||
export declare const getValidatedProcessCredentials: (profileName: string, data: ProcessCredentials, profiles: ParsedIniData) => AwsCredentialIdentity; |
@@ -11,2 +11,3 @@ /** | ||
CredentialScope?: string; | ||
AccountId?: string; | ||
}; |
@@ -1,6 +0,7 @@ | ||
import { AwsCredentialIdentity } from "@smithy/types"; | ||
import { AwsCredentialIdentity, ParsedIniData } from "@smithy/types"; | ||
import { ProcessCredentials } from "./ProcessCredentials"; | ||
export declare const getValidatedProcessCredentials: ( | ||
profileName: string, | ||
data: ProcessCredentials | ||
data: ProcessCredentials, | ||
profiles: ParsedIniData | ||
) => AwsCredentialIdentity; |
@@ -8,2 +8,3 @@ export type ProcessCredentials = { | ||
CredentialScope?: string; | ||
AccountId?: string; | ||
}; |
{ | ||
"name": "@aws-sdk/credential-provider-process", | ||
"version": "3.614.0", | ||
"version": "3.620.1", | ||
"description": "AWS credential provider that sources credential_process from ~/.aws/credentials and ~/.aws/config", | ||
@@ -5,0 +5,0 @@ "main": "./dist-cjs/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
23776
244
0