feat(Rundeck Node): Update credential with test and make useable in HTTP Request node (#3879)

* add support for authenticate, test to RundeckApi Credentials

* ensure that the RunDeckApi note uses the authentication mechanism
defined incredentials
This commit is contained in:
AndLLA
2022-10-16 15:26:31 +02:00
committed by GitHub
parent b67e41b45e
commit fc87650180
2 changed files with 31 additions and 6 deletions

View File

@@ -1,4 +1,9 @@
import { ICredentialType, INodeProperties } from 'n8n-workflow';
import {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class RundeckApi implements ICredentialType {
name = 'rundeckApi';
@@ -19,4 +24,22 @@ export class RundeckApi implements ICredentialType {
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',
},
};
}