github MicahParks/keyfunc v1.3.0
Add response extractor

latest releases: v3.8.0, v3.7.0, v3.6.2...
3 years ago

Edit: This release has been retracted due to a bug in ResponseExtractorStatusOK not closing the response body. Please upgrade to v1.4.0.

The purpose of this release is to allow for custom HTTP response extractors. A response extractor is responsible for consuming an *http.Response and producing the raw JWK Set JSON. It is also responsible for closing the body of the *http.Response.

I plan on following up this release with v1.3.1 soon. This upcoming release will change the default behavior of how the package handles HTTP response codes, returning a non-nil error in cases such as a 500 HTTP response code.

New additions:

  • keyfunc.Options has a new field named ResponseExtractor that, when provided, is responsible for the behavior described above.
  • keyfunc.ResponseExtractorStatusOK is a helper function to fit into the ResponseExtractor field in keyfunc.Options.

Relevant pull requests:

Relevant issues:

Don't miss a new keyfunc release

NewReleases is sending notifications on new releases.