n8n/packages/nodes-base/credentials/RundeckApi.credentials.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
878 B
TypeScript
Raw Normal View History

import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
2020-03-12 11:57:57 -07:00
2020-03-15 11:20:41 -07:00
export class RundeckApi implements ICredentialType {
name = 'rundeckApi';
2020-03-15 11:20:41 -07:00
displayName = 'Rundeck API';
documentationUrl = 'rundeck';
properties: INodeProperties[] = [
2020-03-12 11:57:57 -07:00
{
displayName: 'Url',
name: 'url',
type: 'string',
2020-03-12 11:57:57 -07:00
default: '',
2020-03-15 11:20:41 -07:00
placeholder: 'http://127.0.0.1:4440',
2020-03-12 11:57:57 -07:00
},
{
displayName: 'Token',
name: 'token',
type: 'string',
typeOptions: { password: true },
2020-03-12 11:57:57 -07:00
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
'user-agent': 'n8n',
'X-Rundeck-Auth-Token': '={{$credentials?.token}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials.url}}',
url: '/api/14/system/info',
method: 'GET',
},
};
2020-03-12 11:57:57 -07:00
}