feat: add authHeaders
This commit is contained in:
parent
b6fe7d7107
commit
15e139606f
2 changed files with 4 additions and 0 deletions
|
@ -15,6 +15,7 @@ export interface LhispOauthClientConstructorParams {
|
||||||
authHeaderName?: string;
|
authHeaderName?: string;
|
||||||
tokenHeaderName?: string;
|
tokenHeaderName?: string;
|
||||||
headers?: Headers;
|
headers?: Headers;
|
||||||
|
authHeaders?: Headers;
|
||||||
grantType?: string;
|
grantType?: string;
|
||||||
authContentType?: ContentType;
|
authContentType?: ContentType;
|
||||||
sendAuthCredentialsOnRequestBody?: boolean;
|
sendAuthCredentialsOnRequestBody?: boolean;
|
||||||
|
|
|
@ -25,6 +25,7 @@ export class LhispOauthClient<iAccessToken extends AccessToken = AccessToken> {
|
||||||
protected senhaCertificado?: string;
|
protected senhaCertificado?: string;
|
||||||
protected authScope?: string;
|
protected authScope?: string;
|
||||||
protected headers?: AxiosHeaders;
|
protected headers?: AxiosHeaders;
|
||||||
|
protected authHeaders?: AxiosHeaders;
|
||||||
protected grantType?: string;
|
protected grantType?: string;
|
||||||
protected agent: https.Agent;
|
protected agent: https.Agent;
|
||||||
protected accessToken?: iAccessToken;
|
protected accessToken?: iAccessToken;
|
||||||
|
@ -49,6 +50,7 @@ export class LhispOauthClient<iAccessToken extends AccessToken = AccessToken> {
|
||||||
|
|
||||||
this.certificado = params.certificado;
|
this.certificado = params.certificado;
|
||||||
this.headers = (params.headers ? params.headers : {}) as any as AxiosHeaders;
|
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.apiUrl = params.apiUrl;
|
||||||
this.authUrl = params.authUrl;
|
this.authUrl = params.authUrl;
|
||||||
this.authScope = params.authScope;
|
this.authScope = params.authScope;
|
||||||
|
@ -101,6 +103,7 @@ export class LhispOauthClient<iAccessToken extends AccessToken = AccessToken> {
|
||||||
headers: {
|
headers: {
|
||||||
[this.authHeaderName]: this.getAuthHeaderValue(),
|
[this.authHeaderName]: this.getAuthHeaderValue(),
|
||||||
"Content-Type": this.authContentType,
|
"Content-Type": this.authContentType,
|
||||||
|
...this.authHeaders,
|
||||||
},
|
},
|
||||||
data: {},
|
data: {},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue