enonic / lib-http-client

Http Client Library for Enonic XP.
Apache License 2.0
0 stars 4 forks source link

Bump methanol from 1.6.0 to 1.7.0 #98

Closed dependabot[bot] closed 2 years ago

dependabot[bot] commented 2 years ago

Bumps methanol from 1.6.0 to 1.7.0.

Release notes

Sourced from methanol's releases.

v1.7.0

1.7.0

A full year has passed since the last Methanol release! Time truly flies. It's been difficult tofind the time to cut this release due to my senior college year & other life circumstances, but here we are!

  • The Jackson adapter has been reworked to support the multitude of formats supported by Jackson, not only JSON ([#45 (https://github-redirect.dependabot.com/mizosoft/methanol/issues/45)). That means you can now pass arbitrary ObjectMapper instances along with one or more MediaTypes describing their formats. For instance, here's a provider for a Jackson-based XML decoder.

    public static class JsonDecoderProvider {
      private JsonDecoderProvider() {}
    

    public static BodyAdapter.Decoder provider() { return JacksonAdapterFactory.createEncoder(new XmlMapper(), MediaType.TEXT_XML); } }

    Binary formats (e.g. protocol buffers) usually require a schema for each type. ObjectReaderFacotry & ObjectWritierFactory have been added for this purpose. For instance, here's a provider for a protocol-buffers decoder. You'll need to know which types to expect beforehand.

    public static class ProtobufDecoderProvider {
      private ProtobufDecoderProvider() {}
    

    record Point(int x, int y) {}

    public static BodyAdapter.Decoder provider() { var schemas = Map.of( Point.class, ProtobufSchemaLoader.std.parse( """ message Point { required int32 x = 1; required int32 y = 2; } """), ...);

    // Apply the corresponding schema for each created ObjectReader
    ObjectReaderFactory readerFactory = 
        (mapper, type) -> mapper.readerFor(type).with(schemes.get(type.rawType()));
    return JacksonAdapterFactory.createEncoder(
        new ProtobufMapper(), readerFactory, MediaType.TEXT_XML);
    

    } }

  • To avoid ambiguity, JacksonAdapterFactory::createDecoder & JacksonAdapterFactory::createEncoder have been deprecated and replaced with JacksonAdapterFactory::createJsonDecoder & JacksonAdapterFactory::createJsonEncoder respectively.

  • Added timeouts for receiving all response headers (#49). You can use these along with read timeouts to set more granular timing constraints for your requests when request timeouts are too strict.

    var client = Methanol.newBuilder()
    

... (truncated)

Changelog

Sourced from methanol's changelog.

Version 1.7.0

9-5-2022

A full year has passed since the last Methanol release! Time truly flies. It's been difficult to find the time to cut this release due to my senior college year & other life circumstances, but here we are!

  • The Jackson adapter has been reworked to support the multitude of formats supported by Jackson, not only JSON (#45). That means you can now pass arbitrary ObjectMapper instances along with one or more MediaTypes describing their formats. For instance, here's a provider for a Jackson-based XML decoder.

    public static class JsonDecoderProvider {
      private JsonDecoderProvider() {}
    

    public static BodyAdapter.Decoder provider() { return JacksonAdapterFactory.createEncoder(new XmlMapper(), MediaType.TEXT_XML); } }

    Binary formats (e.g. protocol buffers) usually require a schema for each type. ObjectReaderFacotry & ObjectWritierFactory have been added for this purpose. For instance, here's a provider for a protocol-buffers decoder. You'll need to know which types to expect beforehand.

    public static class ProtobufDecoderProvider {
      private ProtobufDecoderProvider() {}
    

    record Point(int x, int y) {}

    public static BodyAdapter.Decoder provider() { var schemas = Map.of( Point.class, ProtobufSchemaLoader.std.parse( """ message Point { required int32 x = 1; required int32 y = 2; } """), ...);

    // Apply the corresponding schema for each created ObjectReader
    ObjectReaderFactory readerFactory = 
        (mapper, type) -> mapper.readerFor(type).with(schemes.get(type.rawType()));
    return JacksonAdapterFactory.createEncoder(
        new ProtobufMapper(), readerFactory, MediaType.TEXT_XML);
    

    }

... (truncated)

Commits
  • cff03de Release 1.7.0
  • 23d906d Javadoc edits
  • 0082fa1 TimeoutSubscriber doesn't detect overflow anymore
  • 815a733 Simplify TimeoutSubscriber
  • 2e309cc Use cached thread pools in store tests to avoid starvation
  • 2ea96bd Properly manage StoreContexts in TCK tests
  • 2925bcb Doc config touch-ups
  • 8f0608e Change workflow java version to 17
  • db71926 Never require signing key to be defined
  • 39a89e2 Use base64 encoding for signing key
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
codecov[bot] commented 2 years ago

Codecov Report

Merging #98 (e955b23) into master (98f7fd9) will increase coverage by 11.42%. The diff coverage is 92.34%.

@@              Coverage Diff              @@
##             master      #98       +/-   ##
=============================================
+ Coverage     81.49%   92.91%   +11.42%     
- Complexity      109      154       +45     
=============================================
  Files             6        8        +2     
  Lines           362      466      +104     
  Branches         48       51        +3     
=============================================
+ Hits            295      433      +138     
+ Misses           38       16       -22     
+ Partials         29       17       -12     
Impacted Files Coverage Δ
...a/com/enonic/lib/http/client/CertificateTools.java 77.77% <77.77%> (-2.23%) :arrow_down:
.../com/enonic/lib/http/client/RefPathByteSource.java 82.75% <82.75%> (ø)
.../com/enonic/lib/http/client/HttpClientFactory.java 91.50% <91.50%> (ø)
...com/enonic/lib/http/client/HttpRequestHandler.java 94.00% <92.18%> (+10.01%) :arrow_up:
...com/enonic/lib/http/client/HttpRequestFactory.java 93.10% <93.10%> (ø)
...ava/com/enonic/lib/http/client/ResponseMapper.java 97.14% <95.65%> (+22.81%) :arrow_up:
...rc/main/java/com/enonic/lib/http/client/Utils.java 97.64% <97.64%> (ø)
...n/java/com/enonic/lib/http/client/CertWithKey.java 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9f4740a...e955b23. Read the comment docs.