first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('AWS Cognito - Get User Pool', () => {
|
||||
beforeEach(() => {
|
||||
const baseUrl = 'https://cognito-idp.eu-central-1.amazonaws.com/';
|
||||
|
||||
nock(baseUrl)
|
||||
.persist()
|
||||
.defaultReplyHeaders({ 'Content-Type': 'application/x-amz-json-1.1' })
|
||||
.post('/', {
|
||||
UserPoolId: 'eu-central-1_W3WwpiBXV',
|
||||
})
|
||||
.matchHeader('x-amz-target', 'AWSCognitoIdentityProviderService.DescribeUserPool')
|
||||
.reply(200, {
|
||||
UserPool: {
|
||||
Arn: 'arn:aws:cognito-idp:eu-central-1:130450532146:userpool/eu-central-1_W3WwpiBXV',
|
||||
CreationDate: 1739527771.267,
|
||||
DeletionProtection: 'INACTIVE',
|
||||
EstimatedNumberOfUsers: 8,
|
||||
Id: 'eu-central-1_W3WwpiBXV',
|
||||
LastModifiedDate: 1739527771.267,
|
||||
MfaConfiguration: 'OFF',
|
||||
Name: 'UserPoolSimple',
|
||||
},
|
||||
});
|
||||
|
||||
nock(baseUrl)
|
||||
.persist()
|
||||
.defaultReplyHeaders({ 'Content-Type': 'application/x-amz-json-1.1' })
|
||||
.post('/', {
|
||||
UserPoolId: 'eu-central-1_EUZ4iEF1T',
|
||||
Limit: 50,
|
||||
})
|
||||
.matchHeader('x-amz-target', 'AWSCognitoIdentityProviderService.ListUsers')
|
||||
.reply(200, {
|
||||
Users: [
|
||||
{
|
||||
Username: 'userName10',
|
||||
UserAttributes: [
|
||||
{ Name: 'sub', Value: 'b30498c2-d0f1-70a8-4b0c-3da25a3b998f' },
|
||||
{ Name: 'family_name', Value: 'New FamilyName 2' },
|
||||
],
|
||||
UserCreateDate: 1744206331.569,
|
||||
UserLastModifiedDate: 1744206366.034,
|
||||
Enabled: true,
|
||||
UserStatus: 'FORCE_CHANGE_PASSWORD',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
nock(baseUrl)
|
||||
.persist()
|
||||
.defaultReplyHeaders({ 'Content-Type': 'application/x-amz-json-1.1' })
|
||||
.post('/', {
|
||||
UserPoolId: 'eu-central-1_EUZ4iEF1T',
|
||||
Username: 'b30498c2-d0f1-70a8-4b0c-3da25a3b998f',
|
||||
})
|
||||
.matchHeader('x-amz-target', 'AWSCognitoIdentityProviderService.AdminGetUser')
|
||||
.reply(200, {
|
||||
Username: 'userName10',
|
||||
UserAttributes: [
|
||||
{ Name: 'sub', Value: 'b30498c2-d0f1-70a8-4b0c-3da25a3b998f' },
|
||||
{ Name: 'family_name', Value: 'New FamilyName 2' },
|
||||
],
|
||||
UserCreateDate: 1744206331.569,
|
||||
UserLastModifiedDate: 1744206366.034,
|
||||
Enabled: true,
|
||||
UserStatus: 'FORCE_CHANGE_PASSWORD',
|
||||
});
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['get.workflow.json'],
|
||||
credentials: {
|
||||
aws: {
|
||||
region: 'eu-central-1',
|
||||
accessKeyId: 'test',
|
||||
secretAccessKey: 'test',
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "4570d7a2-f10a-495d-8a0e-8520b638649e",
|
||||
"name": "When clicking ‘Execute workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [-700, 320]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "userPool",
|
||||
"userPool": {
|
||||
"__rl": true,
|
||||
"value": "eu-central-1_W3WwpiBXV",
|
||||
"mode": "list",
|
||||
"cachedResultName": "UserPoolSimple"
|
||||
},
|
||||
"requestOptions": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.awsCognito",
|
||||
"typeVersion": 1,
|
||||
"position": [-700, 500],
|
||||
"id": "fc734bb9-acd3-4b7d-a2a3-0a7b664e3c5a",
|
||||
"name": "AWS Cognito2",
|
||||
"credentials": {
|
||||
"aws": {
|
||||
"id": "testId",
|
||||
"name": "AWS account Central Europe"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"When clicking ‘Execute workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AWS Cognito2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"pinData": {
|
||||
"AWS Cognito2": [
|
||||
{
|
||||
"json": {
|
||||
"Arn": "arn:aws:cognito-idp:eu-central-1:130450532146:userpool/eu-central-1_W3WwpiBXV",
|
||||
"CreationDate": 1739527771.267,
|
||||
"DeletionProtection": "INACTIVE",
|
||||
"EstimatedNumberOfUsers": 8,
|
||||
"Id": "eu-central-1_W3WwpiBXV",
|
||||
"LastModifiedDate": 1739527771.267,
|
||||
"MfaConfiguration": "OFF",
|
||||
"Name": "UserPoolSimple"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user