Skip to content

armeria-0.68.0

Choose a tag to compare

@trustin trustin released this 30 Jul 09:36
eebdf40

New features

  • A user can customize how Armeria handles duplicate path mappings via ServerBuilder.rejectedPathMappingHandler(RejectedPathMappingHandler). #1283 #1298

    ServerBuilder sb = new ServerBuilder();
    sb.rejectedPathMappingHandler((virtualHost, mapping, existingMapping) -> {
        // Do nothing.
    });
    sb.service("/", ...);
    sb.service("/", ...); // Ignored silently.
  • A user can now specify alternative responses for authorization success and failure when building an HttpAuthService using HttpAuthServiceBuilder. #506

    HttpAuthService authService = new HttpAuthServiceBuilder()
            .addBasicAuth(...)
            .onSuccess((delegate, ctx, req) -> HttpResponse.of(200))
            .onFailure((delegate, ctx, req, cause) -> HttpResponse.of(401))
            .build();
  • A user can now build a composite Authorizer from more than one Authorizers. #1303

    Authorizer<HttpRequest> a = ...;
    Authorizer<HttpRequest> b = ...;
    Authorizer<HttpRequest> c = ...;
    Authorizer<HttpRequest> composite = a.orElse(b).orElse(c);
  • Added EventLoopRule and EventLoopGroupRule for easier setup and tear-down of EventLoop and EventLoopGroup in a JUnit test case. #1304

    public class MyTest {
        @ClassRule
        public static final EventLoopRule eventLoop = new EventLoopRule();
        @Test
        public void runTask() {
            eventLoop.get().execute(() -> System.err.println("Hello!"));
        }
    }
  • Added RequestContext.executor() and RequestContext.contextAwareExecutor() for potentially easier mocking of RequestContext #1307

  • The frontend-side implementation of DocService has been rewritten with React, TypeScript and Material UI. #654 #1288

  • A user can now inject an arbitrary JavaScript string into DocService pages. It is also possible to inject example HTTP headers of DocService using JavaScript. This can be useful if you need to set the access token retrieved from browser's local storage to the example HTTP headers or to inject some analytics code. #1312

    • For example, a Firebase auth user would just add the following injected script to have debug requests automatically authenticated with a valid access token:

      armeria.registerHeaderProvider(function() {
        return firebase.auth().currentUser.getIdToken()
                       .then(token => { authorization: 'Bearer ' + token });
      });
  • Added a new system property com.linecorp.armeria.maxNumConnections so that a user can change the default max number of allowed server-side connections. The default value stays unchanged as Integer.MAX_VALUE. #1309

  • Retrofit client now supports HTTP response streaming, as well as waiting for the complete content. Streaming is disabled by default because there's no way to stream a response in a fully asynchronous manner in Retrofit (i.e. blocking calls will be involved). Use ArmeriaRetrofitBuilder.streaming(boolean) to enable this feature. #1296

Bug fixes

  • HealthCheckedEndpointGroup does not raise an unexpected exception anymore when there are duplicate endpoints to check. #1290
  • Suppressed duplicated log messages related with TLS handshake. #1297
  • Fixed a bug where Endpoint.toString() does not include an IP address. #1299
  • Fixed a bug where gRPC status code is not translated into HTTP status code properly for gRPC-Web. #1252 #1305
  • Fixed a bug where RequestLog does not contain gRPC request parameters and return values. #1308
    • For streaming requests or responses, only the first request or response will be recorded.
  • Fixed various notification issues where RequestLog does not reach COMPLETE availability for some edge cases. #1308

Breaking changes

  • HttpAuthService is now final. Use HttpAuthServiceBuilder for its customization. #1303

Dependencies

  • Brave 5.1.2 -> 5.1.4
  • Dropwizard Metrics 4.0.2 -> 4.0.3
  • gRPC 1.13.1 -> 1.13.2
  • Kafka 1.1.0 -> 1.1.1
  • Micrometer 1.0.5 -> 1.0.6
  • Netty 4.1.27 -> 4.1.28
  • RxJava 2.1.16 -> 2.1.17
  • ZooKeeper 3.4.12 -> 3.4.13