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
augmentors, authMechanism, blockingSecurityExecutor, testIdentityAssociation
Fields 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) int
Methods inherited from class io.quarkus.test.security.AbstractTestHttpAuthenticationMechanism
check, getChallenge, getCredentialTransport, getCredentialTypes, setAuthMechanism, setSecurityIdentityAugmentors
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.quarkus.vertx.http.runtime.security.HttpAuthenticationMechanism
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:
authenticate
in interfaceHttpAuthenticationMechanism
- Overrides:
authenticate
in classAbstractTestHttpAuthenticationMechanism
-
getPriority
public int getPriority()
-