mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(core): Credentials for popular SecOps services, Part 1 (#6775)
This commit is contained in:
60
packages/nodes-base/credentials/MistApi.credentials.ts
Normal file
60
packages/nodes-base/credentials/MistApi.credentials.ts
Normal 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',
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user