io.vertx.serviceproxy

## Class ServiceJWTInterceptor

- java.lang.Object
- - io.vertx.serviceproxy.ServiceJWTInterceptor

- All Implemented Interfaces:
    java.util.function.Function<Message<JsonObject>,Future<Message<JsonObject>>>

      public class ServiceJWTInterceptor
      extends Object
      implements java.util.function.Function<Message<JsonObject>,Future<Message<JsonObject>>>

  Create an event bus service interceptor using a JWT auth that will verify all requests before the service is invoked

  Once a JWT is validated it will be queried for authorities. If authorities are missing a error 403 is returned.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServiceJWTInterceptor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ServiceJWTInterceptor` | `addAuthority(String authority)` Add a single authority to the authorities set.
    `Future<Message<JsonObject>>` | `apply(Message<JsonObject> msg)`
    `ServiceJWTInterceptor` | `clearAuthorities()` Clear the current set of authorities.
    `ServiceJWTInterceptor` | `setAuthorities(Set<String> authorities)` Set the required authorities for the service, once a JWT is validated it will be queried for these authorities.
    `ServiceJWTInterceptor` | `setJwtAuth(JWTAuth jwtAuth)` Set a JWT auth that will verify all requests before the service is invoked.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.function.Function

      `andThen, compose, identity`

- - ### Constructor Detail

    - #### ServiceJWTInterceptor

          public ServiceJWTInterceptor()

  - ### Method Detail

    - #### setJwtAuth

          public ServiceJWTInterceptor setJwtAuth(JWTAuth jwtAuth)

      Set a JWT auth that will verify all requests before the service is invoked.
      Parameters:
        `jwtAuth` - a JWT auth
      Returns:
        self

    - #### setAuthorities

          public ServiceJWTInterceptor setAuthorities(Set<String> authorities)

      Set the required authorities for the service, once a JWT is validated it will be queried for these authorities. If authorities are missing a error 403 is returned.
      Parameters:
        `authorities` - set of authorities
      Returns:
        self

    - #### addAuthority

          public ServiceJWTInterceptor addAuthority(String authority)

      Add a single authority to the authorities set.
      Parameters:
        `authority` - authority
      Returns:
        self

    - #### clearAuthorities

          public ServiceJWTInterceptor clearAuthorities()

      Clear the current set of authorities.
      Returns:
        self

    - #### apply

          public Future<Message<JsonObject>> apply(Message<JsonObject> msg)

      Specified by:
        `apply` in interface `java.util.function.Function<Message<JsonObject>,Future<Message<JsonObject>>>`

Copyright © 2018 Eclipse. All rights reserved.