Added validation for services and prefix to response variable

This commit is contained in:
Adina Totorean 2025-01-23 13:44:35 +02:00
parent f8b090b9f6
commit 56a6cb1414
4 changed files with 5 additions and 7 deletions

View file

@ -339,7 +339,7 @@ export class Aws implements ICredentialType {
region = parsed.region; region = parsed.region;
} }
} else { } else {
if (!requestOptions.baseURL && !requestOptions.url) { if (!requestOptions.baseURL && !requestOptions.url && service) {
let endpointString: string; let endpointString: string;
if (service === 'lambda' && credentials.lambdaEndpoint) { if (service === 'lambda' && credentials.lambdaEndpoint) {
endpointString = credentials.lambdaEndpoint; endpointString = credentials.lambdaEndpoint;
@ -353,9 +353,6 @@ export class Aws implements ICredentialType {
endpointString = credentials.sesEndpoint; endpointString = credentials.sesEndpoint;
} else if (service === 'rekognition' && credentials.rekognitionEndpoint) { } else if (service === 'rekognition' && credentials.rekognitionEndpoint) {
endpointString = credentials.rekognitionEndpoint; endpointString = credentials.rekognitionEndpoint;
} else if (service === 'sqs' && credentials.sqsEndpoint) {
//ToDo: should we remove the duplicate?
endpointString = credentials.sqsEndpoint;
} else if (service) { } else if (service) {
endpointString = `https://${service}.${region}.amazonaws.com`; endpointString = `https://${service}.${region}.amazonaws.com`;
} }

View file

@ -1,5 +1,6 @@
import { sign, type Request } from 'aws4'; import { sign, type Request } from 'aws4';
import type { IHttpRequestOptions } from 'n8n-workflow'; import type { IHttpRequestOptions } from 'n8n-workflow';
import { Aws, type AwsCredentialsType } from '../Aws.credentials'; import { Aws, type AwsCredentialsType } from '../Aws.credentials';
jest.mock('aws4', () => ({ jest.mock('aws4', () => ({

View file

@ -30,7 +30,7 @@ export class AwsCognito implements INodeType {
outputs: [NodeConnectionType.Main], outputs: [NodeConnectionType.Main],
hints: [ hints: [
{ {
message: 'Please select a parameter in the options to update the user', message: 'Select a parameter to update this resource',
displayCondition: displayCondition:
'={{$parameter["resource"] === "user" && $parameter["operation"] === "update" && Object.keys($parameter["additionalOptions"]).length === 0}}', '={{$parameter["resource"] === "user" && $parameter["operation"] === "update" && Object.keys($parameter["additionalOptions"]).length === 0}}',
whenToDisplay: 'always', whenToDisplay: 'always',
@ -38,7 +38,7 @@ export class AwsCognito implements INodeType {
type: 'warning', type: 'warning',
}, },
{ {
message: 'Please select a parameter in the options to update the group', message: 'Select a parameter to update this resource',
displayCondition: displayCondition:
'={{$parameter["resource"] === "group" && $parameter["operation"] === "update" && Object.keys($parameter["options"]).length === 0}}', '={{$parameter["resource"] === "group" && $parameter["operation"] === "update" && Object.keys($parameter["options"]).length === 0}}',
whenToDisplay: 'always', whenToDisplay: 'always',

View file

@ -562,7 +562,7 @@ export function mapUserAttributes(userAttributes: Array<{ Name: string; Value: s
export async function simplifyData( export async function simplifyData(
this: IExecuteSingleFunctions, this: IExecuteSingleFunctions,
items: INodeExecutionData[], items: INodeExecutionData[],
response: IN8nHttpFullResponse, _response: IN8nHttpFullResponse,
): Promise<INodeExecutionData[]> { ): Promise<INodeExecutionData[]> {
const simple = this.getNodeParameter('simple') as boolean; const simple = this.getNodeParameter('simple') as boolean;