Skip to content

Latest commit

 

History

History
259 lines (147 loc) · 7.6 KB

CHANGELOG.md

File metadata and controls

259 lines (147 loc) · 7.6 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog

[6.0.0] - 2022-02-22

Changed

  • [Breaking change] Upgraded aws-sdk to v3 which has SecretsManager and KMS replaced by SecretsManagerClient and KMSClient class. The functionality and interface remains the same, the imports need to be changed.

[5.4.0] - 2024-02-08

Added

HttpClient options now accept clientExceptionStatusCodeMapOverride which can be used to override the default HTTP error status code mapping. This is useful e.g. when a dependent service is not following REST-ful best practices and e.g. returns a 403 when there's an intermittent network error communicating with the authorization service

[5.3.2] - 2024-02-08

Fixed

Error details of external HTTP error responses are propagated correctly

[5.3.1] - 2023-10-25

Fixed

The getUserToken() and getUserPrincipal() order was wrongly set in version 5.3.0. The new fixed priority order:

getUserToken()

  1. request.authorizerContext.jwt
  2. request.authorizerContext.accessToken (new)
  3. request.headers.Authorization

getUserPrincipal()

  1. authorizerContext.canonicalId (prefer canonicalId)
  2. authorizerContext.principalId (new)
  3. request.headers.Authorization

[5.3.0] - 2023-09-07

Changed

The getUserToken() and getUserPrincipal() methods now support multiple sources of for their values

getUserToken() in priority order:

  1. request.authorizerContext.accessToken (new)
  2. request.authorizerContext.jwt
  3. request.headers.Authorization

getUserPrincipal() in priority order:

  1. authorizerContext.principalId (new)
  2. authorizerContext.canonicalId
  3. request.headers.Authorization

[5.2.2] - 2023-08-25

Added

HttpClient now also logs unexpected (e.g. network) errors that are not coming from Axios

[5.2.0] - 2023-06-08

Added

Tracking of canonicalId and correlationId in New Relic.

!IMPORTANT! You must exclude the newrelic module from webpack.config.ts like so:

externals: ['newrelic']

Added

The DeleteRequest model.

[5.1.10] - 2023-01-13

Changed

The error middleware logs 4xx errors with log level WARN (previously INFO).

[5.1.9] - 2023-01-04

Changed

Upgraded jsonwebtoken version to 9.0.0 and aws-sdk to version 2.1287.0

[5.1.8] - 2022-12-15

Changed

Removed client_secret from API response

[5.1.7] - 2022-12-13

Changed

Add timeout option in HttpClient. If no value is provided the default is no timeout.

[5.1.6] - 2022-11-30

Changed

Removed logging of client_secret

[5.1.5] - 2022-11-15

Changed

The fix described in 5.1.4 missed one instance where the bug can occur. This change covers all known instances.

[5.1.4] - 2022-11-08

Changed

Using baseURL in the axios config without specifying the full URL resulted in an error in the exception handling. So the AxiosError was thrown instead of a customer ClientException.

[5.1.3] - 2022-10-03

Changed

RequestLogger now logs only Host, 'User-Agent, orion-correlation-id-parent, orion-correlation-id-root` headers.

[5.1.2] - 2022-09-14

Changed

Properties stageVariables, isBase64Encoded and route from openapi-factory are available in the Typescript definitions.

[5.1.1] - 2022-09-05

Changed

HttpApi payload version 2.0 events supported for openApiWrapper.

[5.1.0] - 2022-09-05

Changed

Dependencies aren't pinned to a fixed version to allow users of the library to independently upgrade minor (devDependencies) and patch (dependencies) versions. This will simplify fixing security alerts faster than in this library, for example by applying npm audit fix.

[5.0.0] - 2022-02-22

Changed

  • [Breaking change] TokenProvider was replaced by more specific KmsTokenProvider class. The functionality and interface remains the same, the imports need to be changed.

Added

  • New SecretsManagerTokenProvider that relies on AWS Secrets Manager to retrieve client ID and client secret. The advantage of using AWS Secrets Manager is that it can be supplied with a secret rotation function.

[4.1.5] - 2022-02-10

Changed

ClientException now maps HTTP 422 client responses to HTTP 422 server responses (was HTTP 503 before).

[4.1.2] - 2021-12-02

Changed

Expose the Location, Access-Control-Allow-Origin and orion-correlation-id-root headers

[4.1.1] - 2021-11-22

Fixed

  • ApiResponse default content-type header was renamed to Content-Type to overwrite the default header of openapi-factory.js
  • Also upgraded openapi-factory.js to get support of over-writing response headers

[4.1.0] - 2021-11-22

Changed

  • ApiResponse default content-type header was changed from application/links+json to application/hal+json

[4.0.0] - 2021-11-12

Changed

[3.0.1] - 2021-09-13

Fixed

[3.0.0] - 2021-09-10

Changed

  • HttpClient the retryAdapterEnhancer axios adapter was replaced by the more flexible retry-axios interceptor.
  • [Breaking change] HttpClientOptions.retryOptions now accepts extensive retry configuration such as specifying HTTP status codes that should be retried.
  • [Breaking change] All HTTP status codes are no longer retried by default. The new default are these ranges:
    • [100, 199] Informational, request still processing
    • [429, 429] Too Many Requests
    • [500, 599] Server errors

[2.2.2] - 2021-07-08

Fixed bugs

  • Some HTTP error log statements were throwing exceptions. This was due to accessing error.request.headers[orionCorrelationIdRoot] from Axios error object, where the headers object was undefined. The correct field was error.config.headers.

[2.2.1] - 2021-07-08

Changed

  • HttpClient logs additional request data (query parameters, body).

Added

  • HttpClientOptions now accepts logOptions object that allows enabling informational request and response (new) logs.
{
  logOptions: {
    enabledLogs: [HttpLogType.requests, HttpLogType.responses];
  }
}

[2.1.0] - 2021-03-11

Changed

  • ClientException propagates the original status code and details through multiple services. E.g. instead of error.detials?.data.details?.userDefinedProp use error.details?.userDefinedProp

[2.0.0] - 2021-03-08

Changed

  • ClientException no longer wraps details in an error property. Instead of error.details?.error.userDefinedProp use error.details?.userDefinedProp

[1.2.0] - 2021-02-16

Updated

  • [IMPORTANT!] HttpClient throws serialized Axios errors through ClientExceptions.