-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(n8n AWS Cognito Node): New node #11767
Open
valentina98
wants to merge
40
commits into
n8n-io:master
Choose a base branch
from
digital-boss:node-aws-cognito
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,204
−3
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
f9ad3bc
Initial commit
valentina98 48ebf1f
add error handle function
Stamsy f7d39b6
add group description
Stamsy 133ba47
Added User description
adina-hub d1bbde9
Edit User description
adina-hub 9d2b604
update group description
Stamsy bcc479e
Merge branch 'node-aws-cognito' of https://github.com/digital-boss/n8…
Stamsy 6eb585d
add search method to get group from list
Stamsy e85ced0
Updated User description
adina-hub 8fcfc4c
update group description logic
Stamsy 61d63b9
Merge branch 'node-aws-cognito' of https://github.com/digital-boss/n8…
Stamsy 39d4d9d
Added more fields for create action
adina-hub b4406c4
Merge branch 'node-aws-cognito' of https://github.com/digital-boss/n8…
adina-hub c57f838
add process response group
Stamsy f09091a
Worked on error handling and pagination
adina-hub e4088ca
Worked on pagination function
adina-hub 6914c11
Removed some ToDos
adina-hub 477bbbc
Fixed pagination
adina-hub 3615cd9
Changes after feedback
adina-hub 3f15fd5
Fixed issues after feedback
adina-hub c667116
add handle pagination and aws request unit tests
Stamsy 9fa6985
add unit test for other functions in generic function file
Stamsy f3bcf18
Merge branch 'node-aws-cognito' of https://github.com/digital-boss/n8…
adina-hub abdd152
Fixed some issues after feedback
adina-hub 2d5eb7c
Modified temporaryPassword and filters for User, and 'options' to add…
adina-hub 2a680d8
Fixed tests
adina-hub 0da656f
Removed UserAttributes for create action
adina-hub d4cf2f8
Modified tests based on changes
adina-hub 874f0b2
WIP tests for searchGroups
adina-hub e397867
fix searchGroups test
Stamsy 27a3ab6
Fixed last tests for search functions
adina-hub f8b090b
Made some changes on processAttributes function test
adina-hub 56a6cb1
Added validation for services and prefix to response variable
adina-hub 8244972
Minor copy tweaks.
gandreini 2fc9e95
Fixed issues after feedback
adina-hub 98e6280
User output changes
adina-hub 1d596fc
Modified available groups for removeUserFromGroup & fixed updateUser
adina-hub d050efb
Fixed tests
adina-hub 442f30b
Removed comments
adina-hub b28298f
Minor copy tweak.
gandreini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,8 +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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are these lines removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was a duplicate, there was also a comment previously with this as a to-do |
||
endpointString = credentials.sqsEndpoint; | ||
} else if (service) { | ||
endpointString = `https://${service}.${region}.amazonaws.com`; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/nodes-base/nodes/Aws/Cognito/AwsCognito.node.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"node": "n8n-nodes-base.awsCognito", | ||
"nodeVersion": "1.0", | ||
"codexVersion": "1.0", | ||
"categories": ["Development"], | ||
"resources": { | ||
"credentialDocumentation": [ | ||
{ | ||
"url": "https://docs.n8n.io/integrations/builtin/credentials/aws/" | ||
} | ||
], | ||
"primaryDocumentation": [ | ||
{ | ||
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.awscognito/" | ||
} | ||
] | ||
} | ||
} |
108 changes: 108 additions & 0 deletions
108
packages/nodes-base/nodes/Aws/Cognito/AwsCognito.node.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import type { INodeType, INodeTypeDescription } from 'n8n-workflow'; | ||
import { NodeConnectionType } from 'n8n-workflow'; | ||
|
||
import { | ||
userOperations, | ||
userFields, | ||
userPoolOperations, | ||
userPoolFields, | ||
groupOperations, | ||
groupFields, | ||
} from './descriptions'; | ||
import { | ||
presendStringifyBody, | ||
searchUserPools, | ||
searchGroups, | ||
searchUsers, | ||
searchGroupsForUser, | ||
} from './GenericFunctions'; | ||
|
||
export class AwsCognito implements INodeType { | ||
description: INodeTypeDescription = { | ||
displayName: 'AWS Cognito', | ||
name: 'awsCognito', | ||
icon: 'file:cognito.svg', | ||
group: ['output'], | ||
version: 1, | ||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', | ||
description: 'Interacts with Amazon Cognito', | ||
defaults: { name: 'AWS Cognito' }, | ||
inputs: [NodeConnectionType.Main], | ||
outputs: [NodeConnectionType.Main], | ||
hints: [ | ||
{ | ||
message: 'Select a parameter to update this resource', | ||
displayCondition: | ||
'={{$parameter["resource"] === "user" && $parameter["operation"] === "update" && Object.keys($parameter["additionalOptions"]).length === 0}}', | ||
whenToDisplay: 'always', | ||
location: 'outputPane', | ||
type: 'warning', | ||
}, | ||
{ | ||
message: 'Select a parameter to update this resource', | ||
displayCondition: | ||
'={{$parameter["resource"] === "group" && $parameter["operation"] === "update" && Object.keys($parameter["options"]).length === 0}}', | ||
whenToDisplay: 'always', | ||
location: 'outputPane', | ||
type: 'warning', | ||
}, | ||
], | ||
credentials: [ | ||
{ | ||
name: 'aws', | ||
required: true, | ||
}, | ||
], | ||
requestDefaults: { | ||
baseURL: '=https://cognito-idp.{{$credentials.region}}.amazonaws.com', | ||
url: '', | ||
json: true, | ||
headers: { | ||
'Content-Type': 'application/x-amz-json-1.1', | ||
}, | ||
}, | ||
properties: [ | ||
{ | ||
displayName: 'Resource', | ||
name: 'resource', | ||
type: 'options', | ||
noDataExpression: true, | ||
default: 'user', | ||
routing: { | ||
send: { | ||
preSend: [presendStringifyBody], | ||
}, | ||
}, | ||
options: [ | ||
{ | ||
name: 'User', | ||
value: 'user', | ||
}, | ||
{ | ||
name: 'User Pool', | ||
value: 'userPool', | ||
}, | ||
{ | ||
name: 'Group', | ||
value: 'group', | ||
}, | ||
], | ||
}, | ||
...userPoolOperations, | ||
...userPoolFields, | ||
...userOperations, | ||
...userFields, | ||
...groupOperations, | ||
...groupFields, | ||
], | ||
}; | ||
|
||
methods = { | ||
listSearch: { | ||
searchUserPools, | ||
searchGroups, | ||
searchUsers, | ||
searchGroupsForUser, | ||
}, | ||
}; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add validation to ensure service is defined and valid before constructing the endpoint string.