Skip to content

Commit 7072735

Browse files
committed
Sync documentation of main branch
1 parent 0da3287 commit 7072735

File tree

9 files changed

+268
-48
lines changed

9 files changed

+268
-48
lines changed

_generated-doc/main/config/quarkus-all-config.adoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14061,6 +14061,27 @@ endif::add-copy-button-to-env-var[]
1406114061
|boolean
1406214062
|`true`
1406314063

14064+
a|icon:lock[title=Fixed at build time] [[quarkus-vertx-http_quarkus-http-auth-propagate-security-identity]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-auth-propagate-security-identity[`quarkus.http.auth.propagate-security-identity`]##
14065+
ifdef::add-copy-button-to-config-props[]
14066+
config_property_copy_button:+++quarkus.http.auth.propagate-security-identity+++[]
14067+
endif::add-copy-button-to-config-props[]
14068+
14069+
14070+
[.description]
14071+
--
14072+
Propagate security identity to support its injection in Vert.x route handlers registered directly with the router.
14073+
14074+
14075+
ifdef::add-copy-button-to-env-var[]
14076+
Environment variable: env_var_with_copy_button:+++QUARKUS_HTTP_AUTH_PROPAGATE_SECURITY_IDENTITY+++[]
14077+
endif::add-copy-button-to-env-var[]
14078+
ifndef::add-copy-button-to-env-var[]
14079+
Environment variable: `+++QUARKUS_HTTP_AUTH_PROPAGATE_SECURITY_IDENTITY+++`
14080+
endif::add-copy-button-to-env-var[]
14081+
--
14082+
|boolean
14083+
|`false`
14084+
1406414085
a|icon:lock[title=Fixed at build time] [[quarkus-vertx-http_quarkus-http-ssl-client-auth]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-ssl-client-auth[`quarkus.http.ssl.client-auth`]##
1406514086
ifdef::add-copy-button-to-config-props[]
1406614087
config_property_copy_button:+++quarkus.http.ssl.client-auth+++[]

_generated-doc/main/config/quarkus-vertx-http_quarkus.http.adoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,27 @@ endif::add-copy-button-to-env-var[]
116116
|boolean
117117
|`true`
118118

119+
a|icon:lock[title=Fixed at build time] [[quarkus-vertx-http_quarkus-http-auth-propagate-security-identity]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-auth-propagate-security-identity[`quarkus.http.auth.propagate-security-identity`]##
120+
ifdef::add-copy-button-to-config-props[]
121+
config_property_copy_button:+++quarkus.http.auth.propagate-security-identity+++[]
122+
endif::add-copy-button-to-config-props[]
123+
124+
125+
[.description]
126+
--
127+
Propagate security identity to support its injection in Vert.x route handlers registered directly with the router.
128+
129+
130+
ifdef::add-copy-button-to-env-var[]
131+
Environment variable: env_var_with_copy_button:+++QUARKUS_HTTP_AUTH_PROPAGATE_SECURITY_IDENTITY+++[]
132+
endif::add-copy-button-to-env-var[]
133+
ifndef::add-copy-button-to-env-var[]
134+
Environment variable: `+++QUARKUS_HTTP_AUTH_PROPAGATE_SECURITY_IDENTITY+++`
135+
endif::add-copy-button-to-env-var[]
136+
--
137+
|boolean
138+
|`false`
139+
119140
a|icon:lock[title=Fixed at build time] [[quarkus-vertx-http_quarkus-http-ssl-client-auth]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-ssl-client-auth[`quarkus.http.ssl.client-auth`]##
120141
ifdef::add-copy-button-to-config-props[]
121142
config_property_copy_button:+++quarkus.http.ssl.client-auth+++[]

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

Lines changed: 52 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -70,54 +70,6 @@ _No Javadoc found_
7070

7171

7272

73-
a| https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/AppCDSContainerImageBuildItem.java[`io.quarkus.deployment.pkg.builditem.AppCDSContainerImageBuildItem`, window="_blank"]
74-
[.description]
75-
--
76-
Indicates that a specific container image should be used to generate the AppCDS file
77-
-- a|`java.lang.String containerImage`
78-
79-
_No Javadoc found_
80-
81-
82-
83-
84-
a| https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/AppCDSControlPointBuildItem.java[`io.quarkus.deployment.pkg.builditem.AppCDSControlPointBuildItem`, window="_blank"]
85-
[.description]
86-
--
87-
If this build item is generated, then it means that there is a recorder step that can be used as a point at which the application loading during AppCDS generation can be stopped safely, therefore allowing Quarkus to not have to stop loading the application in the static init phase which is the default approach for AppCDS generation.
88-
-- a|None
89-
90-
91-
a| https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/AppCDSRequestedBuildItem.java[`io.quarkus.deployment.pkg.builditem.AppCDSRequestedBuildItem`, window="_blank"]
92-
[.description]
93-
--
94-
Build item to indicate to the various steps that AppCDS generation has been requested
95-
-- a|`java.nio.file.Path dir`
96-
97-
Directory where various files needed for AppCDS generation will reside
98-
99-
`io.quarkus.deployment.pkg.builditem.JvmStartupOptimizerArchiveType type`
100-
101-
_No Javadoc found_
102-
103-
104-
105-
106-
a| https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/AppCDSResultBuildItem.java[`io.quarkus.deployment.pkg.builditem.AppCDSResultBuildItem`, window="_blank"]
107-
[.description]
108-
--
109-
A build item containing the result of the AppCDS generation process
110-
-- a|`java.nio.file.Path appCDS`
111-
112-
The file containing the generated AppCDS
113-
114-
`io.quarkus.deployment.pkg.builditem.JvmStartupOptimizerArchiveType type`
115-
116-
The type of file generated
117-
118-
119-
120-
12173
a| https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/builditem/AppModelProviderBuildItem.java[`io.quarkus.deployment.builditem.AppModelProviderBuildItem`, window="_blank"]
12274
[.description]
12375
--
@@ -1336,6 +1288,47 @@ _No Javadoc found_
13361288

13371289

13381290

1291+
a| https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/JvmStartupOptimizerArchiveContainerImageBuildItem.java[`io.quarkus.deployment.pkg.builditem.JvmStartupOptimizerArchiveContainerImageBuildItem`, window="_blank"]
1292+
[.description]
1293+
--
1294+
Indicates that a specific container image should be used to generate the AppCDS file
1295+
-- a|`java.lang.String containerImage`
1296+
1297+
_No Javadoc found_
1298+
1299+
1300+
1301+
1302+
a| https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/JvmStartupOptimizerArchiveRequestedBuildItem.java[`io.quarkus.deployment.pkg.builditem.JvmStartupOptimizerArchiveRequestedBuildItem`, window="_blank"]
1303+
[.description]
1304+
--
1305+
Build item to indicate to the various steps that generation of a JVM startup archive has been requested
1306+
-- a|`java.nio.file.Path dir`
1307+
1308+
Directory where various files needed for JVM startup archive generation will reside
1309+
1310+
`io.quarkus.deployment.pkg.builditem.JvmStartupOptimizerArchiveType type`
1311+
1312+
_No Javadoc found_
1313+
1314+
1315+
1316+
1317+
a| https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/pkg/builditem/JvmStartupOptimizerArchiveResultBuildItem.java[`io.quarkus.deployment.pkg.builditem.JvmStartupOptimizerArchiveResultBuildItem`, window="_blank"]
1318+
[.description]
1319+
--
1320+
A build item containing the result of the JVM startup archive generation process
1321+
-- a|`java.nio.file.Path archive`
1322+
1323+
The file containing the generated archive
1324+
1325+
`io.quarkus.deployment.pkg.builditem.JvmStartupOptimizerArchiveType type`
1326+
1327+
The type of archive generated
1328+
1329+
1330+
1331+
13391332
a| https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/LambdaCapturingTypeBuildItem.java[`io.quarkus.deployment.builditem.nativeimage.LambdaCapturingTypeBuildItem`, window="_blank"]
13401333
[.description]
13411334
--
@@ -8622,6 +8615,17 @@ _No Javadoc found_
86228615

86238616

86248617

8618+
a| https://github.com/quarkusio/quarkus/blob/main/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/core/deployment/IgnoredContextLocalDataKeysBuildItem.java[`io.quarkus.vertx.core.deployment.IgnoredContextLocalDataKeysBuildItem`, window="_blank"]
8619+
[.description]
8620+
--
8621+
A build item that allows extensions to declare which keys should not be propagated before a task is executed in the `ContextHandler#runWith(Runnable,Object)` method.
8622+
-- a|`io.quarkus.runtime.RuntimeValue<List<String>> ignoredKeysSupplier`
8623+
8624+
_No Javadoc found_
8625+
8626+
8627+
8628+
86258629
a| https://github.com/quarkusio/quarkus/blob/main/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/LocalCodecSelectorTypesBuildItem.java[`io.quarkus.vertx.deployment.LocalCodecSelectorTypesBuildItem`, window="_blank"]
86268630
[.description]
86278631
--

_versions/main/guides/_attributes.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
// overridden to the full version, at least when building locally.
3030
:hibernate-orm-version-major-minor: 6.6
3131
:hibernate-search-version-major-minor: 7.2
32+
:hibernate-validator-version-major-minor: 8.0
3233
// .
3334
:quarkus-home-url: https://quarkus.io
3435
:quarkus-org-url: https://github.com/quarkusio
@@ -54,6 +55,7 @@
5455
:hibernate-orm-docs-url: https://docs.jboss.org/hibernate/orm/{hibernate-orm-version-major-minor}/userguide/html_single/Hibernate_User_Guide.html
5556
:hibernate-orm-dialect-docs-url: https://docs.jboss.org/hibernate/orm/{hibernate-orm-version-major-minor}/dialect/dialect.html
5657
:hibernate-search-docs-url: https://docs.jboss.org/hibernate/search/{hibernate-search-version-major-minor}/reference/en-US/html_single/
58+
:hibernate-validator-docs-url: https://docs.jboss.org/hibernate/validator/{hibernate-validator-version-major-minor}/reference/en-US/html_single/
5759
// .
5860
:amazon-services-guide: https://docs.quarkiverse.io/quarkus-amazon-services/dev/index.html
5961
:config-consul-guide: https://docs.quarkiverse.io/quarkus-config-extensions/dev/consul.html

_versions/main/guides/grpc-service-implementation.adoc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,46 @@ quarkus.grpc.server.ssl.trust-store-password=*****
254254
quarkus.grpc.server.ssl.client-auth=REQUIRED
255255
----
256256

257+
=== Custom server building
258+
259+
When Quarkus builds a gRPC server instance, users can apply their own Server(Builder) customizers. The customizers are applied by `priority`, the higher the number the later customizer is applied. The customizers are applied before Quarkus applies user's server configuration; e.g. ideal for some initial defaults.
260+
261+
There are two `customize` methods, the first one uses gRPC's `ServerBuilder` as a parameter - to be used with Quarkus' legacy gRPC support, where the other uses `GrpcServerOptions` - to be used with the new Vert.x gRPC support. User should implement the right `customize` method per gRPC support type usage, or both if the customizer is gRPC type neutral.
262+
263+
[source, java]
264+
----
265+
public interface ServerBuilderCustomizer<T extends ServerBuilder<T>> {
266+
267+
/**
268+
* Customize a ServerBuilder instance.
269+
*
270+
* @param config server's configuration
271+
* @param builder Server builder instance
272+
*/
273+
default void customize(GrpcServerConfiguration config, T builder) {
274+
}
275+
276+
/**
277+
* Customize a GrpcServerOptions instance.
278+
*
279+
* @param config server's configuration
280+
* @param options GrpcServerOptions instance
281+
*/
282+
default void customize(GrpcServerConfiguration config, GrpcServerOptions options) {
283+
}
284+
285+
/**
286+
* Priority by which the customizers are applied.
287+
* Higher priority is applied later.
288+
*
289+
* @return the priority
290+
*/
291+
default int priority() {
292+
return 0;
293+
}
294+
}
295+
----
296+
257297
== Server Interceptors
258298

259299
gRPC server interceptors let you perform logic, such as authentication, before your service is invoked.

_versions/main/guides/hibernate-orm.adoc

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,3 +1569,81 @@ Format mappers *must* have both `@PersistenceUnitExtension` and either `@JsonFor
15691569
15701570
Having multiple JSON (or XML) format mappers registered for the same persistence unit will result in an exception, because of the ambiguity.
15711571
====
1572+
1573+
[[validator_integration]]
1574+
== Validation modes and Hibernate Validator integration
1575+
1576+
Hibernate Validator integration into Hibernate ORM opens up the following capabilities:
1577+
1578+
- performing entity validation on lifecycle events
1579+
- applying constraint information from entities to DDL
1580+
1581+
From Quarkus's perspective, this is controlled by the <<quarkus-hibernate-orm_quarkus-hibernate-orm-validation-mode,`quarkus.hibernate-orm.validation.mode` configuration property>>.
1582+
The available validation modes are:
1583+
1584+
- `auto` -- the default option; works the same as `callback` and `ddl` enabled simultaneously
1585+
when the application uses `quarkus-hibernate-validator`,
1586+
and as `none` otherwise.
1587+
- `callback` -- Hibernate Validator will perform the lifecycle event validation.
1588+
- `ddl` -- Hibernate Validator constraints will be considered for the <<dev-mode,DDL operations>>
1589+
- `none` -- Hibernate Validator integration will be disabled.
1590+
1591+
While all constraints with corresponding Jakarta Validation rules will apply during the `callback` validation,
1592+
in the `ddl` mode, only a subset of constraints is used to influence the DDL.
1593+
In the Hibernate Validator documentation, you can find link:{hibernate-validator-docs-url}#section-builtin-constraints[the list of available constraints] and their impact on the DDL generation.
1594+
1595+
Let's consider having a simple entity with some constraints applied to its properties:
1596+
1597+
[source,java]
1598+
----
1599+
import jakarta.validation.constraints.NotEmpty;
1600+
import jakarta.validation.constraints.NotNull;
1601+
import jakarta.validation.constraints.Size;
1602+
1603+
@Entity
1604+
public class MyEntity {
1605+
@Id
1606+
public long id;
1607+
1608+
@NotNull
1609+
@NotEmpty
1610+
@Size(max = 50)
1611+
public String name;
1612+
1613+
public String value;
1614+
}
1615+
----
1616+
1617+
With the `ddl` mode enabled, the resulting schema would be expected to have the following constraints:
1618+
[source,sql]
1619+
----
1620+
create table myentity
1621+
(
1622+
id bigint not null primary key,
1623+
name varchar(50) not null, // <1>
1624+
value varchar(255), // <2>
1625+
);
1626+
----
1627+
<1> The `name` column has a `not null` constraint because of the `@NotNull` constraint,
1628+
and the length of the values is limited to `50` because of the `@Size(max=50)` constraint.
1629+
+
1630+
<2> Since the `value` property in the entity has no constraints, there are no additional constraints in the DDL,
1631+
and the `255` length limit comes from the default `jakarta.persistence.Column#lenght()`.
1632+
1633+
With the `callback` mode, expect getting a `jakarta.validation.ConstraintViolationException` thrown:
1634+
1635+
[source,java]
1636+
----
1637+
try {
1638+
MyEntity entity = new MyEntity();
1639+
entity.setName(veryLongName);
1640+
em.persist(entity);
1641+
em.flush();
1642+
} catch (ConstraintViolationException exception) {
1643+
// handle the constraint violations somehow
1644+
}
1645+
----
1646+
1647+
Since Quarkus has built-in exception mappers for `jakarta.validation.ConstraintViolationException`,
1648+
explicitly handling these exceptions might be redundant. See the xref:validation.adoc#rest-end-point-validation[REST end point validation]
1649+
section of the Hibernate Validator guide for more details.

_versions/main/guides/hibernate-reactive.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,8 @@ consider xref:hibernate-reactive-panache.adoc#transactions[using `@WithTransacti
333333
The xref:hibernate-reactive-panache.adoc[Hibernate Reactive with Panache] extension facilitates the usage of Hibernate Reactive
334334
by providing active record style entities (and repositories) and focuses on making your entities trivial and fun to write in Quarkus.
335335

336+
== Validation modes and Hibernate Validator integration
337+
338+
To find out more on how the <<quarkus-hibernate-orm_quarkus-hibernate-orm-validation-mode,`quarkus.hibernate-orm.validation.mode` configuration property>>.
339+
influence your Hibernate Reactive application see the xref:hibernate-orm.adoc#validator_integration[corresponding Hibernate ORM guide],
340+
as these modes work the same in both cases.

_versions/main/guides/reactive-routes.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ Note that only `@Valid` is supported on the return type.
645645
The returned class can use any constraint.
646646
In the case of `Uni`, it checks the item produced asynchronously.
647647
648+
[[using-vertx-web-router]]
648649
== Using the Vert.x Web Router
649650
650651
You can also register your route directly on the _HTTP routing layer_ by registering routes directly on the `Router` object.

_versions/main/guides/security-customization.adoc

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,54 @@ Depending on the application, that can be a lot of the `AuthenticationSuccessEve
741741
For that reason, asynchronous processing can have positive effect on performance.
742742
<2> Common code for all supported security event types is possible because they all implement the `io.quarkus.security.spi.runtime.SecurityEvent` interface.
743743

744+
== `SecurityIdentity` injection in Vert.x route handlers
745+
746+
When you need to inject `SecurityIdentity` in a Vert.x route handler registered directly on the xref:reactive-routes.adoc#using-vertx-web-router[Vert.x Web Router], then requesting the `SecurityIdentity` propagation is required.
747+
For example:
748+
749+
[source,java]
750+
----
751+
package io.quarkus.it.security;
752+
753+
public class RouterObserver {
754+
755+
public void route(@Observes Router router, UserInformation userInformation) {
756+
router.route("/user-info").handler(event -> event.response().end(userInformation.getPrincipalName()));
757+
}
758+
759+
}
760+
----
761+
762+
The `UserInformation` bean in the example can look like this:
763+
764+
[source,java]
765+
----
766+
package io.quarkus.it.security;
767+
768+
@ApplicationScoped
769+
public class UserInformation {
770+
771+
@Inject
772+
SecurityIdentity identity;
773+
774+
@ActivateRequestContext
775+
String getPrincipalName() {
776+
return identity.getPrincipal().getName();
777+
}
778+
779+
}
780+
----
781+
782+
For the `SecurityIdentity` injection in this example to work, you must activate the `SecurityIdentity` propagation:
783+
784+
[source,properties]
785+
----
786+
quarkus.http.auth.propagate-security-identity=true <1>
787+
----
788+
<1> Propagate the `SecurityIdentity` when a Vert.x route handler is registered programmatically on the Vert.x HTTP router.
789+
It is required because Quarkus cannot detect that the `SecurityIdentity` injection point is used in the programmatically registered Vert.x route handler.
790+
For the routes registered declaratively with the `@Route` annotation as well as Jakarta REST endpoints, this configuration is not required.
791+
744792
== References
745793

746794
* xref:security-overview.adoc[Quarkus Security overview]

0 commit comments

Comments
 (0)