Class to build and execute HTTP requests with AWS signing

Example

const response: HttpResponse<OAuthResponse> = await new AzureHttpRequestBuilder({
method: 'GET',
baseURL: `https://api.lemoncloud.io/v1/oauth`,
})
.addHeaders({ Cookie: this.cookie })
.setParams({ page: 0 })
.execute();

Constructors

Properties

axiosInstance: AxiosInstance
config: AxiosRequestConfig<any> = ...
tokenStorage: AzureStorageService

The AWS storage service for token management.

Methods

  • Private

    Adds a Bearer token to the request headers. Retrieves the identityToken from the token storage and sets it as the Authorization header.

    Returns Promise<void>

    • A promise that resolves when the token is added.

    Async

  • Private

    Adds code parameters to the request configuration. Retrieves the hostKey and clientId from the token storage and sets them as request parameters.

    Returns Promise<void>

    • A promise that resolves when the parameters are added.

    Async

  • Private

    Adds the x-lemon-identity token to the request headers if required. Checks if the USE_X_LEMON_IDENTITY_KEY is set in the token storage and, if true, retrieves the identityToken and sets it as the x-lemon-identity header.

    Returns Promise<void>

    • A promise that resolves when the token is added.

    Async