Annotation Interface TestSecurity


@Retention(RUNTIME) @Target({TYPE,METHOD}) @Inherited public @interface TestSecurity
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Adds attributes to a SecurityIdentity configured by this annotation.
    Selects authentication mechanism used in a path-based authentication.
    boolean
    If this is false then all security constraints are disabled.
    Used in combination with user() to specify the users roles.
    If this is non-zero then the test will be run with a SecurityIdentity with the specified username.
  • Element Details

    • authorizationEnabled

      boolean authorizationEnabled
      If this is false then all security constraints are disabled.
      Default:
      true
    • user

      String user
      If this is non-zero then the test will be run with a SecurityIdentity with the specified username.
      Default:
      ""
    • roles

      String[] roles
      Used in combination with user() to specify the users roles.
      Default:
      {}
    • attributes

      SecurityAttribute[] attributes
      Adds attributes to a SecurityIdentity configured by this annotation. The attributes can be retrieved by the SecurityIdentity.getAttributes() method.
      Default:
      {}
    • authMechanism

      String authMechanism
      Selects authentication mechanism used in a path-based authentication. If an HTTP Security Policy is used to enable path-based authentication, then a SecurityIdentity will only be provided by this annotation if this attribute matches the 'quarkus.http.auth.permission."permissions".auth-mechanism' configuration property. Situation is similar when annotations are used to enable path-based authentication for Jakarta REST endpoints. For example, set this attribute to 'basic' if an HTTP request to Jakarta REST endpoint annotated with the BasicAuthentication should be successfully authenticated.
      Default:
      ""