Class HttpSecurityUtils
java.lang.Object
io.quarkus.vertx.http.runtime.security.HttpSecurityUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAuthenticationFailureToEvent(io.quarkus.security.AuthenticationFailedException exception, io.vertx.ext.web.RoutingContext routingContext) AddsAuthenticationFailedExceptionfailure to the currentRoutingContext.static io.quarkus.security.AuthenticationFailedExceptiongetAuthenticationFailureFromEvent(io.vertx.ext.web.RoutingContext routingContext) static StringgetCommonName(X500Principal principal) static DefaultAuthConfig(package private) static StringgetRdnValue(X500Principal principal, String rdnType) static io.vertx.ext.web.RoutingContextgetRoutingContextAttribute(io.quarkus.security.identity.request.AuthenticationRequest request) static io.vertx.ext.web.RoutingContextgetRoutingContextAttribute(io.quarkus.security.identity.SecurityIdentity identity) static io.vertx.ext.web.RoutingContextgetRoutingContextAttribute(Map<String, Object> authenticationRequestAttributes) getSecurityIdentities(io.quarkus.security.identity.SecurityIdentity identity) Provides all theSecurityIdentitycreated by the inclusive authentication.getSecurityIdentities(io.vertx.ext.web.RoutingContext routingContext) When inclusive authentication is enabled, we allow all authentication mechanisms to produce identity.static StringnormalizePath(String path) Fully normalizes a request path to its canonical form, closing the gap between the security layer's partial decoding and downstream handlers' full decoding.static StringRemoves matrix parameters from the path.static io.quarkus.security.identity.request.AuthenticationRequestsetRoutingContextAttribute(io.quarkus.security.identity.request.AuthenticationRequest request, io.vertx.ext.web.RoutingContext context)
-
Field Details
-
ROUTING_CONTEXT_ATTRIBUTE
- See Also:
-
SECURITY_IDENTITIES_ATTRIBUTE
- See Also:
-
COMMON_NAME
- See Also:
-
-
Method Details
-
pathWithoutMatrixParams
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.
-
normalizePath
Fully normalizes a request path to its canonical form, closing the gap between the security layer's partial decoding and downstream handlers' full decoding.Transformations applied in order:
- Fully decode percent-encoded characters (loop handles double/triple encoding)
- Strip matrix parameters — after decoding so that encoded semicolons (
%3B) are caught - Remove null bytes
- Normalize backslashes to forward slashes
- Resolve dot segments (
.and..)
- Parameters:
path- the path fromRoutingContext.normalizedPath()- Returns:
- the fully normalized path
-
getSecurityIdentities
public static Map<String,io.quarkus.security.identity.SecurityIdentity> getSecurityIdentities(io.quarkus.security.identity.SecurityIdentity identity) Provides all theSecurityIdentitycreated by the inclusive authentication.- Returns:
- null if
RoutingContextis not available orgetSecurityIdentities(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
-
getCommonName
-
getRdnValue
-
addAuthenticationFailureToEvent
public static void addAuthenticationFailureToEvent(io.quarkus.security.AuthenticationFailedException exception, io.vertx.ext.web.RoutingContext routingContext) AddsAuthenticationFailedExceptionfailure to the currentRoutingContext. Main motivation is to haveAuthenticationFailedException.getAttributes()available during challenge. -
getAuthenticationFailureFromEvent
public static io.quarkus.security.AuthenticationFailedException getAuthenticationFailureFromEvent(io.vertx.ext.web.RoutingContext routingContext) -
getDefaultAuthConfig
-