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,197 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import * as addToGroup from './addToGroup.operation';
|
||||
import * as create from './create.operation';
|
||||
import * as del from './delete.operation';
|
||||
import * as get from './get.operation';
|
||||
import * as getAll from './getAll.operation';
|
||||
import * as removeFromGroup from './removeFromGroup.operation';
|
||||
import * as update from './update.operation';
|
||||
import { CURRENT_VERSION } from '../../helpers/constants';
|
||||
import { handleError } from '../../helpers/errorHandler';
|
||||
import { removeUserFromGroups, simplifyGetAllUsersResponse } from '../../helpers/utils';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
default: 'getAll',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Add to Group',
|
||||
value: 'addToGroup',
|
||||
description: 'Add an existing user to a group',
|
||||
action: 'Add user to group',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: '',
|
||||
body: {
|
||||
Action: 'AddUserToGroup',
|
||||
Version: CURRENT_VERSION,
|
||||
UserName: '={{ $parameter["user"] }}',
|
||||
GroupName: '={{ $parameter["group"] }}',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleError],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
description: 'Create a new user',
|
||||
action: 'Create user',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: '',
|
||||
body: {
|
||||
Action: 'CreateUser',
|
||||
Version: CURRENT_VERSION,
|
||||
UserName: '={{ $parameter["userName"] }}',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleError],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete a user',
|
||||
action: 'Delete user',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [removeUserFromGroups],
|
||||
},
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: '',
|
||||
body: {
|
||||
Action: 'DeleteUser',
|
||||
Version: CURRENT_VERSION,
|
||||
UserName: '={{ $parameter["user"] }}',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleError],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Retrieve a user',
|
||||
action: 'Get user',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: '',
|
||||
body: {
|
||||
Action: 'GetUser',
|
||||
Version: CURRENT_VERSION,
|
||||
UserName: '={{ $parameter["user"] }}',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
{
|
||||
type: 'rootProperty',
|
||||
properties: {
|
||||
property: 'GetUserResponse.GetUserResult.User',
|
||||
},
|
||||
},
|
||||
handleError,
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Retrieve a list of users',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: '',
|
||||
body: {
|
||||
Action: 'ListUsers',
|
||||
Version: CURRENT_VERSION,
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleError, simplifyGetAllUsersResponse],
|
||||
},
|
||||
},
|
||||
action: 'Get many users',
|
||||
},
|
||||
{
|
||||
name: 'Remove From Group',
|
||||
value: 'removeFromGroup',
|
||||
description: 'Remove a user from a group',
|
||||
action: 'Remove user from group',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: '',
|
||||
body: {
|
||||
Action: 'RemoveUserFromGroup',
|
||||
Version: CURRENT_VERSION,
|
||||
UserName: '={{ $parameter["user"] }}',
|
||||
GroupName: '={{ $parameter["group"] }}',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleError],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update a user',
|
||||
action: 'Update user',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: '',
|
||||
body: {
|
||||
Action: 'UpdateUser',
|
||||
Version: CURRENT_VERSION,
|
||||
NewUserName: '={{ $parameter["userName"] }}',
|
||||
UserName: '={{ $parameter["user"] }}',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleError],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
...addToGroup.description,
|
||||
...create.description,
|
||||
...del.description,
|
||||
...get.description,
|
||||
...getAll.description,
|
||||
...update.description,
|
||||
...removeFromGroup.description,
|
||||
];
|
||||
@@ -0,0 +1,24 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { groupLocator, userLocator } from '../common';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userLocator,
|
||||
description: 'Select the user you want to add to the group',
|
||||
},
|
||||
{
|
||||
...groupLocator,
|
||||
description: 'Select the group you want to add the user to',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['addToGroup'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,96 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { preprocessTags, validatePath, validatePermissionsBoundary } from '../../helpers/utils';
|
||||
import { pathParameter, userNameParameter } from '../common';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userNameParameter,
|
||||
description: 'The username of the new user to create',
|
||||
placeholder: 'e.g. UserName',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Option',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
...pathParameter,
|
||||
description: 'The path for the user name',
|
||||
placeholder: 'e.g. /division_abc/subdivision_xyz/',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [validatePath],
|
||||
property: 'Path',
|
||||
type: 'query',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Permissions Boundary',
|
||||
name: 'permissionsBoundary',
|
||||
default: '',
|
||||
description:
|
||||
'The ARN of the managed policy that is used to set the permissions boundary for the user',
|
||||
placeholder: 'e.g. arn:aws:iam::123456789012:policy/ExampleBoundaryPolicy',
|
||||
type: 'string',
|
||||
validateType: 'string',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [validatePermissionsBoundary],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Tags',
|
||||
name: 'tags',
|
||||
type: 'fixedCollection',
|
||||
description: 'A list of tags that you want to attach to the new user',
|
||||
default: [],
|
||||
placeholder: 'Add Tag',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'tags',
|
||||
displayName: 'Tag',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Key',
|
||||
name: 'key',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'e.g., Department',
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'e.g., Engineering',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [preprocessTags],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['create'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,20 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { userLocator } from '../common';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userLocator,
|
||||
description: 'Select the user you want to delete',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['delete'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,20 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { userLocator } from '../common';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userLocator,
|
||||
description: 'Select the user you want to retrieve',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['get'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { validateUserPath } from '../../helpers/utils';
|
||||
import { paginationParameters } from '../common';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
...paginationParameters,
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Path Prefix',
|
||||
name: 'pathPrefix',
|
||||
type: 'string',
|
||||
validateType: 'string',
|
||||
default: '/',
|
||||
description: 'The path prefix for filtering the results',
|
||||
placeholder: 'e.g. /division_abc/subdivision_xyz/',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [validateUserPath],
|
||||
property: 'PathPrefix',
|
||||
value: '={{ $value }}',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,51 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { groupLocator, userLocator } from '../common';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userLocator,
|
||||
description: 'Select the user you want to remove from the group',
|
||||
},
|
||||
{
|
||||
...groupLocator,
|
||||
description: 'Select the group you want to remove the user from',
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From list',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
typeOptions: {
|
||||
searchListMethod: 'searchGroupsForUser',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'By Name',
|
||||
name: 'groupName',
|
||||
type: 'string',
|
||||
hint: 'Enter the group name',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '^[\\w+=,.@-]+$',
|
||||
errorMessage: 'The group name must follow the allowed pattern',
|
||||
},
|
||||
},
|
||||
],
|
||||
placeholder: 'e.g. Admins',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['removeFromGroup'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,45 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { validatePath } from '../../helpers/utils';
|
||||
import { pathParameter, userLocator, userNameParameter } from '../common';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userLocator,
|
||||
description: 'Select the user you want to update',
|
||||
},
|
||||
{
|
||||
...userNameParameter,
|
||||
description: 'The new name of the user',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Option',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
...pathParameter,
|
||||
placeholder: 'e.g. /division_abc/subdivision_xyz/',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [validatePath],
|
||||
property: 'NewPath',
|
||||
type: 'query',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['update'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
Reference in New Issue
Block a user