Skip to content

Commit

Permalink
update credentials test request and authenticate
Browse files Browse the repository at this point in the history
  • Loading branch information
Stamsy committed Nov 20, 2024
1 parent 4b9ad8a commit 01757f9
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions packages/nodes-base/credentials/SolarWindsIpamApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export class SolarWindsIpamApi implements ICredentialType {
default: '',
},
{
displayName: 'API Key',
name: 'apiKey',
displayName: 'API Token',
name: 'apiToken',
required: true,
type: 'string',
typeOptions: { password: true },
Expand All @@ -45,17 +45,27 @@ export class SolarWindsIpamApi implements ICredentialType {
type: 'generic',
properties: {
headers: {
'x-api-key': '={{$credentials.apiKey}}',
Accept: 'application/json',
Authorization: '=Bearer {{$credentials.apiToken}}',
'Content-Type': 'application/json-rpc',
},
},
};

test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials.url}}'.replace(/\/$/, ''),
url: '/v1/metrics',
url: '/v1/logs',
method: 'GET',
},
rules: [
{
type: 'responseSuccessBody',
properties: {
key: 'error',
value: 'invalid_auth',
message: 'Invalid access token',
},
},
],
};
}

0 comments on commit 01757f9

Please # to comment.