Class HttpSecurityUtils

java.lang.Object
io.quarkus.vertx.http.runtime.security.HttpSecurityUtils

public final class HttpSecurityUtils extends Object
  • Field Details

  • Method Details

    • pathWithoutMatrixParams

      public static String pathWithoutMatrixParams(String path)
      Removes matrix parameters from the path.

      The path may contain one or more path segments separated by a forward slash `/`. Each path segment may contain matrix parameters that are separated from the path value by a semicolon ';' character.

      When the current path segment contains a semicolon ';', it has all its data removed starting from this semicolon character.

      For example, passing both `/a;/b;` and `/a;a1=1;a2=2/b;b1=1;b2=2` paths to this function produces the `/a/b` path.

      Parameters:
      path - the path that may contain matrix parameters.
      Returns:
      the path without the matrix parameters.
    • getSecurityIdentities

      public static Map<String,io.quarkus.security.identity.SecurityIdentity> getSecurityIdentities(io.quarkus.security.identity.SecurityIdentity identity)
      Provides all the SecurityIdentity created by the inclusive authentication.
      Returns:
      null if RoutingContext is not available or getSecurityIdentities(RoutingContext)
      See Also:
    • getSecurityIdentities

      public static Map<String,io.quarkus.security.identity.SecurityIdentity> getSecurityIdentities(io.vertx.ext.web.RoutingContext routingContext)
      When inclusive authentication is enabled, we allow all authentication mechanisms to produce identity. However, only the first identity (provided by applicable mechanism with the highest priority) is stored in the CDI container. Therefore, we put all the identities into the RoutingContext.
      Returns:
      null if no identities were found or map with authentication mechanism key and security identity value
    • setRoutingContextAttribute

      public static io.quarkus.security.identity.request.AuthenticationRequest setRoutingContextAttribute(io.quarkus.security.identity.request.AuthenticationRequest request, io.vertx.ext.web.RoutingContext context)
    • getRoutingContextAttribute

      public static io.vertx.ext.web.RoutingContext getRoutingContextAttribute(io.quarkus.security.identity.request.AuthenticationRequest request)
    • getRoutingContextAttribute

      public static io.vertx.ext.web.RoutingContext getRoutingContextAttribute(io.quarkus.security.identity.SecurityIdentity identity)
    • getRoutingContextAttribute

      public static io.vertx.ext.web.RoutingContext getRoutingContextAttribute(Map<String,Object> authenticationRequestAttributes)
    • getCommonName

      public static String getCommonName(X500Principal principal)
    • getRdnValue

      static String getRdnValue(X500Principal principal, String rdnType)
    • addAuthenticationFailureToEvent

      public static void addAuthenticationFailureToEvent(io.quarkus.security.AuthenticationFailedException exception, io.vertx.ext.web.RoutingContext routingContext)
      Adds AuthenticationFailedException failure to the current RoutingContext. Main motivation is to have AuthenticationFailedException.getAttributes() available during challenge.
    • getAuthenticationFailureFromEvent

      public static io.quarkus.security.AuthenticationFailedException getAuthenticationFailureFromEvent(io.vertx.ext.web.RoutingContext routingContext)
    • getDefaultAuthConfig

      public static DefaultAuthConfig getDefaultAuthConfig()