Package io.quarkus.test.security
Annotation Interface TestSecurity
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionAdds attributes to aSecurityIdentityconfigured by this annotation.Selects authentication mechanism used in a path-based authentication.booleanIf this is false then all security constraints are disabled.String[]Used in combination withuser()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 authorizationEnabledIf this is false then all security constraints are disabled.- Default:
- true
-
user
String userIf this is non-zero then the test will be run with a SecurityIdentity with the specified username.- Default:
- ""
-
roles
String[] rolesUsed in combination withuser()to specify the users roles.- Default:
- {}
-
attributes
SecurityAttribute[] attributesAdds attributes to aSecurityIdentityconfigured by this annotation. The attributes can be retrieved by theSecurityIdentity.getAttributes()method.- Default:
- {}
-
authMechanism
String authMechanismSelects authentication mechanism used in a path-based authentication. If an HTTP Security Policy is used to enable path-based authentication, then aSecurityIdentitywill 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 theBasicAuthenticationshould be successfully authenticated.- Default:
- ""
-