feat(core): Credentials for popular SecOps services, Part 1 (#6775)

This commit is contained in:
Michael Kret
2023-07-31 11:26:38 +03:00
committed by GitHub
parent 50b0dc21fd
commit 11567f946b
56 changed files with 1724 additions and 4 deletions

View File

@@ -0,0 +1,60 @@
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class MistApi implements ICredentialType {
name = 'mistApi';
displayName = 'Mist API';
icon = 'file:icons/Mist.svg';
documentationUrl = 'mist';
properties: INodeProperties[] = [
{
displayName: 'API Token',
name: 'token',
type: 'string',
typeOptions: { password: true },
required: true,
default: '',
},
{
displayName: 'Region',
name: 'region',
type: 'options',
options: [
{
name: 'Europe',
value: 'eu',
},
{
name: 'Global',
value: 'global',
},
],
default: 'eu',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Authorization: '=Token {{$credentials.token}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: '=https://api{{$credentials.region === "eu" ? ".eu" : ""}}.mist.com',
url: '/api/v1/self',
method: 'GET',
},
};
}