Skip to content

Commit 258cb77

Browse files
committed
Sync documentation of main branch
1 parent ae3cae3 commit 258cb77

File tree

5 files changed

+75
-5
lines changed

5 files changed

+75
-5
lines changed

_generated-doc/main/infra/quarkus-all-build-items.adoc

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7889,10 +7889,10 @@ _No Javadoc found_
78897889

78907890

78917891

7892-
a| https://github.com/quarkusio/quarkus/blob/main/extensions/security/spi/src/main/java/io/quarkus/security/spi/ClassSecurityCheckAnnotationBuildItem.java[`io.quarkus.security.spi.ClassSecurityCheckAnnotationBuildItem`, window="_blank"]
7892+
a| https://github.com/quarkusio/quarkus/blob/main/extensions/security/spi/src/main/java/io/quarkus/security/spi/ClassSecurityAnnotationBuildItem.java[`io.quarkus.security.spi.ClassSecurityAnnotationBuildItem`, window="_blank"]
78937893
[.description]
78947894
--
7895-
Allows to create additional security checks for standard security annotations defined on a class level. We strongly recommended to secure CDI beans with `AdditionalSecuredMethodsBuildItem` if additional security is required. If you decide to use this build item, you must use class security check storage and apply checks manually. Thus, it's only suitable for very special cases.
7895+
Allows to create additional security checks for standard security annotations defined on a class level and security interceptors for security annotations (such as selecting tenant or authentication mechanism). We strongly recommended to secure CDI beans with `AdditionalSecuredMethodsBuildItem` if additional security is required. If you decide to use this build item, you must use class security check storage and apply checks manually. Thus, it's only suitable for very special cases and intended for internal use in Quarkus core extensions.
78967896
-- a|`org.jboss.jandex.DotName classAnnotation`
78977897
78987898
_No Javadoc found_
@@ -7903,7 +7903,7 @@ _No Javadoc found_
79037903
a| https://github.com/quarkusio/quarkus/blob/main/extensions/security/spi/src/main/java/io/quarkus/security/spi/ClassSecurityCheckStorageBuildItem.java[`io.quarkus.security.spi.ClassSecurityCheckStorageBuildItem`, window="_blank"]
79047904
[.description]
79057905
--
7906-
Security check storage containing additional security checks created for secured classes matching one of the `ClassSecurityCheckAnnotationBuildItem` filters during the static init.
7906+
Security check storage containing additional security checks created for secured classes matching one of the `ClassSecurityAnnotationBuildItem` filters during the static init.
79077907
-- a|`java.util.Map<DotName,Object> classNameToSecurityCheck`
79087908
79097909
_No Javadoc found_
@@ -7941,6 +7941,21 @@ _No Javadoc found_
79417941

79427942

79437943

7944+
a| https://github.com/quarkusio/quarkus/blob/main/extensions/security/spi/src/main/java/io/quarkus/security/spi/RegisterClassSecurityCheckBuildItem.java[`io.quarkus.security.spi.RegisterClassSecurityCheckBuildItem`, window="_blank"]
7945+
[.description]
7946+
--
7947+
Registers security check against `io.quarkus.security.spi.ClassSecurityCheckStorageBuildItem` for security annotation instances passed in this build item. This class is exposed for limited Quarkus core-specific use cases and can be changed or be removed if necessary. If other extensions require this build item, please open Quarkus issue so that we document and test the use case.
7948+
-- a|`org.jboss.jandex.DotName className`
7949+
7950+
_No Javadoc found_
7951+
7952+
`org.jboss.jandex.AnnotationInstance securityAnnotationInstance`
7953+
7954+
_No Javadoc found_
7955+
7956+
7957+
7958+
79447959
a| https://github.com/quarkusio/quarkus/blob/main/extensions/security/spi/src/main/java/io/quarkus/security/spi/RolesAllowedConfigExpResolverBuildItem.java[`io.quarkus.security.spi.RolesAllowedConfigExpResolverBuildItem`, window="_blank"]
79457960
[.description]
79467961
--
@@ -8738,6 +8753,22 @@ If this interceptor is always accompanied by `io.quarkus.security.spi.runtime.Se
87388753

87398754

87408755

8756+
a| https://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/EagerSecurityInterceptorClassesBuildItem.java[`io.quarkus.vertx.http.deployment.EagerSecurityInterceptorClassesBuildItem`, window="_blank"]
8757+
[.description]
8758+
--
8759+
Bears collected intercepted classes annotated with registered security annotation if and only if class-level security is applied due to the matching `io.quarkus.security.spi.ClassSecurityAnnotationBuildItem` annotation. Security interceptor needs to be created and applied for each intercepted class.
8760+
@see EagerSecurityInterceptorBindingBuildItem for more information on security filters
8761+
-- a|`java.util.Map<String,Set<String>> bindingValueToInterceptedClasses`
8762+
8763+
Annotation binding value: '@HttpAuthenticationMechanism("custom")' => 'custom'; mapped to annotated class names
8764+
8765+
`org.jboss.jandex.DotName interceptorBinding`
8766+
8767+
Interceptor binding annotation name, like `HttpAuthenticationMechanism` .
8768+
8769+
8770+
8771+
87418772
a| https://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/EagerSecurityInterceptorMethodsBuildItem.java[`io.quarkus.vertx.http.deployment.EagerSecurityInterceptorMethodsBuildItem`, window="_blank"]
87428773
[.description]
87438774
--

_versions/main/guides/appcds.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ If you are building an application that will target JDK 24+ you can take advanta
105105
-Dquarkus.package.jar.appcds.use-aot=true
106106
----
107107
108-
The result of this flag (plus the `-Dquarkus.package.jar.appcds.use-aot=true` original one) is the creation of an AOT cache file
108+
The result of this flag (plus the `-Dquarkus.package.jar.appcds.enabled=true` original one) is the creation of an AOT cache file
109109
named `app.aot`.
110110
111111
You can use this AOT cache when launching the application like so:

_versions/main/guides/security-authentication-mechanisms.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ quarkus.http.auth.permission.bearer.auth-mechanism=bearer
686686

687687
Ensure that the value of the `auth-mechanism` property matches the authentication scheme supported by `HttpAuthenticationMechanism`, for example, `basic`, `bearer`, or `form`.
688688

689+
[[use-annotations-for-path-based-auth]]
689690
==== Use annotations to enable path-based authentication for Jakarta REST endpoints
690691

691692
It is possible to use annotations to select an authentication mechanism specific to each Jakarta REST endpoint.

_versions/main/guides/security-openid-connect-multitenancy.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,13 @@ quarkus.http.auth.permission.authenticated.applies-to=JAXRS <1>
664664
<1> Tell Quarkus to run the HTTP permission check after the tenant has been selected with the `@Tenant` annotation.
665665
====
666666

667+
[NOTE]
668+
====
669+
The `io.quarkus.oidc.Tenant` annotation can be used to select tenant for a WebSockets Next server endpoint.
670+
The annotation must be placed on the endpoint class, because the `SecurityIdentity` is created before the HTTP connection is upgraded to a WebSocket connection.
671+
For more information about the HTTP upgrade security, see the xref:websockets-next-reference.adoc#secure-http-upgrade[Secure HTTP upgrade] section of the Quarkus "WebSockets Next reference" guide.
672+
====
673+
667674
[[tenant-config-resolver]]
668675
=== Dynamic tenant configuration resolution
669676

_versions/main/guides/websockets-next-reference.adoc

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,37 @@ quarkus.http.auth.permission.http-upgrade.paths=/end
846846
quarkus.http.auth.permission.http-upgrade.policy=authenticated
847847
----
848848

849+
Security annotations used during authentication must be placed on an endpoint class as well, for the `SecurityIdentity` is created before the websocket connection is opened.
850+
851+
.Select Bearer token authentication mechanism
852+
[source, java]
853+
----
854+
package io.quarkus.websockets.next.test.security;
855+
856+
import io.quarkus.oidc.BearerTokenAuthentication;
857+
import io.quarkus.websockets.next.OnTextMessage;
858+
import io.quarkus.websockets.next.WebSocket;
859+
860+
@BearerTokenAuthentication <1>
861+
@WebSocket(path = "/end")
862+
public class Endpoint {
863+
864+
@OnTextMessage
865+
String echo(String message) {
866+
return message;
867+
}
868+
869+
}
870+
----
871+
<1> Require that an opening WebSocket handshake request is authenticated using the bearer token authentication.
872+
See the xref:security-authentication-mechanisms.adoc#use-annotations-for-path-based-auth[Authentication mechanisms in Quarkus] guide for more information about selecting authentication mechanisms with annotations.
873+
874+
[source,properties]
875+
----
876+
quarkus.http.auth.proactive=false <1>
877+
----
878+
<1> Start authenticating an opening WebSocket handshake request only when the `io.quarkus.oidc.BearerTokenAuthentication` annotation is detected.
879+
849880
[[secure-callback-methods]]
850881
==== Secure WebSocket endpoint callback methods
851882

@@ -937,7 +968,7 @@ public class PermissionChecker {
937968
938969
@PermissionChecker("product:premium")
939970
public boolean canGetPremiumProduct(SecurityIdentity securityIdentity) { <1>
940-
String username = currentIdentity.getPrincipal().getName();
971+
String username = securityIdentity.getPrincipal().getName();
941972
942973
RoutingContext routingContext = HttpSecurityUtils.getRoutingContextAttribute(securityIdentity);
943974
String initialHttpUpgradePath = routingContext == null ? null : routingContext.normalizedPath();

0 commit comments

Comments
 (0)