Use the getBasicAuthHeader util function for IBM

This commit is contained in:
Christos Nasikas 2024-05-10 18:47:21 +03:00
parent 4324d931f7
commit 7d9edabd6e

View file

@ -33,6 +33,7 @@ import {
GetIncidentResponseSchema, GetIncidentResponseSchema,
} from './schema'; } from './schema';
import { formatUpdateRequest } from './utils'; import { formatUpdateRequest } from './utils';
import { getBasicAuthHeader } from '../lib/get_basic_auth_header';
const VIEW_INCIDENT_URL = `#incidents`; const VIEW_INCIDENT_URL = `#incidents`;
@ -96,12 +97,10 @@ export class ResilientConnector extends CaseConnector<
} }
private getAuthHeaders() { private getAuthHeaders() {
const token = Buffer.from( return getBasicAuthHeader({
this.secrets.apiKeyId + ':' + this.secrets.apiKeySecret, username: this.secrets.apiKeyId,
'utf8' password: this.secrets.apiKeySecret,
).toString('base64'); });
return { Authorization: `Basic ${token}` };
} }
private getOrgUrl() { private getOrgUrl() {