From b9e93c52f68d231e1a547a65ff94647fcf4ed8b9 Mon Sep 17 00:00:00 2001 From: Leandro Costa Date: Wed, 8 Nov 2023 23:01:54 -0300 Subject: [PATCH 1/3] feat: parse certificado from base64 string --- src/lhisp-oauth-client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lhisp-oauth-client.ts b/src/lhisp-oauth-client.ts index a8920e1..f18231b 100644 --- a/src/lhisp-oauth-client.ts +++ b/src/lhisp-oauth-client.ts @@ -36,7 +36,7 @@ export class LhispOauthClient { constructor(params: LhispOauthClientConstructorParams) { if (params.certificado) { this.agent = new https.Agent({ - pfx: params.certificado, + pfx: Buffer.isBuffer(params.certificado) ? params.certificado : Buffer.from(params.certificado, "base64"), passphrase: params.senhaCertificado, rejectUnauthorized: false, }); From da791ed2cacef236a397345ef54e26189130684d Mon Sep 17 00:00:00 2001 From: Leandro Costa Date: Wed, 8 Nov 2023 23:05:07 -0300 Subject: [PATCH 2/3] fix: adding certificado type --- src/lhisp-oauth-client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lhisp-oauth-client.ts b/src/lhisp-oauth-client.ts index f18231b..213d8b4 100644 --- a/src/lhisp-oauth-client.ts +++ b/src/lhisp-oauth-client.ts @@ -21,7 +21,7 @@ export class LhispOauthClient { protected authHeaderName: string; protected tokenHeaderName: string; protected authContentType: ContentType; - protected certificado?: string; + protected certificado?: string | Buffer; protected senhaCertificado?: string; protected authScope?: string; protected headers?: Headers; From 336a423cef3dfa2f0231e938ac229e3d52de58e8 Mon Sep 17 00:00:00 2001 From: bitbucket-pipelines Date: Thu, 9 Nov 2023 02:05:57 +0000 Subject: [PATCH 3/3] [skip CI] Version 1.0.17 --- 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 f113679..ed0b410 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lhisp-oauth-client", - "version": "1.0.16", + "version": "1.0.17", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lhisp-oauth-client", - "version": "1.0.16", + "version": "1.0.17", "license": "MIT", "dependencies": { "axios": "^1.4.0", diff --git a/package.json b/package.json index 0fcac67..9115487 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lhisp-oauth-client", - "version": "1.0.16", + "version": "1.0.17", "main": "src/index", "types": "src/index.d.ts", "repository": "git@bitbucket.org:leandro_costa/lhisp-oauth-client.git",