forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTheHiveApi.credentials.ts
75 lines (69 loc) · 1.52 KB
/
TheHiveApi.credentials.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class TheHiveApi implements ICredentialType {
name = 'theHiveApi';
displayName = 'The Hive API';
documentationUrl = 'theHive';
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'ApiKey',
type: 'string',
typeOptions: { password: true },
default: '',
},
{
displayName: 'URL',
name: 'url',
default: '',
type: 'string',
description: 'The URL of TheHive instance',
placeholder: 'https://localhost:9000',
},
{
displayName: 'API Version',
name: 'apiVersion',
default: '',
type: 'options',
description: 'The version of api to be used',
options: [
{
name: 'TheHive 4+ (api v1)',
value: 'v1',
description:
'API version with TheHive 4 support, also works with TheHive 5 but not all features are supported',
},
{
name: 'TheHive 3 (api v0)',
value: '',
description: 'API version with TheHive 3 support',
},
],
},
{
displayName: 'Ignore SSL Issues',
name: 'allowUnauthorizedCerts',
type: 'boolean',
description: 'Whether to connect even if SSL certificate validation is not possible',
default: false,
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Authorization: '=Bearer {{$credentials?.ApiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials?.url}}',
url: '/api/case',
},
};
}