Skip to content

Commit 087b574

Browse files
committed
Sync documentation of main branch
1 parent 1036e2e commit 087b574

11 files changed

+219
-55
lines changed

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14618,27 +14618,6 @@ endif::add-copy-button-to-env-var[]
1461814618
|int
1461914619
|
1462014620

14621-
a| [[quarkus-vertx-http_quarkus-http-cors-enabled]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-cors-enabled[`quarkus.http.cors.enabled`]##
14622-
ifdef::add-copy-button-to-config-props[]
14623-
config_property_copy_button:+++quarkus.http.cors.enabled+++[]
14624-
endif::add-copy-button-to-config-props[]
14625-
14626-
14627-
[.description]
14628-
--
14629-
Enable the CORS filter.
14630-
14631-
14632-
ifdef::add-copy-button-to-env-var[]
14633-
Environment variable: env_var_with_copy_button:+++QUARKUS_HTTP_CORS_ENABLED+++[]
14634-
endif::add-copy-button-to-env-var[]
14635-
ifndef::add-copy-button-to-env-var[]
14636-
Environment variable: `+++QUARKUS_HTTP_CORS_ENABLED+++`
14637-
endif::add-copy-button-to-env-var[]
14638-
--
14639-
|boolean
14640-
|`+++${quarkus.http.cors:false}+++`
14641-
1464214621
a| [[quarkus-vertx-http_quarkus-http-port]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-port[`quarkus.http.port`]##
1464314622
ifdef::add-copy-button-to-config-props[]
1464414623
config_property_copy_button:+++quarkus.http.port+++[]
@@ -16683,6 +16662,27 @@ h|[[quarkus-vertx-http_section_quarkus-http-cors]] [.section-name.section-level0
1668316662
h|Type
1668416663
h|Default
1668516664

16665+
a| [[quarkus-vertx-http_quarkus-http-cors-enabled]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-cors-enabled[`quarkus.http.cors.enabled`]##
16666+
ifdef::add-copy-button-to-config-props[]
16667+
config_property_copy_button:+++quarkus.http.cors.enabled+++[]
16668+
endif::add-copy-button-to-config-props[]
16669+
16670+
16671+
[.description]
16672+
--
16673+
Enable the CORS filter.
16674+
16675+
16676+
ifdef::add-copy-button-to-env-var[]
16677+
Environment variable: env_var_with_copy_button:+++QUARKUS_HTTP_CORS_ENABLED+++[]
16678+
endif::add-copy-button-to-env-var[]
16679+
ifndef::add-copy-button-to-env-var[]
16680+
Environment variable: `+++QUARKUS_HTTP_CORS_ENABLED+++`
16681+
endif::add-copy-button-to-env-var[]
16682+
--
16683+
|boolean
16684+
|`+++${quarkus.http.cors:false}+++`
16685+
1668616686
a| [[quarkus-vertx-http_quarkus-http-cors-origins]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-cors-origins[`quarkus.http.cors.origins`]##
1668716687
ifdef::add-copy-button-to-config-props[]
1668816688
config_property_copy_button:+++quarkus.http.cors.origins+++[]

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -317,27 +317,6 @@ endif::add-copy-button-to-env-var[]
317317
|int
318318
|
319319

320-
a| [[quarkus-vertx-http_quarkus-http-cors-enabled]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-cors-enabled[`quarkus.http.cors.enabled`]##
321-
ifdef::add-copy-button-to-config-props[]
322-
config_property_copy_button:+++quarkus.http.cors.enabled+++[]
323-
endif::add-copy-button-to-config-props[]
324-
325-
326-
[.description]
327-
--
328-
Enable the CORS filter.
329-
330-
331-
ifdef::add-copy-button-to-env-var[]
332-
Environment variable: env_var_with_copy_button:+++QUARKUS_HTTP_CORS_ENABLED+++[]
333-
endif::add-copy-button-to-env-var[]
334-
ifndef::add-copy-button-to-env-var[]
335-
Environment variable: `+++QUARKUS_HTTP_CORS_ENABLED+++`
336-
endif::add-copy-button-to-env-var[]
337-
--
338-
|boolean
339-
|`+++${quarkus.http.cors:false}+++`
340-
341320
a| [[quarkus-vertx-http_quarkus-http-port]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-port[`quarkus.http.port`]##
342321
ifdef::add-copy-button-to-config-props[]
343322
config_property_copy_button:+++quarkus.http.port+++[]
@@ -2382,6 +2361,27 @@ h|[[quarkus-vertx-http_section_quarkus-http-cors]] [.section-name.section-level0
23822361
h|Type
23832362
h|Default
23842363

2364+
a| [[quarkus-vertx-http_quarkus-http-cors-enabled]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-cors-enabled[`quarkus.http.cors.enabled`]##
2365+
ifdef::add-copy-button-to-config-props[]
2366+
config_property_copy_button:+++quarkus.http.cors.enabled+++[]
2367+
endif::add-copy-button-to-config-props[]
2368+
2369+
2370+
[.description]
2371+
--
2372+
Enable the CORS filter.
2373+
2374+
2375+
ifdef::add-copy-button-to-env-var[]
2376+
Environment variable: env_var_with_copy_button:+++QUARKUS_HTTP_CORS_ENABLED+++[]
2377+
endif::add-copy-button-to-env-var[]
2378+
ifndef::add-copy-button-to-env-var[]
2379+
Environment variable: `+++QUARKUS_HTTP_CORS_ENABLED+++`
2380+
endif::add-copy-button-to-env-var[]
2381+
--
2382+
|boolean
2383+
|`+++${quarkus.http.cors:false}+++`
2384+
23852385
a| [[quarkus-vertx-http_quarkus-http-cors-origins]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-cors-origins[`quarkus.http.cors.origins`]##
23862386
ifdef::add-copy-button-to-config-props[]
23872387
config_property_copy_button:+++quarkus.http.cors.origins+++[]

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@ h|[.header-title]##Configuration property##
77
h|Type
88
h|Default
99

10+
a| [[quarkus-vertx-http_quarkus-http-cors_quarkus-http-cors-enabled]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-cors_quarkus-http-cors-enabled[`quarkus.http.cors.enabled`]##
11+
ifdef::add-copy-button-to-config-props[]
12+
config_property_copy_button:+++quarkus.http.cors.enabled+++[]
13+
endif::add-copy-button-to-config-props[]
14+
15+
16+
[.description]
17+
--
18+
Enable the CORS filter.
19+
20+
21+
ifdef::add-copy-button-to-env-var[]
22+
Environment variable: env_var_with_copy_button:+++QUARKUS_HTTP_CORS_ENABLED+++[]
23+
endif::add-copy-button-to-env-var[]
24+
ifndef::add-copy-button-to-env-var[]
25+
Environment variable: `+++QUARKUS_HTTP_CORS_ENABLED+++`
26+
endif::add-copy-button-to-env-var[]
27+
--
28+
|boolean
29+
|`+++${quarkus.http.cors:false}+++`
30+
1031
a| [[quarkus-vertx-http_quarkus-http-cors_quarkus-http-cors-origins]] [.property-path]##link:#quarkus-vertx-http_quarkus-http-cors_quarkus-http-cors-origins[`quarkus.http.cors.origins`]##
1132
ifdef::add-copy-button-to-config-props[]
1233
config_property_copy_button:+++quarkus.http.cors.origins+++[]

_versions/main/guides/amqp-reference.adoc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ quarkus.messaging.auto-connector-attachment=false
7474

7575
== Configuring the AMQP Broker access
7676

77-
The AMQP connector connects to AMQP 1.0 brokers such as Apache ActiveMQ or Artemis.
77+
The AMQP connector connects to AMQP 1.0 brokers such as Apache's ActiveMQ Classic or ActiveMQ Artemis.
7878
To configure the location and credentials of the broker, add the following properties in the `application.properties`:
7979

8080
[source, properties]
@@ -318,17 +318,19 @@ mp.messaging.outgoing.orders.address=my-order-queue
318318
If the `address` attribute is not set, the connector uses the channel name.
319319

320320
To use an existing queue, you need to configure the `address`, `container-id` and, optionally, the `link-name` attributes.
321-
For example, if you have an Apache Artemis broker configured with:
321+
For example, if you have an Apache ActiveMQ Artemis broker configured with:
322322

323323
[source, xml]
324324
----
325-
<queues>
326-
<queue name="people">
327-
<address>people</address>
328-
<durable>true</durable>
329-
<user>artemis</user>
330-
</queue>
331-
</queues>
325+
<addresses>
326+
<address name="people">
327+
<anycast>
328+
<queue name="people">
329+
<user>artemis</user>
330+
</queue>
331+
</anycast>
332+
</address>
333+
</addresses>
332334
----
333335

334336
You need the following configuration:
@@ -367,7 +369,7 @@ mp.messaging.incoming.people-out.container-id=bar
367369
mp.messaging.incoming.people-out.link-name=people
368370
----
369371

370-
More details about the AMQP Address model can be found in the https://activemq.apache.org/components/artemis/documentation/2.0.0/address-model.html[Artemis documentation].
372+
More details about the AMQP Address model can be found in the https://activemq.apache.org/components/artemis/documentation/latest/address-model.html[ActiveMQ Artemis documentation].
371373

372374
[[blocking-processing]]
373375
=== Execution model and Blocking processing

_versions/main/guides/hibernate-orm-panache.adoc

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,47 @@ PanacheQuery<RaceWeight> query = Person.find("select new MyView(d.race, AVG(d.we
978978
----
979979
====
980980

981+
If you need to have multiple constructors in your DTO, you must annotate the constructor intended to generate a SELECT clause with @ProjectedConstructor:
982+
983+
[source,java]
984+
----
985+
import io.quarkus.runtime.annotations.RegisterForReflection;
986+
import io.quarkus.hibernate.orm.panache.common.ProjectedConstructor;
987+
988+
@RegisterForReflection
989+
public class PersonName {
990+
public final String name;
991+
992+
@ProjectedConstructor // <1>
993+
public PersonName(String name) {
994+
this.name = name;
995+
}
996+
997+
public PersonName(String name, String otherField) {
998+
this.name = name;
999+
}
1000+
}
1001+
1002+
// only 'name' will be loaded from the database
1003+
PanacheQuery<PersonName> query = Person.find("status", Status.Alive).project(PersonName.class);
1004+
----
1005+
1006+
<1> This will use your annotated constructor to create the query. (`select new PersonName(name) from ...`)
1007+
1008+
[WARNING]
1009+
====
1010+
If a DTO used in a projection has multiple constructors and is not properly annotated, it may lead to *unexpected behavior*.
1011+
1012+
The constructor resolution process follows this order:
1013+
1014+
1. Look for a constructor annotated with `@ProjectedConstructor`
1015+
This is the most explicit and preferred way to indicate which constructor should be used.
1016+
2. Look for parameters annotated with `@ProjectedFieldName`
1017+
3. Use the first non-parameterless constructor
1018+
If no annotations are found.
1019+
4. Fallback to the first constructor it finds, this could lead to multiple problems or inconsistencies.
1020+
====
1021+
9811022
== Multiple Persistence Units
9821023

9831024
The support for multiple persistence units is described in detail in xref:hibernate-orm.adoc#multiple-persistence-units[the Hibernate ORM guide].

_versions/main/guides/hibernate-reactive-panache.adoc

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,47 @@ PanacheQuery<RaceWeight> query = Person.find("select new MyView(d.race, AVG(d.we
729729
----
730730
====
731731

732+
If you need to have multiple constructors in your DTO, you must annotate the constructor intended to generate a SELECT clause with @ProjectedConstructor:
733+
734+
[source,java]
735+
----
736+
import io.quarkus.runtime.annotations.RegisterForReflection;
737+
import io.quarkus.hibernate.reactive.panache.common.ProjectedConstructor;
738+
739+
@RegisterForReflection
740+
public class PersonName {
741+
public final String name;
742+
743+
@ProjectedConstructor // <1>
744+
public PersonName(String name) {
745+
this.name = name;
746+
}
747+
748+
public PersonName(String name, String otherField) {
749+
this.name = name;
750+
}
751+
}
752+
753+
// only 'name' will be loaded from the database
754+
PanacheQuery<PersonName> query = Person.find("status", Status.Alive).project(PersonName.class);
755+
----
756+
757+
<1> This will use your annotated constructor to create the query. (`select new PersonName(name) from ...`)
758+
759+
[WARNING]
760+
====
761+
If a DTO used in a projection has multiple constructors and is not properly annotated, it may lead to *unexpected behavior*.
762+
763+
The constructor resolution process follows this order:
764+
765+
1. Look for a constructor annotated with `@ProjectedConstructor`
766+
This is the most explicit and preferred way to indicate which constructor should be used.
767+
2. Look for parameters annotated with `@ProjectedFieldName`
768+
3. Use the first non-parameterless constructor
769+
If no annotations are found.
770+
4. Fallback to the first constructor it finds, this could lead to multiple problems or inconsistencies.
771+
====
772+
732773
== Multiple Persistence Units
733774

734775
Hibernate Reactive in Quarkus currently does not support multiple persistence units.

_versions/main/guides/kafka-streams.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,8 @@ public class InteractiveQueries {
631631
private ReadOnlyKeyValueStore<Integer, Aggregation> getWeatherStationStore() {
632632
while (true) {
633633
try {
634-
return streams.store(TopologyProducer.WEATHER_STATIONS_STORE, QueryableStoreTypes.keyValueStore());
634+
return streams.store(StoreQueryParameters
635+
.fromNameAndType(TopologyProducer.WEATHER_STATIONS_STORE, QueryableStoreTypes.keyValueStore()));
635636
} catch (InvalidStateStoreException e) {
636637
// ignore, store not ready yet
637638
}

_versions/main/guides/security-authorize-web-endpoints-reference.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ The same authorization can be required with the `@PermissionsAllowed(value = { "
596596
* xref:security-openid-connect-multitenancy.adoc#programmatic-startup[Programmatic OIDC start-up for multitenant application]
597597
* xref:security-authentication-mechanisms.adoc#form-based-auth-programmatic-set-up[Set up Form-based authentication programmatically]
598598
* xref:security-authentication-mechanisms.adoc#mtls-programmatic-set-up[Set up the mutual TLS client authentication programmatically]
599+
* xref:security-cors.adoc#cors-filter-programmatic-set-up[Configuring the CORS filter programmatically]
599600

600601
[[standard-security-annotations]]
601602
== Authorization using annotations

_versions/main/guides/security-cors.adoc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,45 @@ Allowing unrestricted origins in production environments poses severe security r
9191
For production, define explicit origins in the `quarkus.http.cors.origins` property.
9292
====
9393

94+
[[cors-filter-programmatic-set-up]]
95+
== Configuring the CORS filter programmatically
96+
97+
To enforce CORS policies in your application, enable the Quarkus CORS filter with the `io.quarkus.vertx.http.security.HttpSecurity` CDI event:
98+
99+
[source,java]
100+
----
101+
package org.acme.http.security;
102+
103+
import io.quarkus.vertx.http.security.HttpSecurity;
104+
import jakarta.enterprise.event.Observes;
105+
106+
public class CorsProgrammaticConfig {
107+
void configure(@Observes HttpSecurity httpSecurity) {
108+
httpSecurity.cors("https://example.com");
109+
}
110+
}
111+
----
112+
113+
The `io.quarkus.vertx.http.security.CORS` builder allows you to create a complete CORS configuration:
114+
115+
[source,java]
116+
----
117+
package org.acme.http.security;
118+
119+
import io.quarkus.vertx.http.security.CORS;
120+
import io.quarkus.vertx.http.security.HttpSecurity;
121+
import jakarta.enterprise.event.Observes;
122+
123+
public class CorsProgrammaticConfig {
124+
void configure(@Observes HttpSecurity httpSecurity) {
125+
httpSecurity.cors(CORS.builder()
126+
.origin("https://example.com")
127+
.method("POST")
128+
.build());
129+
}
130+
}
131+
----
132+
94133
== References
95134

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

_versions/main/guides/security-getting-started-tutorial.adoc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,27 @@ The `quarkus-security-jpa` extension only initializes if a single entity is anno
293293
By default, it uses bcrypt-hashed passwords.
294294
You can configure it to use plain text or custom passwords.
295295
<4> Indicates the comma-separated list of roles added to the target principal representation attributes.
296-
<5> Allows us to add users while hashing passwords with the proper bcrypt hash.
296+
<5> Provides a helper method to add users with properly hashed passwords. The `BcryptUtil.bcryptHash()` method:
297+
* Automatically generates a random salt for each password.
298+
* Hashes the password using bcrypt with 10 iterations (default).
299+
* Returns the hash in Modular Crypt Format (MCF), which includes the algorithm identifier, cost parameter, salt, and hash.
300+
301+
[TIP]
302+
====
303+
**Password hashing best practices:**
304+
305+
* Always pass plain text passwords to `BcryptUtil.bcryptHash()` - never pre-hash them.
306+
* The bcrypt hash includes the salt, so no separate salt storage is needed.
307+
* To verify passwords during authentication, the framework automatically uses `BcryptUtil.matches(plainPassword, hashedPassword)`.
308+
* For custom iterations: `BcryptUtil.bcryptHash(password, iterationCount)` where higher iterations (12-14) provide more security but slower performance.
309+
====
310+
311+
- For more information about configuring passwords and roles, see xref:configure-the-application[Configure the application].
312+
- For more information on hashing passwords and available options, see xref:security-jpa.adoc#password-storage-and-hashing[Password storage and hashing].
297313

298314
[NOTE]
299315
====
300-
Don’t forget to set up the Panache and PostgreSQL JDBC driver, please see xref:hibernate-orm-panache.adoc#setting-up-and-configuring-hibernate-orm-with-panache[Setting up and configuring Hibernate ORM with Panache] for more information.
316+
Remember to set up the Panache and PostgreSQL JDBC driver. For more information, see xref:hibernate-orm-panache.adoc#setting-up-and-configuring-hibernate-orm-with-panache[Setting up and configuring Hibernate ORM with Panache].
301317
====
302318
ifndef::no-quarkus-security-jpa-reactive[]
303319
[NOTE]
@@ -307,6 +323,7 @@ For more information, see link:{quickstarts-tree-url}/security-jpa-reactive-qui
307323
====
308324
endif::no-quarkus-security-jpa-reactive[]
309325

326+
[id="configure-the-application"]
310327
== Configure the application
311328

312329
. Enable the built-in Quarkus xref:security-basic-authentication.adoc[Basic authentication] mechanism by setting the `quarkus.http.auth.basic` property to `true`:

0 commit comments

Comments
 (0)