You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _versions/main/guides/compose-dev-services.adoc
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -645,6 +645,8 @@ Compose Dev Services won't try to discover any services and will be disabled.
645
645
=== Compose Dev Services used for tests
646
646
647
647
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
+
648
650
This way, Quarkus tests start a separate copy of the services defined in the compose files.
649
651
For example, when running continuous testing in development mode, tests will have their own isolated set of services.
Copy file name to clipboardExpand all lines: _versions/main/guides/config-yaml.adoc
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,18 +204,17 @@ The values from this file override any values from the regular `application.yaml
204
204
205
205
The MicroProfile Config specification defines configuration properties as an arbitrary `.`-delimited string.
206
206
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`.
208
208
One property is the prefix of another, so it might not be immediately evident how to specify both keys in your YAML configuration.
209
209
210
210
This is solved by using `~` as a `null` key to represent any YAML property that is a prefix of another one:
211
211
212
212
[source,yaml]
213
213
----
214
-
quarkus:
215
-
http:
216
-
cors:
217
-
~: true
218
-
methods: GET,PUT,POST
214
+
one:
215
+
two:
216
+
~: 12
217
+
three: 123
219
218
----
220
219
221
220
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.
Copy file name to clipboardExpand all lines: _versions/main/guides/security-authorize-web-endpoints-reference.adoc
+20-7Lines changed: 20 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,6 @@ include::_attributes.adoc[]
13
13
Quarkus incorporates a pluggable web security layer.
14
14
When security is active, the system performs a permission check on all HTTP requests to determine if they should proceed.
15
15
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
-
19
16
[NOTE]
20
17
====
21
18
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.
Permissions are defined in the Quarkus configuration by permission sets, each specifying a policy for access control.
32
29
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.
Previous examples demonstrated matching all sub-paths when a path concludes with the `$$*$$`
264
266
wildcard.
265
267
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.
267
269
It cannot be mixed with other path segment characters; thus, path separators always enclose the `$$*$$` wildcard, as seen in the `/public/$$*$$/about-us` path.
268
270
269
271
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
425
427
[[map-security-identity-roles]]
426
428
=== Map `SecurityIdentity` roles
427
429
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.
429
431
These roles are then applicable for endpoint authorization by using the `@RolesAllowed` annotation.
430
432
431
433
[source,properties]
@@ -466,7 +468,7 @@ public class HttpSecurityConfiguration {
466
468
=== Shared permission checks
467
469
468
470
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.
470
472
However, there can be permission checks you want to apply to many paths without repeating them over and over again.
471
473
That's where shared permission checks come in, they are always applied when the permission path is matched.
472
474
@@ -597,13 +599,21 @@ The same authorization can be required with the `@PermissionsAllowed(value = { "
597
599
* xref:security-authentication-mechanisms.adoc#form-based-auth-programmatic-set-up[Set up Form-based authentication programmatically]
598
600
* xref:security-authentication-mechanisms.adoc#mtls-programmatic-set-up[Set up the mutual TLS client authentication programmatically]
599
601
* 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]
600
603
601
604
[[standard-security-annotations]]
602
605
== Authorization using annotations
603
606
604
607
{project-name} includes built-in security to allow for link:https://en.wikipedia.org/wiki/Role-based_access_control[Role-Based Access Control (RBAC)]
605
608
based on the common security annotations `@RolesAllowed`, `@DenyAll`, `@PermitAll` on REST endpoints and CDI beans.
606
609
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
+
607
617
.{project-name} annotation types summary
608
618
[options="header"]
609
619
|===
@@ -684,7 +694,10 @@ This returns `non-null` for a secured endpoint.
684
694
<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.
685
695
The method is still invokable internally by other methods in this class.
686
696
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
+
====
688
701
689
702
The `@RolesAllowed` annotation value supports xref:config-reference.adoc#property-expressions[property expressions] including default values and nested property expressions.
690
703
Configuration properties used with the annotation are resolved at runtime.
== 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:
0 commit comments