Skip to content

Commit 14129d9

Browse files
committed
Sync documentation of main branch
1 parent 533dbc3 commit 14129d9

10 files changed

+71
-3921
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16681,7 +16681,7 @@ Environment variable: `+++QUARKUS_HTTP_CORS_ENABLED+++`
1668116681
endif::add-copy-button-to-env-var[]
1668216682
--
1668316683
|boolean
16684-
|`+++${quarkus.http.cors:false}+++`
16684+
|`+++false+++`
1668516685

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[]

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

Lines changed: 1 addition & 3901 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Environment variable: `+++QUARKUS_HTTP_CORS_ENABLED+++`
2626
endif::add-copy-button-to-env-var[]
2727
--
2828
|boolean
29-
|`+++${quarkus.http.cors:false}+++`
29+
|`+++false+++`
3030

3131
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`]##
3232
ifdef::add-copy-button-to-config-props[]

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9500,6 +9500,17 @@ _No Javadoc found_
95009500

95019501

95029502

9503+
a| https://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/CsrfBuilderClassBuildItem.java[`io.quarkus.vertx.http.deployment.CsrfBuilderClassBuildItem`, window="_blank"]
9504+
[.description]
9505+
--
9506+
At most one extension can register a CSRF builder used by the HTTP Security fluent API. The builder class must have public no-args constructor.
9507+
-- a|`java.lang.Class<? extends CSRF.Builder> csrfBuilderClass`
9508+
9509+
_No Javadoc found_
9510+
9511+
9512+
9513+
95039514
a| https://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/DefaultRouteBuildItem.java[`io.quarkus.vertx.http.deployment.DefaultRouteBuildItem`, window="_blank"]
95049515
[.description]
95059516
--

_versions/main/guides/compose-dev-services.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,8 @@ Compose Dev Services won't try to discover any services and will be disabled.
645645
=== Compose Dev Services used for tests
646646

647647
For Quarkus tests, a generated project name in the format `quarkus-devservices-<application-name>-<random-suffix>` is used by default to ensure isolation between test runs and running dev mode services.
648+
If the top-level name attribute is specified in the Compose file, the project name in the format `<compose-name>-<random-suffix>` is used.
649+
648650
This way, Quarkus tests start a separate copy of the services defined in the compose files.
649651
For example, when running continuous testing in development mode, tests will have their own isolated set of services.
650652

_versions/main/guides/config-yaml.adoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,17 @@ The values from this file override any values from the regular `application.yaml
204204

205205
The MicroProfile Config specification defines configuration properties as an arbitrary `.`-delimited string.
206206
However, structured formats such as YAML only support a subset of the possible configuration namespace.
207-
For example, consider the two configuration properties `quarkus.http.cors` and `quarkus.http.cors.methods`.
207+
For example, consider the two configuration properties `one.two` and `one.two.three`.
208208
One property is the prefix of another, so it might not be immediately evident how to specify both keys in your YAML configuration.
209209

210210
This is solved by using `~` as a `null` key to represent any YAML property that is a prefix of another one:
211211

212212
[source,yaml]
213213
----
214-
quarkus:
215-
http:
216-
cors:
217-
~: true
218-
methods: GET,PUT,POST
214+
one:
215+
two:
216+
~: 12
217+
three: 123
219218
----
220219

221220
YAML `null` keys are not included in the assembly of the configuration property name, allowing them to be used at any level for disambiguating configuration properties.

