From 15e139606fab75df54f02fc6299e861ca20cffff Mon Sep 17 00:00:00 2001 From: Leandro Costa Date: Mon, 27 Nov 2023 19:28:04 -0300 Subject: [PATCH 1/2] feat: add authHeaders --- src/lhisp-oauth-client.t.ts | 1 + src/lhisp-oauth-client.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/lhisp-oauth-client.t.ts b/src/lhisp-oauth-client.t.ts index 3ad36cc..a4bf572 100644 --- a/src/lhisp-oauth-client.t.ts +++ b/src/lhisp-oauth-client.t.ts @@ -15,6 +15,7 @@ export interface LhispOauthClientConstructorParams { authHeaderName?: string; tokenHeaderName?: string; headers?: Headers; + authHeaders?: Headers; grantType?: string; authContentType?: ContentType; sendAuthCredentialsOnRequestBody?: boolean; diff --git a/src/lhisp-oauth-client.ts b/src/lhisp-oauth-client.ts index dfc7649..c26024a 100644 --- a/src/lhisp-oauth-client.ts +++ b/src/lhisp-oauth-client.ts @@ -25,6 +25,7 @@ export class LhispOauthClient { protected senhaCertificado?: string; protected authScope?: string; protected headers?: AxiosHeaders; + protected authHeaders?: AxiosHeaders; protected grantType?: string; protected agent: https.Agent; protected accessToken?: iAccessToken; @@ -49,6 +50,7 @@ export class LhispOauthClient { this.certificado = params.certificado; this.headers = (params.headers ? params.headers : {}) as any as AxiosHeaders; + this.authHeaders = (params.authHeaders ? params.authHeaders : {}) as any as AxiosHeaders; this.apiUrl = params.apiUrl; this.authUrl = params.authUrl; this.authScope = params.authScope; @@ -101,6 +103,7 @@ export class LhispOauthClient { headers: { [this.authHeaderName]: this.getAuthHeaderValue(), "Content-Type": this.authContentType, + ...this.authHeaders, }, data: {}, }; From 5d3df07b208faa4b3c10a65d851f6ba980988476 Mon Sep 17 00:00:00 2001 From: bitbucket-pipelines Date: Mon, 27 Nov 2023 22:29:10 +0000 Subject: [PATCH 2/2] [skip CI] Version 1.0.25 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 45fed98..e443ee7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lhisp-oauth-client", - "version": "1.0.24", + "version": "1.0.25", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lhisp-oauth-client", - "version": "1.0.24", + "version": "1.0.25", "license": "MIT", "dependencies": { "axios": "^1.6.1", diff --git a/package.json b/package.json index 4f9850c..1156f5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lhisp-oauth-client", - "version": "1.0.24", + "version": "1.0.25", "main": "src/index", "types": "src/index.d.ts", "repository": "git@bitbucket.org:leandro_costa/lhisp-oauth-client.git",