mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(All AWS Nodes): Enable support for AWS temporary credentials (#2587)
* Enable support for AWS temporary credentials * 🔨 removed toggle from ui added sessionToken to other aws services that using sign function from aws4 module * Update sign method for other AWS nodes * Remove the unneeded additional `temporaryCredentials` checkbox * Update description for session token * ⚡ added missing session token to credentials test * Update sign method for DynamoDB * 🔨 added back toggle for hiding session token, fixed linter errors * ⚡ wording fix Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -40,7 +40,11 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I
|
||||
|
||||
// Concatenate path and instantiate URL object so it parses correctly query strings
|
||||
const endpoint = new URL(getEndpointForService(service, credentials) + path);
|
||||
|
||||
const securityHeaders = {
|
||||
accessKeyId: `${credentials.accessKeyId}`.trim(),
|
||||
secretAccessKey: `${credentials.secretAccessKey}`.trim(),
|
||||
sessionToken: credentials.temporaryCredentials ? `${credentials.sessionToken}`.trim() : undefined,
|
||||
};
|
||||
const options = sign({
|
||||
// @ts-ignore
|
||||
uri: endpoint,
|
||||
@@ -50,10 +54,7 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I
|
||||
path: '/',
|
||||
headers: { ...headers },
|
||||
body: JSON.stringify(body),
|
||||
}, {
|
||||
accessKeyId: credentials.accessKeyId,
|
||||
secretAccessKey: credentials.secretAccessKey,
|
||||
});
|
||||
}, securityHeaders);
|
||||
|
||||
try {
|
||||
return JSON.parse(await this.helpers.request!(options));
|
||||
|
||||
Reference in New Issue
Block a user