Class MicroProfileAuthorization

java.lang.Object
io.vertx.mutiny.ext.auth.jwt.authorization.MicroProfileAuthorization
All Implemented Interfaces:
MutinyDelegate, AuthorizationProvider

public class MicroProfileAuthorization extends Object implements AuthorizationProvider, MutinyDelegate
Implementation of the Microprofile MP-JWT 1.1 RBAC based on the access token groups key.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Paulo Lopes.
See Also:
  • MicroProfileAuthorization
  • Field Details

  • Constructor Details

    • MicroProfileAuthorization

      public MicroProfileAuthorization(io.vertx.ext.auth.jwt.authorization.MicroProfileAuthorization delegate)
      Create a new instance of MicroProfileAuthorization delegating to the given (non-null) instance of MicroProfileAuthorization.
    • MicroProfileAuthorization

      public MicroProfileAuthorization(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.auth.jwt.authorization.MicroProfileAuthorization getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface AuthorizationProvider
      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • getAuthorizations

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> getAuthorizations(User user)
      Updates the user with the set of authorizations.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Specified by:
      getAuthorizations in interface AuthorizationProvider
      Parameters:
      user - user to lookup and update.
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • io.vertx.ext.auth.jwt.authorization.MicroProfileAuthorization#getAuthorizations(User)
    • getAuthorizationsAndAwait

      public void getAuthorizationsAndAwait(User user)
      Updates the user with the set of authorizations.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      user - user to lookup and update.
      See Also:
      • io.vertx.ext.auth.jwt.authorization.MicroProfileAuthorization#getAuthorizations(User)
    • getAuthorizationsAndForget

      public MicroProfileAuthorization getAuthorizationsAndForget(User user)
      Updates the user with the set of authorizations.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      user - user to lookup and update.
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • io.vertx.ext.auth.jwt.authorization.MicroProfileAuthorization#getAuthorizations(User)
    • create

      public static MicroProfileAuthorization create()
      Factory method to create a Authorization provider for tokens adhering to the MP-JWT 1.1 spec. When the user is known to not be a JWT, (e.g.: a OAuth2 response token) then the root claim is expected to be extracted from User.attributes() under the key accessToken.
      Returns:
      a AuthorizationProvider
    • getId

      public String getId()
      returns the id of the authorization provider
      Specified by:
      getId in interface AuthorizationProvider
      Returns:
    • newInstance

      public static MicroProfileAuthorization newInstance(io.vertx.ext.auth.jwt.authorization.MicroProfileAuthorization delegate)
      Creates a new instance of the MicroProfileAuthorization.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object