_versions/main/guides/dev-ui.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ To add a tab to the Dev UI settings dialog, produce a `SettingPageBuildItem`:
397397
@BuildStep(onlyIf = IsLocalDevelopment.class) // <1>
398398
void createMCPSettingsTab(BuildProducer<SettingPageBuildItem> settingPageProducer) {
399399
400-
SettingPageBuildItem mcpSettingTab = new SettingPageBuildItem("Dev MCP");// <2>
400+
SettingPageBuildItem mcpSettingTab = new SettingPageBuildItem();// <2>
401401
402402
mcpSettingTab.addPage(Page.webComponentPageBuilder() // <3>
403403
.title("Dev MCP")// <4>
@@ -438,7 +438,7 @@ To do this, produce a `UnlistedPageBuildItem`:
438438
@BuildStep(onlyIf = IsLocalDevelopment.class) // <1>
439439
void createMCPUnlistedPages(BuildProducer<UnlistedPageBuildItem> unlistedPageProducer) {
440440
441-
UnlistedPageBuildItem mcpOtherPages = new UnlistedPageBuildItem("Dev MCP"); // <2>
441+
UnlistedPageBuildItem mcpOtherPages = new UnlistedPageBuildItem(); // <2>
442442
443443
mcpOtherPages.addPage(Page.webComponentPageBuilder() // <3>
444444
.title("Tools") // <4>

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

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ include::_attributes.adoc[]
1313
Quarkus incorporates a pluggable web security layer.
1414
When security is active, the system performs a permission check on all HTTP requests to determine if they should proceed.
1515

16-
Using `@PermitAll` will not open a path if the path is restricted by the `quarkus.http.auth.` configuration.
17-
To ensure specific paths are accessible, appropriate configurations must be made within the Quarkus security settings.
18-
1916
[NOTE]
2017
====
2118
If you use Jakarta RESTful Web Services, consider using `quarkus.security.jaxrs.deny-unannotated-endpoints` or `quarkus.security.jaxrs.default-roles-allowed` to set default security requirements instead of HTTP path-level matching because annotations can override these properties on an individual endpoint.
@@ -30,6 +27,11 @@ xref:security-customization.adoc#security-identity-customization[Security Identi
3027

3128
Permissions are defined in the Quarkus configuration by permission sets, each specifying a policy for access control.
3229

30+
[NOTE]
31+
====
32+
When a security policy's `paths` property contains the most specific path that matches the current request path, it takes precedence over other security policies with matching paths and is said to win.
33+
====
34+
3335
.{project-name} policies summary
3436
[options="header"]
3537
|===
@@ -263,7 +265,7 @@ quarkus.http.auth.permission.public.policy=permit
263265
Previous examples demonstrated matching all sub-paths when a path concludes with the `$$*$$`
264266
wildcard.
265267

266-
This wildcard also applies in the middle of a path, representing a single path segment.
268+
This wildcard can also be applied in the middle of a path, representing a single path segment.
267269
It cannot be mixed with other path segment characters; thus, path separators always enclose the `$$*$$` wildcard, as seen in the `/public/$$*$$/about-us` path.
268270

269271
When several path patterns correspond to the same request path, the system selects the longest sub-path leading to the `$$*$$` wildcard.
@@ -425,7 +427,7 @@ For more information, see link:https://quarkus.io/blog/path-resolution-in-quarku
425427
[[map-security-identity-roles]]
426428
=== Map `SecurityIdentity` roles
427429

428-
Winning role-based policy can map the `SecurityIdentity` roles to the deployment-specific roles.
430+
The winning role-based policy that was chosen to authorize the current request can map `SecurityIdentity` roles to deployment-specific roles.
429431
These roles are then applicable for endpoint authorization by using the `@RolesAllowed` annotation.
430432

431433
[source,properties]
@@ -466,7 +468,7 @@ public class HttpSecurityConfiguration {
466468
=== Shared permission checks
467469

468470
One important rule for unshared permission checks is that only one path match is applied, the most specific one.
469-
Naturally you can specify as many permissions with the same winning path as you want and they will all be applied.
471+
When a path matches as the most specific, you can specify multiple permissions for that path and they are all applied.
470472
However, there can be permission checks you want to apply to many paths without repeating them over and over again.
471473
That's where shared permission checks come in, they are always applied when the permission path is matched.
472474

@@ -597,13 +599,21 @@ The same authorization can be required with the `@PermissionsAllowed(value = { "
597599
* xref:security-authentication-mechanisms.adoc#form-based-auth-programmatic-set-up[Set up Form-based authentication programmatically]
598600
* xref:security-authentication-mechanisms.adoc#mtls-programmatic-set-up[Set up the mutual TLS client authentication programmatically]
599601
* xref:security-cors.adoc#cors-filter-programmatic-set-up[Configuring the CORS filter programmatically]
602+
* xref:security-csrf-prevention.adoc#csrf-prevention-programmatic-set-up[Configuring the CSRF prevention programmatically]
600603

601604
[[standard-security-annotations]]
602605
== Authorization using annotations
603606

604607
{project-name} includes built-in security to allow for link:https://en.wikipedia.org/wiki/Role-based_access_control[Role-Based Access Control (RBAC)]
605608
based on the common security annotations `@RolesAllowed`, `@DenyAll`, `@PermitAll` on REST endpoints and CDI beans.
606609

610+
[NOTE]
611+
====
612+
Authorization checks for `quarkus.http.auth.` configurations are performed before security checks for standard security annotations.
613+
Therefore, `@PermitAll` only permits access to paths that are not already restricted by HTTP permissions.
614+
`@PermitAll` cannot override HTTP-level security configurations, only relax restrictions imposed by other standard security annotations such as `@RolesAllowed`.
615+
====
616+
607617
.{project-name} annotation types summary
608618
[options="header"]
609619
|===
@@ -684,7 +694,10 @@ This returns `non-null` for a secured endpoint.
684694
<6> The `/subject/denied` endpoint declares the `@DenyAll` annotation, disallowing all direct access to it as a REST method, regardless of the user calling it.
685695
The method is still invokable internally by other methods in this class.
686696

687-
CAUTION: If you plan to use standard security annotations on the IO thread, review the information in xref:security-proactive-authentication.adoc[Proactive Authentication].
697+
[CAUTION]
698+
====
699+
If you plan to use standard security annotations on the IO thread, review the information in xref:security-proactive-authentication.adoc[Proactive Authentication].
700+
====
688701

689702
The `@RolesAllowed` annotation value supports xref:config-reference.adoc#property-expressions[property expressions] including default values and nested property expressions.
690703
Configuration properties used with the annotation are resolved at runtime.

_versions/main/guides/security-csrf-prevention.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,31 @@ quarkus.rest-csrf.verify-token=false
324324

325325
include::{generated-dir}/config/quarkus-rest-csrf.adoc[leveloffset=+1, opts=optional]
326326

327+
[[csrf-prevention-programmatic-set-up]]
328+
== Configuring the CSRF prevention programmatically
329+
330+
When the `quarkus-rest-csrf` extension is used, the `io.quarkus.vertx.http.security.HttpSecurity` CDI event allows you to customize the CSRF prevention programmatically:
331+
332+
[source,java]
333+
----
334+
package org.acme.http.security;
335+
336+
import io.quarkus.vertx.http.security.CSRF;
337+
import io.quarkus.vertx.http.security.HttpSecurity;
338+
import jakarta.enterprise.event.Observes;
339+
340+
public class CsrfProgrammaticConfig {
341+
void configure(@Observes HttpSecurity httpSecurity) {
342+
httpSecurity.csrf(CSRF.builder() <1>
343+
.formFieldName("my-csrf-token")
344+
.tokenSize(32)
345+
.build());
346+
}
347+
}
348+
----
349+
<1> Creates the CSRF prevention configuration builder provided by the `quarkus-rest-csrf` extension.
350+
If this extension is missing, call to the `CSRF.builder()` will fail.
351+
327352
== References
328353

329354
* https://owasp.org/www-community/attacks/csrf[OWASP Cross-Site Request Forgery]

_versions/main/guides/security-keycloak-authorization.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ quarkus.oidc.credentials.secret=secret <3>
270270
quarkus.oidc.tls.verification=none <4>
271271
272272
# Enable Policy Enforcement
273-
quarkus.keycloak.policy-enforcer.enable=true <5>
273+
quarkus.keycloak.policy-enforcer.enabled=true <5>
274274
275275
# Import the realm file with Dev Services for Keycloak
276276
# Note: This property is effective only in dev mode, not in JVM or native modes
@@ -527,7 +527,7 @@ public class ProtectedResource {
527527

528528
[NOTE]
529529
====
530-
To use the `AuthzClient` directly, set `quarkus.keycloak.policy-enforcer.enable=true`.
530+
To use the `AuthzClient` directly, set `quarkus.keycloak.policy-enforcer.enabled=true`.
531531
Otherwise, no bean is available for injection.
532532
====
533533

@@ -668,7 +668,7 @@ For example:
668668

669669
[source,properties]
670670
----
671-
quarkus.keycloak.policy-enforcer.enable=true
671+
quarkus.keycloak.policy-enforcer.enabled=true
672672
673673
# Default Tenant
674674
quarkus.oidc.auth-server-url=${keycloak.url:replaced-by-test-resource}/realms/quarkus

0 commit comments

Comments
 (0)