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.

  • Constructor Details

    • PathBasedTestHttpAuthenticationMechanism

      public PathBasedTestHttpAuthenticationMechanism()
  • Method Details