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

View file

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

View file

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

View file

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