Package io.quarkus.test.security
Class PathBasedTestHttpAuthenticationMechanism
java.lang.Object
io.quarkus.test.security.AbstractTestHttpAuthenticationMechanism
io.quarkus.test.security.PathBasedTestHttpAuthenticationMechanism
- All Implemented Interfaces:
HttpAuthenticationMechanism
@ApplicationScoped
public class PathBasedTestHttpAuthenticationMechanism
extends AbstractTestHttpAuthenticationMechanism
When authentication mechanism is selected with the
TestSecurity.authMechanism() annotation attribute,
we must be sure that the test mechanism is primary identity provider for that authentication type.
For example when a test method is annotated with `@TestSecurity(authMechanism = "basic")`,
we want to be the ones providing basic authentication when no authorization headers are present,
and not the BasicAuthenticationMechanism mechanism.
This test mechanism must exist because when a path-specific authentication mechanism is selected,
for example via BasicAuthentication,
it is also required and therefore exactly one mechanism is enforced.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.quarkus.vertx.http.runtime.security.HttpAuthenticationMechanism
HttpAuthenticationMechanism.ChallengeSender -
Field Summary
Fields inherited from class io.quarkus.test.security.AbstractTestHttpAuthenticationMechanism
authMechanism, testIdentityAssociationFields inherited from interface io.quarkus.vertx.http.runtime.security.HttpAuthenticationMechanism
DEFAULT_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<io.quarkus.security.identity.SecurityIdentity>authenticate(io.vertx.ext.web.RoutingContext context, io.quarkus.security.identity.IdentityProviderManager identityProviderManager) intMethods inherited from class io.quarkus.test.security.AbstractTestHttpAuthenticationMechanism
check, getChallenge, getCredentialTransport, getCredentialTypes, setAuthMechanismMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.quarkus.vertx.http.runtime.security.HttpAuthenticationMechanism
getCredentialTransport, sendChallenge
-
Constructor Details
-
PathBasedTestHttpAuthenticationMechanism
public PathBasedTestHttpAuthenticationMechanism()
-
-
Method Details
-
authenticate
public io.smallrye.mutiny.Uni<io.quarkus.security.identity.SecurityIdentity> authenticate(io.vertx.ext.web.RoutingContext context, io.quarkus.security.identity.IdentityProviderManager identityProviderManager) - Specified by:
authenticatein interfaceHttpAuthenticationMechanism- Overrides:
authenticatein classAbstractTestHttpAuthenticationMechanism
-
getPriority
public int getPriority()
-