lhisp-oauth-client 1.0.16 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lhisp-oauth-client",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "main": "src/index",
5
5
  "types": "src/index.d.ts",
6
6
  "repository": "git@bitbucket.org:leandro_costa/lhisp-oauth-client.git",
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import https from "https";
3
4
  import { AccessToken, ContentType, ExecutarRequestParams, LhispOauthClientConstructorParams } from "./lhisp-oauth-client.t";
4
5
  export declare class LhispOauthClient<iAccessToken extends AccessToken = AccessToken> {
@@ -9,7 +10,7 @@ export declare class LhispOauthClient<iAccessToken extends AccessToken = AccessT
9
10
  protected authHeaderName: string;
10
11
  protected tokenHeaderName: string;
11
12
  protected authContentType: ContentType;
12
- protected certificado?: string;
13
+ protected certificado?: string | Buffer;
13
14
  protected senhaCertificado?: string;
14
15
  protected authScope?: string;
15
16
  protected headers?: Headers;
@@ -24,7 +24,7 @@ class LhispOauthClient {
24
24
  this.tokenExpiresIn = 0;
25
25
  if (params.certificado) {
26
26
  this.agent = new https_1.default.Agent({
27
- pfx: params.certificado,
27
+ pfx: Buffer.isBuffer(params.certificado) ? params.certificado : Buffer.from(params.certificado, "base64"),
28
28
  passphrase: params.senhaCertificado,
29
29
  rejectUnauthorized: false,
30
30
  });