From 19aed363491d53ce82be266267fca4f936e61101 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Thu, 14 Sep 2023 11:37:47 +0200 Subject: [PATCH 01/14] Do not store build cache for core extensions having config Fixes #35927 (cherry picked from commit 9cb9bc80162ce6dc997ebd9f78a0203ee26da989) --- core/deployment/pom.xml | 24 ++++++++++++++++++++++++ core/runtime/pom.xml | 24 ++++++++++++++++++++++++ test-framework/jacoco/pom.xml | 26 ++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) diff --git a/core/deployment/pom.xml b/core/deployment/pom.xml index 27d1b159ef07c..bcf7d2ede2268 100644 --- a/core/deployment/pom.xml +++ b/core/deployment/pom.xml @@ -214,6 +214,30 @@ + + + + com.gradle + gradle-enterprise-maven-extension + + + + + + maven-compiler-plugin + + false + + + + + + + + diff --git a/core/runtime/pom.xml b/core/runtime/pom.xml index 3d99ca8337774..4a7a257883f03 100644 --- a/core/runtime/pom.xml +++ b/core/runtime/pom.xml @@ -271,6 +271,30 @@ + + + + com.gradle + gradle-enterprise-maven-extension + + + + + + maven-compiler-plugin + + false + + + + + + + + diff --git a/test-framework/jacoco/pom.xml b/test-framework/jacoco/pom.xml index bb1425bb917c1..1184c83b9ea2c 100644 --- a/test-framework/jacoco/pom.xml +++ b/test-framework/jacoco/pom.xml @@ -17,4 +17,30 @@ deployment runtime + + + + + com.gradle + gradle-enterprise-maven-extension + + + + + + maven-compiler-plugin + + false + + + + + + + + + From 27e25d0cbbc8ae60a4682081f1243ed19369cc87 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 22 Sep 2023 15:13:33 +0200 Subject: [PATCH 02/14] Build cache - Use notCacheableBecause instead of storeEnabled (cherry picked from commit 03288146157249af13f23f21a2a35721191dbd84) --- core/deployment/pom.xml | 2 +- core/runtime/pom.xml | 2 +- extensions/pom.xml | 2 +- test-framework/jacoco/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/deployment/pom.xml b/core/deployment/pom.xml index bcf7d2ede2268..d4b13b09d9a8d 100644 --- a/core/deployment/pom.xml +++ b/core/deployment/pom.xml @@ -229,7 +229,7 @@ maven-compiler-plugin - false + the extension config doc generation tool shares data across all extensions diff --git a/core/runtime/pom.xml b/core/runtime/pom.xml index 4a7a257883f03..f832e1babb3df 100644 --- a/core/runtime/pom.xml +++ b/core/runtime/pom.xml @@ -286,7 +286,7 @@ maven-compiler-plugin - false + the extension config doc generation tool shares data across all extensions diff --git a/extensions/pom.xml b/extensions/pom.xml index 81f2fbfa8d084..8222854e51be2 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -258,7 +258,7 @@ maven-compiler-plugin - false + the extension config doc generation tool shares data across all extensions diff --git a/test-framework/jacoco/pom.xml b/test-framework/jacoco/pom.xml index 1184c83b9ea2c..5d4c00eddc090 100644 --- a/test-framework/jacoco/pom.xml +++ b/test-framework/jacoco/pom.xml @@ -33,7 +33,7 @@ maven-compiler-plugin - false + the extension config doc generation tool shares data across all extensions From 133bd414e345e285990c9bbb4bd7cc3930933230 Mon Sep 17 00:00:00 2001 From: David Andlinger Date: Wed, 4 Oct 2023 15:29:56 +0200 Subject: [PATCH 03/14] fixed URL for configuring JSON support (cherry picked from commit 333eeed07e0671a0516eb4b7637c9308b81a9d98) --- docs/src/main/asciidoc/writing-extensions.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/main/asciidoc/writing-extensions.adoc b/docs/src/main/asciidoc/writing-extensions.adoc index dddaa383af560..9dc9d69d7ac8f 100644 --- a/docs/src/main/asciidoc/writing-extensions.adoc +++ b/docs/src/main/asciidoc/writing-extensions.adoc @@ -1899,7 +1899,7 @@ The Jackson extension will then use the produced build item to register a module If you need more customization capabilities than registering a module, you can produce a CDI bean that implements `io.quarkus.jackson.ObjectMapperCustomizer` via an `AdditionalBeanBuildItem`. -More info about customizing Jackson can be found on the JSON guide xref:rest-json.adoc#configuring-json-support[Configuring JSON support] +More info about customizing Jackson can be found on the JSON guide xref:rest-json.adoc#json[Configuring JSON support] ==== Customizing JSON-B First, add an *optional* dependency to `quarkus-jsonb` on your extension's runtime module. From 4451191107b7a8654a1191bb0c10444b0be95c36 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Thu, 5 Oct 2023 10:59:48 +0200 Subject: [PATCH 04/14] Fix headers and preambles in all guides and reintroduce some keywords As for keywords, guide owners will have to reintroduce them back if needed as I wasn't able to do a 1-1 mapping. (cherry picked from commit 88f4c2e9da33ffade77697f8624f24b49604bb25) --- docs/src/main/asciidoc/ansible.adoc | 5 ++ docs/src/main/asciidoc/cdi-reference.adoc | 1 + docs/src/main/asciidoc/cdi.adoc | 71 ++++++++++--------- .../src/main/asciidoc/extension-metadata.adoc | 7 +- .../main/asciidoc/grpc-virtual-threads.adoc | 6 +- docs/src/main/asciidoc/lifecycle.adoc | 7 +- docs/src/main/asciidoc/liquibase-mongodb.adoc | 1 - .../asciidoc/messaging-virtual-threads.adoc | 6 +- docs/src/main/asciidoc/mutiny-primer.adoc | 1 - .../main/asciidoc/pulsar-dev-services.adoc | 4 +- .../main/asciidoc/quarkus-maven-plugin.adoc | 3 +- .../asciidoc/quarkus-runtime-base-image.adoc | 1 - .../main/asciidoc/rabbitmq-dev-services.adoc | 1 - .../src/main/asciidoc/rabbitmq-reference.adoc | 1 - docs/src/main/asciidoc/redis-reference.adoc | 1 - docs/src/main/asciidoc/resteasy.adoc | 7 +- .../security-authentication-mechanisms.adoc | 5 ++ .../security-basic-authentication-howto.adoc | 5 ++ ...ecurity-basic-authentication-tutorial.adoc | 5 ++ .../security-basic-authentication.adoc | 5 ++ .../asciidoc/security-csrf-prevention.adoc | 5 +- .../main/asciidoc/security-customization.adoc | 3 +- docs/src/main/asciidoc/security-jpa.adoc | 5 ++ .../src/main/asciidoc/security-jwt-build.adoc | 1 - .../security-keycloak-admin-client.adoc | 3 +- .../security-keycloak-authorization.adoc | 1 + docs/src/main/asciidoc/security-oauth2.adoc | 1 + ...idc-code-flow-authentication-tutorial.adoc | 5 ++ ...urity-openid-connect-client-reference.adoc | 1 - .../security-openid-connect-dev-services.adoc | 1 + .../security-openid-connect-multitenancy.adoc | 13 ++-- .../security-openid-connect-providers.adoc | 11 +-- docs/src/main/asciidoc/security-overview.adoc | 5 ++ docs/src/main/asciidoc/security-testing.adoc | 1 - docs/src/main/asciidoc/smallrye-metrics.adoc | 3 +- docs/src/main/asciidoc/stork-kubernetes.adoc | 1 - docs/src/main/asciidoc/stork-reference.adoc | 1 - docs/src/main/asciidoc/stork.adoc | 1 - 38 files changed, 122 insertions(+), 83 deletions(-) diff --git a/docs/src/main/asciidoc/ansible.adoc b/docs/src/main/asciidoc/ansible.adoc index 476cd7c5fdb3e..696d5d4bed922 100644 --- a/docs/src/main/asciidoc/ansible.adoc +++ b/docs/src/main/asciidoc/ansible.adoc @@ -1,3 +1,8 @@ +//// +This guide is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc +//// = Automate Quarkus deployment with Ansible include::_attributes.adoc[] :categories: command-line diff --git a/docs/src/main/asciidoc/cdi-reference.adoc b/docs/src/main/asciidoc/cdi-reference.adoc index 45165171358b9..79c71d5da13de 100644 --- a/docs/src/main/asciidoc/cdi-reference.adoc +++ b/docs/src/main/asciidoc/cdi-reference.adoc @@ -6,6 +6,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc = Contexts and Dependency Injection include::_attributes.adoc[] :categories: core +:keywords: arc :summary: Go more in depth into the Quarkus implementation of CDI. :numbered: :sectnums: diff --git a/docs/src/main/asciidoc/cdi.adoc b/docs/src/main/asciidoc/cdi.adoc index f7fc301f48c72..dd4d69fb26821 100644 --- a/docs/src/main/asciidoc/cdi.adoc +++ b/docs/src/main/asciidoc/cdi.adoc @@ -6,6 +6,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc = Introduction to Contexts and Dependency Injection (CDI) include::_attributes.adoc[] :categories: core +:keywords: qualifier event interceptor observer arc :summary: Quarkus DI solution is based on the [Jakarta Contexts and Dependency Injection 4.0](https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html) specification. This guide explains the basics of CDI. :numbered: :sectnums: @@ -28,7 +29,7 @@ It creates and destroys the instances of beans, associates the instances with a An application developer can focus on the business logic rather than finding out "where and how" to obtain a fully initialized component with all of its dependencies. -NOTE: You've probably heard of the _inversion of control_ (IoC) programming principle. Dependency injection is one of the implementation techniques of IoC. +NOTE: You've probably heard of the _inversion of control_ (IoC) programming principle. Dependency injection is one of the implementation techniques of IoC. == What does a bean look like? @@ -47,9 +48,9 @@ public class Translator { @Inject Dictionary dictionary; <2> - + @Counted <3> - String translate(String sentence) { + String translate(String sentence) { // ... } } @@ -86,8 +87,8 @@ public class Translator { @Inject Instance dictionaries; <1> - - String translate(String sentence) { + + String translate(String sentence) { for (Dictionary dict : dictionaries) { <2> // ... } @@ -122,11 +123,11 @@ public class Translator { } } ---- -<1> This is a constructor injection. -In fact, this code would not work in regular CDI implementations where a bean with a normal scope must always declare a no-args constructor and the bean constructor must be annotated with `@Inject`. +<1> This is a constructor injection. +In fact, this code would not work in regular CDI implementations where a bean with a normal scope must always declare a no-args constructor and the bean constructor must be annotated with `@Inject`. However, in Quarkus we detect the absence of no-args constructor and "add" it directly in the bytecode. It's also not necessary to add `@Inject` if there is only one constructor present. -<2> An initializer method must be annotated with `@Inject`. +<2> An initializer method must be annotated with `@Inject`. <3> An initializer may accept multiple parameters - each one is an injection point. == You talked about some qualifiers? @@ -155,7 +156,7 @@ The qualifiers of a bean are declared by annotating the bean class or producer m @ApplicationScoped public class SuperiorTranslator extends Translator { - String translate(String sentence) { + String translate(String sentence) { // ... } } @@ -180,11 +181,11 @@ You can use all the built-in scopes mentioned by the specification except for `j [options="header",cols="1,1"] |=== -|Annotation |Description +|Annotation |Description //---------------------- -|`@jakarta.enterprise.context.ApplicationScoped` | A single bean instance is used for the application and shared among all injection points. The instance is created lazily, i.e. once a method is invoked upon the <>. +|`@jakarta.enterprise.context.ApplicationScoped` | A single bean instance is used for the application and shared among all injection points. The instance is created lazily, i.e. once a method is invoked upon the <>. |`@jakarta.inject.Singleton` | Just like `@ApplicationScoped` except that no client proxy is used. The instance is created when an injection point that resolves to a @Singleton bean is being injected. -|`@jakarta.enterprise.context.RequestScoped` | The bean instance is associated with the current _request_ (usually an HTTP request). +|`@jakarta.enterprise.context.RequestScoped` | The bean instance is associated with the current _request_ (usually an HTTP request). |`@jakarta.enterprise.context.Dependent` | This is a pseudo-scope. The instances are not shared and every injection point spawns a new instance of the dependent bean. The lifecycle of dependent bean is bound to the bean injecting it - it will be created and destroyed along with the bean injecting it. |`@jakarta.enterprise.context.SessionScoped` | This scope is backed by a `jakarta.servlet.http.HttpSession` object. It's only available if the `quarkus-undertow` extension is used. |=== @@ -217,7 +218,7 @@ Indeed, the https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html# A client proxy is basically an object that delegates all method invocations to a target bean instance. It's a container construct that implements `io.quarkus.arc.ClientProxy` and extends the bean class. -IMPORTANT: Client proxies only delegate method invocations. So never read or write a field of a normal scoped bean, otherwise you will work with non-contextual or stale data. +IMPORTANT: Client proxies only delegate method invocations. So never read or write a field of a normal scoped bean, otherwise you will work with non-contextual or stale data. .Generated Client Proxy Example [source,java] @@ -225,7 +226,7 @@ IMPORTANT: Client proxies only delegate method invocations. So never read or wri @ApplicationScoped class Translator { - String translate(String sentence) { + String translate(String sentence) { // ... } } @@ -233,7 +234,7 @@ class Translator { // The client proxy class is generated and looks like... class Translator_ClientProxy extends Translator { <1> - String translate(String sentence) { + String translate(String sentence) { // Find the correct translator instance... Translator translator = getTranslatorInstanceFromTheApplicationContext(); // And delegate the method invocation... @@ -247,10 +248,10 @@ Client proxies allow for: * Lazy instantiation - the instance is created once a method is invoked upon the proxy. * Ability to inject a bean with "narrower" scope to a bean with "wider" scope; i.e. you can inject a `@RequestScoped` bean into an `@ApplicationScoped` bean. -* Circular dependencies in the dependency graph. Having circular dependencies is often an indication that a redesign should be considered, but sometimes it's inevitable. +* Circular dependencies in the dependency graph. Having circular dependencies is often an indication that a redesign should be considered, but sometimes it's inevitable. * In rare cases it's practical to destroy the beans manually. A direct injected reference would lead to a stale bean instance. - - + + == OK. You said that there are several kinds of beans? Yes. In general, we distinguish: @@ -273,7 +274,7 @@ public class Producers { @Produces <1> double pi = Math.PI; <2> - + @Produces <3> List names() { List names = new ArrayList<>(); @@ -289,26 +290,26 @@ public class Consumer { @Inject double pi; - + @Inject List names; - - // ... -} + + // ... +} ---- <1> The container analyses the field annotations to build a bean metadata. -The _type_ is used to build the set of bean types. +The _type_ is used to build the set of bean types. In this case, it will be `double` and `java.lang.Object`. No scope annotation is declared and so it's defaulted to `@Dependent`. <2> The container will read this field when creating the bean instance. <3> The container analyses the method annotations to build a bean metadata. -The _return type_ is used to build the set of bean types. +The _return type_ is used to build the set of bean types. In this case, it will be `List`, `Collection`, `Iterable` and `java.lang.Object`. No scope annotation is declared and so it's defaulted to `@Dependent`. <4> The container will call this method when creating the bean instance. -There's more about producers. -You can declare qualifiers, inject dependencies into the producer methods parameters, etc. +There's more about producers. +You can declare qualifiers, inject dependencies into the producer methods parameters, etc. You can read more about producers for example in the https://docs.jboss.org/weld/reference/latest/en-US/html/producermethods.html[Weld docs, window="_blank"]. == OK, injection looks cool. What other services are provided? @@ -330,7 +331,7 @@ public class Translator { void init() { // ... } - + @PreDestroy <2> void destroy() { // ... @@ -345,7 +346,7 @@ TIP: It's a good practice to keep the logic in the callbacks "without side effec [[interceptors]] === Interceptors -Interceptors are used to separate cross-cutting concerns from business logic. +Interceptors are used to separate cross-cutting concerns from business logic. There is a separate specification - Java Interceptors - that defines the basic programming model and semantics. .Simple Interceptor Binding Example @@ -392,11 +393,11 @@ public class LoggingInterceptor { // ...log after return ret; } - + } ---- <1> The interceptor binding annotation is used to bind our interceptor to a bean. Simply annotate a bean class with `@Logged`, as in the following example. -<2> `Priority` enables the interceptor and affects the interceptor ordering. Interceptors with smaller priority values are called first. +<2> `Priority` enables the interceptor and affects the interceptor ordering. Interceptors with smaller priority values are called first. <3> Marks an interceptor component. <4> An interceptor may inject dependencies. <5> `AroundInvoke` denotes a method that interposes on business methods. @@ -448,7 +449,7 @@ public class LargeTxAccount implements Account { <3> @Any @Delegate Account delegate; <4> - + @Inject LogService logService; <5> @@ -458,10 +459,10 @@ public class LargeTxAccount implements Account { <3> logService.logWithdrawal(delegate, amount); } } - + } ---- -<1> `@Priority` enables the decorator. Decorators with smaller priority values are called first. +<1> `@Priority` enables the decorator. Decorators with smaller priority values are called first. <2> `@Decorator` marks a decorator component. <3> The set of decorated types includes all bean types which are Java interfaces, except for `java.io.Serializable`. <4> Each decorator must declare exactly one _delegate injection point_. The decorator applies to beans that are assignable to this delegate injection point. @@ -471,7 +472,7 @@ public class LargeTxAccount implements Account { <3> NOTE: Instances of decorators are dependent objects of the bean instance they intercept, i.e. a new decorator instance is created for each intercepted bean. === Events and Observers - + Beans may also produce and consume events to interact in a completely decoupled fashion. Any Java object can serve as an event payload. The optional qualifiers act as topic selectors. diff --git a/docs/src/main/asciidoc/extension-metadata.adoc b/docs/src/main/asciidoc/extension-metadata.adoc index dcbdb6106e1fd..d48bad282bb1f 100644 --- a/docs/src/main/asciidoc/extension-metadata.adoc +++ b/docs/src/main/asciidoc/extension-metadata.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Quarkus Extension Metadata - include::_attributes.adoc[] Quarkus extensions are distributed as Maven JAR artifacts that application and other libraries may depend on. When a Quarkus application project is built, tested or edited using the Quarkus dev tools, Quarkus extension JAR artifacts will be identified on the application classpath by the presence of the Quarkus extension metadata files in them. @@ -127,11 +126,11 @@ The following properties may appear in this file: | `parent-first-artifacts` | Optional -| Comma-separated list of artifact keys (`groupId:artifactId:classifier:type`) that are to be loaded in a parent first manner. This can be used to work around issues where a given class needs to be loaded by the system ClassLoader. +| Comma-separated list of artifact keys (`groupId:artifactId:classifier:type`) that are to be loaded in a parent first manner. This can be used to work around issues where a given class needs to be loaded by the system ClassLoader. | `runner-parent-first-artifacts` | Optional -| Comma-separated list of artifact keys that are to be loaded in a parent first manner in addition to those configured with `parent-first-artifacts` when an application is launched from a production binary package. This can be used to work around issues where a given class needs to be loaded by the system ClassLoader. +| Comma-separated list of artifact keys that are to be loaded in a parent first manner in addition to those configured with `parent-first-artifacts` when an application is launched from a production binary package. This can be used to work around issues where a given class needs to be loaded by the system ClassLoader. | `excluded-artifacts` | Optional @@ -143,7 +142,7 @@ The following properties may appear in this file: | `removed-resources.*` | Optional -| Resources that should be removed/hidden from dependencies. This allows for classes and other resources to be removed from dependencies, so they are not accessible to the application. This is a map of artifact key to a comma-separated list of resources to be removed. When running in dev and test mode these resources are hidden from the ClassLoader, when running in production mode these files are removed from the jars that contain them. Note that if you want to remove a class you need to specify the class file name. e.g. to remove com.acme.Foo you would specify com/acme/Foo.class. +| Resources that should be removed/hidden from dependencies. This allows for classes and other resources to be removed from dependencies, so they are not accessible to the application. This is a map of artifact key to a comma-separated list of resources to be removed. When running in dev and test mode these resources are hidden from the ClassLoader, when running in production mode these files are removed from the jars that contain them. Note that if you want to remove a class you need to specify the class file name. e.g. to remove com.acme.Foo you would specify com/acme/Foo.class. | `provides-capabilities` | Optional diff --git a/docs/src/main/asciidoc/grpc-virtual-threads.adoc b/docs/src/main/asciidoc/grpc-virtual-threads.adoc index eb027e7b7d375..9f4445b003c38 100644 --- a/docs/src/main/asciidoc/grpc-virtual-threads.adoc +++ b/docs/src/main/asciidoc/grpc-virtual-threads.adoc @@ -1,5 +1,9 @@ +//// +This guide is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc +//// = Quarkus Virtual Thread support for gRPC services - include::_attributes.adoc[] :runonvthread: https://javadoc.io/doc/io.smallrye.common/smallrye-common-annotation/latest/io/smallrye/common/annotation/RunOnVirtualThread.html :blocking_annotation: https://javadoc.io/doc/io.smallrye.reactive/smallrye-reactive-messaging-api/latest/io/smallrye/reactive/messaging/annotations/Blocking.html diff --git a/docs/src/main/asciidoc/lifecycle.adoc b/docs/src/main/asciidoc/lifecycle.adoc index 57a2d0e779183..d1ce9c795e2cc 100644 --- a/docs/src/main/asciidoc/lifecycle.adoc +++ b/docs/src/main/asciidoc/lifecycle.adoc @@ -6,6 +6,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc = Application Initialization and Termination include::_attributes.adoc[] :categories: core +:keywords: lifecycle event :summary: You often need to execute custom actions when the application starts and clean up everything when the application stops. This guide explains how to be notified when an application stops or starts. You often need to execute custom actions when the application starts and clean up everything when the application stops. @@ -175,7 +176,7 @@ NOTE: The methods can access injected beans. Check the link:{quickstarts-blob-ur === What is the difference from `@Initialized(ApplicationScoped.class)` and `@Destroyed(ApplicationScoped.class)` -In the JVM mode, there is no real difference, except that `StartupEvent` is always fired *after* `@Initialized(ApplicationScoped.class)` and `ShutdownEvent` is fired *before* `@Destroyed(ApplicationScoped.class)`. +In the JVM mode, there is no real difference, except that `StartupEvent` is always fired *after* `@Initialized(ApplicationScoped.class)` and `ShutdownEvent` is fired *before* `@Destroyed(ApplicationScoped.class)`. For a native executable build, however, `@Initialized(ApplicationScoped.class)` is fired as *part of the native build process*, whereas `StartupEvent` is fired when the native image is executed. See xref:writing-extensions.adoc#bootstrap-three-phases[Three Phases of Bootstrap and Quarkus Philosophy] for more details. @@ -192,10 +193,10 @@ package org.acme.lifecycle; import jakarta.enterprise.context.ApplicationScoped; -@Startup // <1> +@Startup // <1> @ApplicationScoped public class EagerAppBean { - + private final String name; EagerAppBean(NameGenerator generator) { // <2> diff --git a/docs/src/main/asciidoc/liquibase-mongodb.adoc b/docs/src/main/asciidoc/liquibase-mongodb.adoc index 9e92484258369..dce4d2d1fc59c 100644 --- a/docs/src/main/asciidoc/liquibase-mongodb.adoc +++ b/docs/src/main/asciidoc/liquibase-mongodb.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Using Liquibase MongoDB - include::_attributes.adoc[] :change-log: src/main/resources/db/changeLog.xml :config-file: application.properties diff --git a/docs/src/main/asciidoc/messaging-virtual-threads.adoc b/docs/src/main/asciidoc/messaging-virtual-threads.adoc index 8b633f0d3aec8..ccf8a9f0b6ad6 100644 --- a/docs/src/main/asciidoc/messaging-virtual-threads.adoc +++ b/docs/src/main/asciidoc/messaging-virtual-threads.adoc @@ -1,5 +1,9 @@ +//// +This guide is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc +//// = Quarkus Virtual Thread support with Reactive Messaging - include::_attributes.adoc[] :runonvthread: https://javadoc.io/doc/io.smallrye.common/smallrye-common-annotation/latest/io/smallrye/common/annotation/RunOnVirtualThread.html :rm_blocking_annotation: https://javadoc.io/doc/io.smallrye.reactive/smallrye-reactive-messaging-api/latest/io/smallrye/reactive/messaging/annotations/Blocking.html diff --git a/docs/src/main/asciidoc/mutiny-primer.adoc b/docs/src/main/asciidoc/mutiny-primer.adoc index 6e76490f4a123..88966385f0c1f 100644 --- a/docs/src/main/asciidoc/mutiny-primer.adoc +++ b/docs/src/main/asciidoc/mutiny-primer.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Mutiny - Async for bare mortal - include::_attributes.adoc[] https://smallrye.io/smallrye-mutiny[Mutiny] is an intuitive, reactive programming library. diff --git a/docs/src/main/asciidoc/pulsar-dev-services.adoc b/docs/src/main/asciidoc/pulsar-dev-services.adoc index e8e3d8ac1c6eb..3a40ab216db97 100644 --- a/docs/src/main/asciidoc/pulsar-dev-services.adoc +++ b/docs/src/main/asciidoc/pulsar-dev-services.adoc @@ -62,6 +62,6 @@ The following example enables transaction support: [source, properties] ---- -quarkus.pulsar.devservices.broker-config.transactionCoordinatorEnabled=true -quarkus.pulsar.devservices.broker-config.systemTopicEnabled=true +quarkus.pulsar.devservices.broker-config.transaction-coordinator-enabled=true +quarkus.pulsar.devservices.broker-config.system-topic-enabled=true ---- diff --git a/docs/src/main/asciidoc/quarkus-maven-plugin.adoc b/docs/src/main/asciidoc/quarkus-maven-plugin.adoc index aadebc85ea9e6..ae1c766b2691f 100644 --- a/docs/src/main/asciidoc/quarkus-maven-plugin.adoc +++ b/docs/src/main/asciidoc/quarkus-maven-plugin.adoc @@ -4,12 +4,11 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Quarkus Maven Plugin +include::_attributes.adoc[] The Quarkus Maven Plugin builds the Quarkus applications, and provides helpers to launch dev mode or build native executables. For more information about how to use the Quarkus Maven Plugin, please refer to the xref:maven-tooling.adoc[Maven Tooling guide]. -include::_attributes.adoc[] - == Discover Maven goals Like most Maven plugins, the Quarkus Maven Plugin has a `help` goal that prints the description of the plugin, listing all available goals as well as their description. diff --git a/docs/src/main/asciidoc/quarkus-runtime-base-image.adoc b/docs/src/main/asciidoc/quarkus-runtime-base-image.adoc index c1c2ee282971b..c891734ead830 100644 --- a/docs/src/main/asciidoc/quarkus-runtime-base-image.adoc +++ b/docs/src/main/asciidoc/quarkus-runtime-base-image.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Quarkus Base Runtime Image - include::_attributes.adoc[] To ease the containerization of native executables, Quarkus provides a base image providing the requirements to run these executables. diff --git a/docs/src/main/asciidoc/rabbitmq-dev-services.adoc b/docs/src/main/asciidoc/rabbitmq-dev-services.adoc index bbcdef597b99a..8454327bd5b15 100644 --- a/docs/src/main/asciidoc/rabbitmq-dev-services.adoc +++ b/docs/src/main/asciidoc/rabbitmq-dev-services.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Dev Services for RabbitMQ - include::_attributes.adoc[] Dev Services for RabbitMQ automatically starts a RabbitMQ broker in dev mode and when running tests. diff --git a/docs/src/main/asciidoc/rabbitmq-reference.adoc b/docs/src/main/asciidoc/rabbitmq-reference.adoc index 105a674eb4940..84271eff319e7 100644 --- a/docs/src/main/asciidoc/rabbitmq-reference.adoc +++ b/docs/src/main/asciidoc/rabbitmq-reference.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Reactive Messaging RabbitMQ Connector Reference Documentation - include::_attributes.adoc[] This guide is the companion from the xref:rabbitmq.adoc[Getting Started with RabbitMQ]. diff --git a/docs/src/main/asciidoc/redis-reference.adoc b/docs/src/main/asciidoc/redis-reference.adoc index a49ae779c37c1..fa25027b7ce45 100644 --- a/docs/src/main/asciidoc/redis-reference.adoc +++ b/docs/src/main/asciidoc/redis-reference.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Redis Extension Reference Guide - :extension-status: preview include::_attributes.adoc[] :numbered: diff --git a/docs/src/main/asciidoc/resteasy.adoc b/docs/src/main/asciidoc/resteasy.adoc index 39ac40d3b20a2..7d608174e0cf0 100644 --- a/docs/src/main/asciidoc/resteasy.adoc +++ b/docs/src/main/asciidoc/resteasy.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = RESTEasy Classic - include::_attributes.adoc[] [WARNING] @@ -210,7 +209,7 @@ public class RegisterCustomModuleCustomizer implements ObjectMapperCustomizer { Users can even provide their own `ObjectMapper` bean if they so choose. If this is done, it is very important to manually inject and apply all `io.quarkus.jackson.ObjectMapperCustomizer` beans in the CDI producer that produces `ObjectMapper`. -Failure to do so will prevent Jackson specific customizations provided by various extensions from being applied. +Failure to do so will prevent Jackson specific customizations provided by various extensions from being applied. [source,java] ---- @@ -293,7 +292,7 @@ public class CustomJsonbConfig { [[links]] === JSON Hypertext Application Language (HAL) support -The https://tools.ietf.org/id/draft-kelly-json-hal-01.html[HAL] standard is a simple format to represent web links. +The https://tools.ietf.org/id/draft-kelly-json-hal-01.html[HAL] standard is a simple format to represent web links. To enable the HAL support, add the `quarkus-hal` extension to your project. Also, as HAL needs JSON support, you need to add either the `quarkus-resteasy-jsonb` or the `quarkus-resteasy-jackson` extension. @@ -330,7 +329,7 @@ public class RecordsResource { } ---- -Now, the endpoints `/records` and `/records/first` will accept the media type both `json` and `hal+json` to print the records in Hal format. +Now, the endpoints `/records` and `/records/first` will accept the media type both `json` and `hal+json` to print the records in Hal format. For example, if we invoke the `/records` endpoint using curl to return a list of records, the HAL format will look like as follows: diff --git a/docs/src/main/asciidoc/security-authentication-mechanisms.adoc b/docs/src/main/asciidoc/security-authentication-mechanisms.adoc index 0ccbb5e426867..70b42c4c88ef4 100644 --- a/docs/src/main/asciidoc/security-authentication-mechanisms.adoc +++ b/docs/src/main/asciidoc/security-authentication-mechanisms.adoc @@ -1,3 +1,8 @@ +//// +This document is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc +//// [id="security-authentication-mechanisms"] = Authentication mechanisms in Quarkus include::_attributes.adoc[] diff --git a/docs/src/main/asciidoc/security-basic-authentication-howto.adoc b/docs/src/main/asciidoc/security-basic-authentication-howto.adoc index 2f620a217c871..f298a74372419 100644 --- a/docs/src/main/asciidoc/security-basic-authentication-howto.adoc +++ b/docs/src/main/asciidoc/security-basic-authentication-howto.adoc @@ -1,3 +1,8 @@ +//// +This document is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc +//// [id="security-basic-authentication-howto"] = Enable Basic authentication include::_attributes.adoc[] diff --git a/docs/src/main/asciidoc/security-basic-authentication-tutorial.adoc b/docs/src/main/asciidoc/security-basic-authentication-tutorial.adoc index 1b62aecee6d50..b89c9fdcb3344 100644 --- a/docs/src/main/asciidoc/security-basic-authentication-tutorial.adoc +++ b/docs/src/main/asciidoc/security-basic-authentication-tutorial.adoc @@ -1,3 +1,8 @@ +//// +This document is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc +//// [id="security-basic-authentication-tutorial"] = Secure a Quarkus application with Basic authentication and Jakarta Persistence include::_attributes.adoc[] diff --git a/docs/src/main/asciidoc/security-basic-authentication.adoc b/docs/src/main/asciidoc/security-basic-authentication.adoc index 4349139f8179d..ea702ebe9520b 100644 --- a/docs/src/main/asciidoc/security-basic-authentication.adoc +++ b/docs/src/main/asciidoc/security-basic-authentication.adoc @@ -1,3 +1,8 @@ +//// +This document is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc +//// [id="security-basic-authentication"] = Basic authentication include::_attributes.adoc[] diff --git a/docs/src/main/asciidoc/security-csrf-prevention.adoc b/docs/src/main/asciidoc/security-csrf-prevention.adoc index 76e22280dcf90..a417f5f08626d 100644 --- a/docs/src/main/asciidoc/security-csrf-prevention.adoc +++ b/docs/src/main/asciidoc/security-csrf-prevention.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Cross-Site Request Forgery Prevention - include::_attributes.adoc[] https://owasp.org/www-community/attacks/csrf[Cross-Site Request Forgery (CSRF)] is an attack that forces an end user to execute unwanted actions on a web application in which they are currently authenticated. @@ -58,14 +57,14 @@ Next, let's add a `csrfToken.html` Qute template producing an HTML form in the ` -User Name Input +User Name Input

User Name Input

<1> - +

Your Name:

diff --git a/docs/src/main/asciidoc/security-customization.adoc b/docs/src/main/asciidoc/security-customization.adoc index 17b513c0e8519..246358d7731af 100644 --- a/docs/src/main/asciidoc/security-customization.adoc +++ b/docs/src/main/asciidoc/security-customization.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Security Tips and Tricks - include::_attributes.adoc[] == Quarkus Security Dependency @@ -621,6 +620,6 @@ xref:context-propagation.adoc[Context Propagation Guide]. == References * xref:security-overview.adoc[Quarkus Security overview] -* xref:security-architecture.adoc[Quarkus Security architecture] +* xref:security-architecture.adoc[Quarkus Security architecture] * xref:security-authentication-mechanisms.adoc#other-supported-authentication-mechanisms[Authentication mechanisms in Quarkus] * xref:security-identity-providers.adoc[Identity providers] \ No newline at end of file diff --git a/docs/src/main/asciidoc/security-jpa.adoc b/docs/src/main/asciidoc/security-jpa.adoc index eb5faa68d4698..8a5eaf4d13f1f 100644 --- a/docs/src/main/asciidoc/security-jpa.adoc +++ b/docs/src/main/asciidoc/security-jpa.adoc @@ -1,3 +1,8 @@ +//// +This document is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc +//// [id="security-jpa"] = Quarkus Security with Jakarta Persistence include::_attributes.adoc[] diff --git a/docs/src/main/asciidoc/security-jwt-build.adoc b/docs/src/main/asciidoc/security-jwt-build.adoc index 76365e2c562d5..15a26f4bb69c4 100644 --- a/docs/src/main/asciidoc/security-jwt-build.adoc +++ b/docs/src/main/asciidoc/security-jwt-build.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Build, Sign and Encrypt JSON Web Tokens - include::_attributes.adoc[] According to link:https://datatracker.ietf.org/doc/html/rfc7519[RFC7519], JSON Web Token (JWT) is a compact, URL-safe means of representing claims which are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure, enabling the claims to be digitally signed or integrity protected with a Message Authentication Code(MAC) and/or encrypted. diff --git a/docs/src/main/asciidoc/security-keycloak-admin-client.adoc b/docs/src/main/asciidoc/security-keycloak-admin-client.adoc index c27caf445b802..7a82118a0c362 100644 --- a/docs/src/main/asciidoc/security-keycloak-admin-client.adoc +++ b/docs/src/main/asciidoc/security-keycloak-admin-client.adoc @@ -4,8 +4,9 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Using Keycloak Admin Client - include::_attributes.adoc[] +:categories: security +:keywords: sso oidc security keycloak The Quarkus Keycloak Admin Client and its reactive twin support Keycloak Admin Client which can be used to configure a running Keycloak server. diff --git a/docs/src/main/asciidoc/security-keycloak-authorization.adoc b/docs/src/main/asciidoc/security-keycloak-authorization.adoc index cc64943975af0..ee3c2ec03fae3 100644 --- a/docs/src/main/asciidoc/security-keycloak-authorization.adoc +++ b/docs/src/main/asciidoc/security-keycloak-authorization.adoc @@ -6,6 +6,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc = Using OpenID Connect (OIDC) and Keycloak to Centralize Authorization include::_attributes.adoc[] :categories: security +:keywords: sso oidc security keycloak :summary: This guide demonstrates how your Quarkus application can authorize access to protected resources using Keycloak Authorization Services. This guide demonstrates how your Quarkus application can authorize a bearer token access to protected resources using https://www.keycloak.org/docs/latest/authorization_services/index.html[Keycloak Authorization Services]. diff --git a/docs/src/main/asciidoc/security-oauth2.adoc b/docs/src/main/asciidoc/security-oauth2.adoc index 91dbb82a9cc5a..97db6f2de8b95 100644 --- a/docs/src/main/asciidoc/security-oauth2.adoc +++ b/docs/src/main/asciidoc/security-oauth2.adoc @@ -6,6 +6,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc = Using OAuth2 RBAC include::_attributes.adoc[] :categories: security +:keywords: oauth :summary: This guide explains how your Quarkus application can utilize OAuth2 tokens to provide secured access to the Jakarta REST endpoints. :extension-name: Elytron Security OAuth2 diff --git a/docs/src/main/asciidoc/security-oidc-code-flow-authentication-tutorial.adoc b/docs/src/main/asciidoc/security-oidc-code-flow-authentication-tutorial.adoc index 296d4a8f2a07a..5b2aae1914940 100644 --- a/docs/src/main/asciidoc/security-oidc-code-flow-authentication-tutorial.adoc +++ b/docs/src/main/asciidoc/security-oidc-code-flow-authentication-tutorial.adoc @@ -1,3 +1,8 @@ +//// +This document is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc +//// [id="security-oidc-code-flow-authentication-tutorial"] = Protect a web application by using OpenID Connect (OIDC) authorization code flow include::_attributes.adoc[] diff --git a/docs/src/main/asciidoc/security-openid-connect-client-reference.adoc b/docs/src/main/asciidoc/security-openid-connect-client-reference.adoc index 0363757984663..f875bc2f8931a 100644 --- a/docs/src/main/asciidoc/security-openid-connect-client-reference.adoc +++ b/docs/src/main/asciidoc/security-openid-connect-client-reference.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = OpenID Connect (OIDC) and OAuth2 Client and Filters Reference Guide - include::_attributes.adoc[] This reference guide explains how to use: diff --git a/docs/src/main/asciidoc/security-openid-connect-dev-services.adoc b/docs/src/main/asciidoc/security-openid-connect-dev-services.adoc index 331ccb5b3f43f..6a36e9a4eff8e 100644 --- a/docs/src/main/asciidoc/security-openid-connect-dev-services.adoc +++ b/docs/src/main/asciidoc/security-openid-connect-dev-services.adoc @@ -6,6 +6,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc = Dev Services and UI for OpenID Connect (OIDC) include::_attributes.adoc[] :categories: security +:keywords: sso oidc security keycloak :summary: Start Keycloak or other providers automatically in dev and test modes. This guide covers the Dev Services and UI for OpenID Connect (OIDC) Keycloak provider and explains how to support Dev Services and UI for other OpenID Connect providers. diff --git a/docs/src/main/asciidoc/security-openid-connect-multitenancy.adoc b/docs/src/main/asciidoc/security-openid-connect-multitenancy.adoc index 95a0f492ff7ca..58034abdb8603 100644 --- a/docs/src/main/asciidoc/security-openid-connect-multitenancy.adoc +++ b/docs/src/main/asciidoc/security-openid-connect-multitenancy.adoc @@ -6,6 +6,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc = Using OpenID Connect (OIDC) Multi-Tenancy include::_attributes.adoc[] :categories: security +:keywords: sso oidc oauth2 security :summary: This guide demonstrates how your OpenID Connect application can support multi-tenancy so that you can serve multiple tenants from a single application. This guide demonstrates how your OpenID Connect (OIDC) application can support multi-tenancy so that you can serve multiple tenants from a single application. Tenants can be distinct realms or security domains within the same OpenID Provider or even distinct OpenID Providers. @@ -590,9 +591,9 @@ To configure the resolution of the tenant identifier, use one of the following o [[default-tenant-resolver]] === Default resolution -The default resolution for a tenant identifier is convention based, whereby the authentication request must include the tenant identifier in the last segment of the request path. +The default resolution for a tenant identifier is convention based, whereby the authentication request must include the tenant identifier in the last segment of the request path. -The following `application.properties` example shows how you can configure two tenants named `google` and `github`: +The following `application.properties` example shows how you can configure two tenants named `google` and `github`: [source,properties] ---- @@ -609,7 +610,7 @@ quarkus.oidc.github.credentials.secret=${github-client-secret} quarkus.oidc.github.authentication.redirect-path=/signed-in ---- -In this example, both tenants configure OIDC `web-app` applications to use an authorization code flow to authenticate users and also require session cookies to get generated after the authentication has taken place. +In this example, both tenants configure OIDC `web-app` applications to use an authorization code flow to authenticate users and also require session cookies to get generated after the authentication has taken place. After either Google or GitHub authenticates the current user, the user gets returned to the `/signed-in` area for authenticated users, for example, a secured resource path on the JAX-RS endpoint. Finally, to complete the default tenant resolution, set the following configuration property: @@ -620,8 +621,8 @@ quarkus.http.auth.permission.login.paths=/google,/github quarkus.http.auth.permission.login.policy=authenticated ---- -If the endpoint is running on `http://localhost:8080`, you can also provide UI options for users to log in to either `http://localhost:8080/google` or `http://localhost:8080/github`, without having to add specific`/google` or `/github` JAX-RS resource paths. -Tenant identifiers are also recorded in the session cookie names after the authentication is completed. +If the endpoint is running on `http://localhost:8080`, you can also provide UI options for users to log in to either `http://localhost:8080/google` or `http://localhost:8080/github`, without having to add specific`/google` or `/github` JAX-RS resource paths. +Tenant identifiers are also recorded in the session cookie names after the authentication is completed. Therefore, authenticated users can access the secured application area without requiring either the `google` or `github` path values to be included in the secured URL. Default resolution can also work for Bearer token authentication but it might be less practical in this case because a tenant identifier will always need to be set as the last path segment value. @@ -629,7 +630,7 @@ Default resolution can also work for Bearer token authentication but it might be [[tenant-resolver]] === Resolve with `TenantResolver` -The following `application.properties` example shows how you can resolve the tenant identifier of two tenants named `a` and `b` by using the `TenantResolver` method: +The following `application.properties` example shows how you can resolve the tenant identifier of two tenants named `a` and `b` by using the `TenantResolver` method: [source,properties] ---- diff --git a/docs/src/main/asciidoc/security-openid-connect-providers.adoc b/docs/src/main/asciidoc/security-openid-connect-providers.adoc index 8b7b24c82ea5a..ae29372ea829d 100644 --- a/docs/src/main/asciidoc/security-openid-connect-providers.adoc +++ b/docs/src/main/asciidoc/security-openid-connect-providers.adoc @@ -8,6 +8,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc include::_attributes.adoc[] :diataxis-type: concept :categories: security,web +:keywords: oidc github twitter google facebook mastodon microsoft apple spotify twitch :toclevels: 3 This document explains how to configure well-known social OIDC and OAuth2 providers. @@ -178,7 +179,7 @@ quarkus.oidc.token.customizer-name=azure-access-token-customizer [[apple]] === Apple -In order to set up OIDC for Apple you need to create a developer account, and sign up for the 99€/year program, but you cannot test your application on `localhost` like most other OIDC providers: +In order to set up OIDC for Apple you need to create a developer account, and sign up for the 99€/year program, but you cannot test your application on `localhost` like most other OIDC providers: you will need to run it over `https` and make it publicly accessible, so for development purposes you may want to use a service such as https://ngrok.com. @@ -287,7 +288,7 @@ quarkus.oidc.credentials.jwt.subject=> for more information about registering your Quarkus appli === Spotify Create a https://developer.spotify.com/documentation/general/guides/authorization/app-settings/[Spotify application]: - + image::oidc-spotify-1.png[role="thumb"] Don't forget to add `http://localhost:8080` as a redirect URI for testing during development purposes. You should get a client id and secret generated once a Spotify application setup has been complete, for example: @@ -433,7 +434,7 @@ quarkus.oidc.credentials.secret= === Twitch Create a https://dev.twitch.tv/console/apps[Twitch application]: - + image::oidc-twitch-1.png[role="thumb"] You can now configure your `application.properties`: @@ -486,7 +487,7 @@ For more information, see the Quarkus xref:security-openid-connect-multitenancy. Sometimes, only authenticating users with a social provider is not enough. A provider-specific service also needs to be accessed for the Quarkus OIDC `web-app` application to fetch or update data from the provider service on behalf of the currently authenticated user. -As mentioned in the xref:security-oidc-code-flow-authentication.adoc[OIDC code flow mechanism for protecting web applications] guide, ID and access tokens are returned after the authorization code flow has been completed, with some providers like `GitHub` returning an access token only. +As mentioned in the xref:security-oidc-code-flow-authentication.adoc[OIDC code flow mechanism for protecting web applications] guide, ID and access tokens are returned after the authorization code flow has been completed, with some providers like `GitHub` returning an access token only. It is this access token that has to be propagated to services such as `Google Calendar`, or `Spotify Playlists` for the currently authenticated user to be able to use such services. You do not have to bring provider-specific libraries in order to achieve this, but instead you can use a reactive `Token Propagation` filter, which can be bound to a given REST client with a simple annotation. diff --git a/docs/src/main/asciidoc/security-overview.adoc b/docs/src/main/asciidoc/security-overview.adoc index 35d946c403e09..fac303f37048c 100644 --- a/docs/src/main/asciidoc/security-overview.adoc +++ b/docs/src/main/asciidoc/security-overview.adoc @@ -1,3 +1,8 @@ +//// +This document is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc +//// [id="security-overview"] = Quarkus Security overview include::_attributes.adoc[] diff --git a/docs/src/main/asciidoc/security-testing.adoc b/docs/src/main/asciidoc/security-testing.adoc index b034619ddeba3..629f9f3cd8aab 100644 --- a/docs/src/main/asciidoc/security-testing.adoc +++ b/docs/src/main/asciidoc/security-testing.adoc @@ -4,7 +4,6 @@ and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Security Testing - include::_attributes.adoc[] This document describes how to test Quarkus Security. diff --git a/docs/src/main/asciidoc/smallrye-metrics.adoc b/docs/src/main/asciidoc/smallrye-metrics.adoc index 5ea8d492c0664..1ff12d3cbeadf 100644 --- a/docs/src/main/asciidoc/smallrye-metrics.adoc +++ b/docs/src/main/asciidoc/smallrye-metrics.adoc @@ -3,7 +3,6 @@ This guide is maintained in the main Quarkus repository and pull requests should be submitted there: https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// - = SmallRye Metrics :extension-status: deprecated include::_attributes.adoc[] @@ -177,7 +176,7 @@ The application will respond that 350 is not a prime number because it can be di curl localhost:8080/629521085409773 ---- + -The application will respond that 629521085409773 is a prime number. +The application will respond that 629521085409773 is a prime number. .. Perform additional calls with numbers of your choice. diff --git a/docs/src/main/asciidoc/stork-kubernetes.adoc b/docs/src/main/asciidoc/stork-kubernetes.adoc index dce9a2509f978..47d9cdd41b8ea 100644 --- a/docs/src/main/asciidoc/stork-kubernetes.adoc +++ b/docs/src/main/asciidoc/stork-kubernetes.adoc @@ -5,7 +5,6 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Using Stork with Kubernetes :extension-status: preview - include::_attributes.adoc[] This guide explains how to use Stork with Kubernetes for service discovery and load balancing. diff --git a/docs/src/main/asciidoc/stork-reference.adoc b/docs/src/main/asciidoc/stork-reference.adoc index 0b1b477171d26..b91c726ee0072 100644 --- a/docs/src/main/asciidoc/stork-reference.adoc +++ b/docs/src/main/asciidoc/stork-reference.adoc @@ -5,7 +5,6 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Stork Reference Guide :extension-status: preview - include::_attributes.adoc[] This guide is the companion from the xref:stork.adoc[Stork Getting Started Guide]. diff --git a/docs/src/main/asciidoc/stork.adoc b/docs/src/main/asciidoc/stork.adoc index b280b34f92bf0..daf837aa4c331 100644 --- a/docs/src/main/asciidoc/stork.adoc +++ b/docs/src/main/asciidoc/stork.adoc @@ -5,7 +5,6 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc //// = Getting Started with SmallRye Stork :extension-status: preview - include::_attributes.adoc[] The essence of distributed systems resides in the interaction between services. From cee49e5401b672d742b77d4bcbd5addca1bcc90c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 21:30:15 +0000 Subject: [PATCH 05/14] Bump org.eclipse.parsson:parsson from 1.1.2 to 1.1.4 Bumps [org.eclipse.parsson:parsson](https://github.com/eclipse-ee4j/parsson) from 1.1.2 to 1.1.4. - [Release notes](https://github.com/eclipse-ee4j/parsson/releases) - [Commits](https://github.com/eclipse-ee4j/parsson/compare/1.1.2...1.1.4) --- updated-dependencies: - dependency-name: org.eclipse.parsson:parsson dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (cherry picked from commit 53d22415acfaca3d08dc797bbf9718d27f1e37fe) --- bom/application/pom.xml | 2 +- independent-projects/resteasy-reactive/pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 833aed20699c3..163ea0fe39122 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -23,7 +23,7 @@ 3.1.3 1.3.2 1 - 1.1.2 + 1.1.4 2.1.4.Final 3.0.2.Final 6.2.5.Final diff --git a/independent-projects/resteasy-reactive/pom.xml b/independent-projects/resteasy-reactive/pom.xml index 31e5f43107569..9e817f06bca5e 100644 --- a/independent-projects/resteasy-reactive/pom.xml +++ b/independent-projects/resteasy-reactive/pom.xml @@ -40,8 +40,8 @@ 5.0.0 2.1.2 3.1.0 - 4.0.0 - 1.1.2 + 4.0.1 + 1.1.4 UTF-8 11 11 From 3a1f1f59826a4eee8ef05819b97615b5469dbf04 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 9 Oct 2023 14:02:58 +0300 Subject: [PATCH 06/14] Properly handle invalid response body errors in Reactive REST Client Fixes: #36257 (cherry picked from commit 7de4dccf0eeb8eb92b237a33d64781625d9a418f) --- .../handlers/ClientSendRequestHandler.java | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java index 21d2bb60df41b..28ac07b7dff50 100644 --- a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java +++ b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java @@ -320,22 +320,27 @@ public void handle(AsyncResult flushed) { new VertxClientInputStream(clientResponse, 100000, requestContext)); requestContext.resume(); } else { - clientResponse.bodyHandler(new Handler<>() { + clientResponse.body(new Handler<>() { @Override - public void handle(Buffer buffer) { - if (loggingScope != LoggingScope.NONE) { - clientLogger.logResponse(clientResponse, false); - } - try { - if (buffer.length() > 0) { - requestContext.setResponseEntityStream( - new ByteArrayInputStream(buffer.getBytes())); - } else { - requestContext.setResponseEntityStream(null); + public void handle(AsyncResult ar) { + if (ar.succeeded()) { + if (loggingScope != LoggingScope.NONE) { + clientLogger.logResponse(clientResponse, false); + } + Buffer buffer = ar.result(); + try { + if (buffer.length() > 0) { + requestContext.setResponseEntityStream( + new ByteArrayInputStream(buffer.getBytes())); + } else { + requestContext.setResponseEntityStream(null); + } + requestContext.resume(); + } catch (Throwable t) { + requestContext.resume(t); } - requestContext.resume(); - } catch (Throwable t) { - requestContext.resume(t); + } else { + requestContext.resume(ar.cause()); } } }); From 716c175943e922661fcfa72c75d5dc9325a519ee Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Tue, 10 Oct 2023 10:00:58 +0300 Subject: [PATCH 07/14] Fix issue in Java migration in dev-mode Fixes: #36299 (cherry picked from commit 7e23cf507d30cbd32e5aa65102d0fc519ab6264f) --- .../flyway/deployment/FlywayProcessor.java | 4 +- ...ExtensionWithJavaMigrationDevModeTest.java | 40 +++++++++++++++++++ ...nWithJavaMigrationDevModeTestEndpoint.java | 37 +++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayExtensionWithJavaMigrationDevModeTest.java create mode 100644 extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayExtensionWithJavaMigrationDevModeTestEndpoint.java diff --git a/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/deployment/FlywayProcessor.java b/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/deployment/FlywayProcessor.java index ecd2439175b89..91e602ab8bc5a 100644 --- a/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/deployment/FlywayProcessor.java +++ b/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/deployment/FlywayProcessor.java @@ -117,7 +117,9 @@ MigrationStateBuildItem build(BuildProducer resour Location applicationMigrationLocation = new Location(applicationMigration); String applicationMigrationPath = applicationMigrationLocation.getPath(); - if (applicationMigrationPath != null) { + if ((applicationMigrationPath != null) && + // we don't include .class files in the watched files because that messes up live reload + !applicationMigrationPath.endsWith(".class")) { hotDeploymentProducer.produce(new HotDeploymentWatchedFileBuildItem(applicationMigrationPath)); } } diff --git a/extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayExtensionWithJavaMigrationDevModeTest.java b/extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayExtensionWithJavaMigrationDevModeTest.java new file mode 100644 index 0000000000000..f011ca1c37f6c --- /dev/null +++ b/extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayExtensionWithJavaMigrationDevModeTest.java @@ -0,0 +1,40 @@ +package io.quarkus.flyway.test; + +import static io.restassured.RestAssured.get; +import static org.hamcrest.Matchers.is; + +import java.sql.SQLException; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import db.migration.V1_0_1__Update; +import db.migration.V1_0_2__Update; +import io.quarkus.test.QuarkusDevModeTest; + +public class FlywayExtensionWithJavaMigrationDevModeTest { + + @RegisterExtension + static final QuarkusDevModeTest config = new QuarkusDevModeTest() + .withApplicationRoot((jar) -> jar + .addClasses(V1_0_1__Update.class, V1_0_2__Update.class, + FlywayExtensionWithJavaMigrationDevModeTestEndpoint.class) + .addAsResource("db/migration/V1.0.0__Quarkus.sql") + .addAsResource("clean-and-migrate-at-start-config.properties", "application.properties")); + + @Test + public void test() throws SQLException { + get("/fly") + .then() + .statusCode(200) + .body(is("2/1.0.2")); + + config.modifySourceFile(FlywayExtensionWithJavaMigrationDevModeTestEndpoint.class, s -> s.replace("/fly", "/flyway")); + + get("/flyway") + .then() + .statusCode(200) + .body(is("2/1.0.2")); + } + +} diff --git a/extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayExtensionWithJavaMigrationDevModeTestEndpoint.java b/extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayExtensionWithJavaMigrationDevModeTestEndpoint.java new file mode 100644 index 0000000000000..d30349f0ded52 --- /dev/null +++ b/extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayExtensionWithJavaMigrationDevModeTestEndpoint.java @@ -0,0 +1,37 @@ +package io.quarkus.flyway.test; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.Statement; + +import jakarta.inject.Inject; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; + +import org.flywaydb.core.Flyway; + +import io.agroal.api.AgroalDataSource; + +@Path("/fly") +public class FlywayExtensionWithJavaMigrationDevModeTestEndpoint { + + @Inject + AgroalDataSource defaultDataSource; + + @Inject + Flyway flyway; + + @GET + public String result() throws Exception { + int count = 0; + try (Connection connection = defaultDataSource.getConnection(); Statement stat = connection.createStatement()) { + try (ResultSet countQuery = stat.executeQuery("select count(1) from quarked_flyway")) { + countQuery.first(); + count = countQuery.getInt(1); + } + } + String currentVersion = flyway.info().current().getVersion().toString(); + + return count + "/" + currentVersion; + } +} From 24f25abd8f95c0869b3131f42d4f60359f76d4b9 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Tue, 10 Oct 2023 13:23:31 +0300 Subject: [PATCH 08/14] Allow @ClientHeaderParam to override User-Agent Fixes: #36329 (cherry picked from commit 134f462dab8eba8f2a18d4e760f7ae169eb29240) --- .../reactive/headers/UserAgentTest.java | 25 +++++++++++++++++++ .../reactive/runtime/HeaderFillerUtil.java | 4 +++ .../client/impl/ClientBuilderImpl.java | 2 +- .../client/impl/RestClientRequestContext.java | 1 + 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/headers/UserAgentTest.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/headers/UserAgentTest.java index 7ea164cbc1fdc..6f85bd51de27f 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/headers/UserAgentTest.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/headers/UserAgentTest.java @@ -10,6 +10,7 @@ import jakarta.ws.rs.Path; import org.eclipse.microprofile.rest.client.RestClientBuilder; +import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -36,6 +37,18 @@ void testHeaderOverride() { assertThat(client.callWithUserAgent("custom-agent")).isEqualTo("custom-agent"); } + @Test + void testHeadersWithImplicitValue() { + ClientWithAnnotation client = RestClientBuilder.newBuilder().baseUri(baseUri).build(ClientWithAnnotation.class); + assertThat(client.callWithImplicitValue()).isEqualTo("Annotated"); + } + + @Test + void testHeadersWithExplicitValue() { + ClientWithAnnotation client = RestClientBuilder.newBuilder().baseUri(baseUri).build(ClientWithAnnotation.class); + assertThat(client.callWithExplicitValue("custom-agent")).isEqualTo("custom-agent"); + } + @Path("/") @ApplicationScoped public static class Resource { @@ -56,4 +69,16 @@ public interface Client { String callWithUserAgent(@HeaderParam("User-AgenT") String userAgent); } + @ClientHeaderParam(name = "User-Agent", value = "Annotated") + public interface ClientWithAnnotation { + + @Path("/") + @GET + String callWithImplicitValue(); + + @Path("/") + @GET + String callWithExplicitValue(@HeaderParam("User-Agent") String userAgent); + } + } diff --git a/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/HeaderFillerUtil.java b/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/HeaderFillerUtil.java index 632afb5cef99a..bebe8e1160a0c 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/HeaderFillerUtil.java +++ b/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/HeaderFillerUtil.java @@ -6,6 +6,8 @@ import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.MultivaluedMap; +import org.jboss.resteasy.reactive.client.impl.RestClientRequestContext; + @SuppressWarnings("unused") public final class HeaderFillerUtil { @@ -27,6 +29,8 @@ public static boolean shouldAddHeader(String name, MultivaluedMap Date: Wed, 6 Sep 2023 15:56:07 +0700 Subject: [PATCH 09/14] Default response content type using GraphQL spec Default response content type header should conform to [GraphQL over HTTP spec](https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md#serialization-format). (cherry picked from commit bff1fb7c2dab439245a9cf01619155e0c2ae7b8e) --- .../graphql/runtime/SmallRyeGraphQLExecutionHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java index dd39c64ce82bf..bb7618eaefc5d 100644 --- a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java +++ b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java @@ -46,7 +46,7 @@ public class SmallRyeGraphQLExecutionHandler extends SmallRyeGraphQLAbstractHand private static final String EXTENSIONS = "extensions"; private static final String APPLICATION_GRAPHQL = "application/graphql"; private static final String OK = "OK"; - private static final String DEFAULT_RESPONSE_CONTENT_TYPE = "application/graphql+json; charset=" + private static final String DEFAULT_RESPONSE_CONTENT_TYPE = "application/graphql-response+json; charset=" + StandardCharsets.UTF_8.name(); private static final String DEFAULT_REQUEST_CONTENT_TYPE = "application/json; charset=" + StandardCharsets.UTF_8.name(); From 363f45cd677c80bb171a846d827bdd7aa6f357e1 Mon Sep 17 00:00:00 2001 From: Jan Martiska Date: Fri, 6 Oct 2023 09:14:32 +0200 Subject: [PATCH 10/14] Accept requests that ask for application/graphql-response+json (cherry picked from commit 5550b704611ae29f4993682b2bcad8d497f6d5a0) --- .../graphql/runtime/SmallRyeGraphQLExecutionHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java index bb7618eaefc5d..d0ffbc1901c95 100644 --- a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java +++ b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java @@ -295,8 +295,9 @@ private static String getCharset(String mimeType) { } private boolean isValidAcceptRequest(String mimeType) { - // At this point we only accept two return mimeType.startsWith("application/json") + || mimeType.startsWith("application/graphql-response+json") + // application/graphql+json is incorrect, but we keep it for backwards compatibility || mimeType.startsWith("application/graphql+json"); } From 85200484ffbc880866d0fe31c0c440ce90849e1d Mon Sep 17 00:00:00 2001 From: Clement Escoffier Date: Tue, 10 Oct 2023 17:20:34 +0200 Subject: [PATCH 11/14] Update Netty to 4.1.100 Contains the fix for CVE-2023-44487. (cherry picked from commit e9a563fb17371d279074d29d08989727eb45318c) --- bom/application/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 163ea0fe39122..64362983f1ba9 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -142,7 +142,7 @@ 14.0.17.Final 4.6.5.Final 3.1.5 - 4.1.97.Final + 4.1.100.Final 1.12.0 1.0.4 3.5.3.Final From 607fbafb7db5b2abc2ba16c8d5c351a5eb81b516 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 11 Oct 2023 16:33:32 +0300 Subject: [PATCH 12/14] Ensure that SSE builder works in native Fixes: #36402 (cherry picked from commit 0b1a09b3d7ea53fbf29148025bceb5e69315df6e) --- .../quarkus/restclient/deployment/RestClientProcessor.java | 7 ++++++- .../reactive/deployment/JaxrsClientReactiveProcessor.java | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java b/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java index 500ac96e2c5c1..2cac5fa7164d7 100644 --- a/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java +++ b/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java @@ -19,6 +19,7 @@ import jakarta.ws.rs.client.ClientRequestFilter; import jakarta.ws.rs.client.ClientResponseFilter; import jakarta.ws.rs.ext.Providers; +import jakarta.ws.rs.sse.SseEventSource; import org.eclipse.microprofile.config.Config; import org.eclipse.microprofile.config.ConfigProvider; @@ -48,6 +49,7 @@ import org.jboss.resteasy.microprofile.client.RestClientProxy; import org.jboss.resteasy.microprofile.client.async.AsyncInterceptorRxInvokerProvider; import org.jboss.resteasy.microprofile.client.publisher.MpPublisherMessageBodyReader; +import org.jboss.resteasy.plugins.providers.sse.client.SseEventSourceImpl; import org.jboss.resteasy.spi.ResteasyConfiguration; import io.quarkus.arc.BeanDestroyer; @@ -122,8 +124,11 @@ void setupProviders(BuildProducer resources, } @BuildStep - void setupClientBuilder(BuildProducer resources) { + void setupClientBuilder(BuildProducer resources, + BuildProducer serviceProviders) { resources.produce(new NativeImageResourceBuildItem("META-INF/services/jakarta.ws.rs.client.ClientBuilder")); + serviceProviders.produce(new ServiceProviderBuildItem(SseEventSource.Builder.class.getName(), + SseEventSourceImpl.SourceBuilder.class.getName())); } @BuildStep diff --git a/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java b/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java index 4cecf9feab2e9..bd86f0b3c6a22 100644 --- a/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java +++ b/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java @@ -65,6 +65,7 @@ import jakarta.ws.rs.core.UriBuilder; import jakarta.ws.rs.ext.ParamConverter; import jakarta.ws.rs.ext.ParamConverterProvider; +import jakarta.ws.rs.sse.SseEventSource; import org.eclipse.microprofile.config.Config; import org.eclipse.microprofile.config.ConfigProvider; @@ -86,6 +87,7 @@ import org.jboss.resteasy.reactive.client.impl.ClientBuilderImpl; import org.jboss.resteasy.reactive.client.impl.ClientImpl; import org.jboss.resteasy.reactive.client.impl.MultiInvoker; +import org.jboss.resteasy.reactive.client.impl.SseEventSourceBuilderImpl; import org.jboss.resteasy.reactive.client.impl.StorkClientRequestFilter; import org.jboss.resteasy.reactive.client.impl.UniInvoker; import org.jboss.resteasy.reactive.client.impl.WebTargetImpl; @@ -226,6 +228,8 @@ void registerClientResponseBuilder(BuildProducer servi serviceProviders.produce(new ServiceProviderBuildItem(ClientBuilder.class.getName(), ClientBuilderImpl.class.getName())); + serviceProviders.produce(new ServiceProviderBuildItem(SseEventSource.Builder.class.getName(), + SseEventSourceBuilderImpl.class.getName())); } @BuildStep From cbd2c6e1f1054a29cd5149c3a6085847ddc02ffe Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 11 Oct 2023 11:28:47 +0200 Subject: [PATCH 13/14] IBM Db2 - Register resource bundle classes for reflection As usual with Db2, we are shooting in the dark a bit but it seems to solve the OP's issue. Fixes #36399 (cherry picked from commit 78d5bc37b579d2b8a0b1e0c6e65d45fe8a3b360c) --- .../jdbc/db2/deployment/JDBCDB2Processor.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java b/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java index fd03be59a5aed..107b700ca788b 100644 --- a/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java +++ b/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java @@ -1,5 +1,15 @@ package io.quarkus.jdbc.db2.deployment; +import com.ibm.db2.jcc.resources.ResourceKeys; +import com.ibm.db2.jcc.resources.Resources; +import com.ibm.db2.jcc.resources.SqljResources; +import com.ibm.db2.jcc.resources.T2uResourceKeys; +import com.ibm.db2.jcc.resources.T2uResources; +import com.ibm.db2.jcc.resources.T2zResourceKeys; +import com.ibm.db2.jcc.resources.T2zResources; +import com.ibm.db2.jcc.resources.T4ResourceKeys; +import com.ibm.db2.jcc.resources.T4Resources; + import io.quarkus.agroal.spi.JdbcDriverBuildItem; import io.quarkus.arc.deployment.AdditionalBeanBuildItem; import io.quarkus.arc.processor.BuiltinScope; @@ -55,12 +65,23 @@ void configureAgroalConnection(BuildProducer additional } @BuildStep - void registerDriverForReflection(BuildProducer reflectiveClass) { + void registerForReflection(BuildProducer reflectiveClass) { //Not strictly necessary when using Agroal, as it also registers //any JDBC driver being configured explicitly through its configuration. //We register it for the sake of people not using Agroal, //for example when the driver is used with OpenTelemetry JDBC instrumentation. reflectiveClass.produce(ReflectiveClassBuildItem.builder(DB2_DRIVER_CLASS).build()); + + // register resource bundles for reflection (they are apparently classes...) + reflectiveClass.produce(ReflectiveClassBuildItem.builder(Resources.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(ResourceKeys.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(SqljResources.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T2uResourceKeys.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T2uResources.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T2zResourceKeys.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T2zResources.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T4ResourceKeys.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T4Resources.class).build()); } @BuildStep From 3bbd07ecbcb102b979faa62c006f39accfdecd37 Mon Sep 17 00:00:00 2001 From: Roberto Cortez Date: Wed, 11 Oct 2023 10:41:12 +0100 Subject: [PATCH 14/14] Do not exclude properties from recording that are available in sources that should always be included (cherry picked from commit ee362078b89815efd86c7c87c66c247a6b0cec0f) --- .../BuildTimeConfigurationReader.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java b/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java index 326fd9c0b924a..2e6d5e4b0a1ca 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java @@ -1018,28 +1018,40 @@ private Converter getConverter(SmallRyeConfig config, Field field, ConverterT */ private Set getAllProperties(final Set registeredRoots) { Set properties = new HashSet<>(); + + // Get all properties, including the ones generated by interceptors, but these do not include profiles for (String property : config.getPropertyNames()) { properties.add(property); } + Set propertiesToRemove = new HashSet<>(); + Set propertiesToAdd = new HashSet<>(); + + // Get properties per source to collect profiled properties and exclude properties that are build related for (ConfigSource configSource : config.getConfigSources()) { if (configSource instanceof SysPropConfigSource || configSource instanceof EnvConfigSource || "PropertiesConfigSource[source=Build system]".equals(configSource.getName())) { for (String property : configSource.getPropertyNames()) { NameIterator ni = new NameIterator(property); if (ni.hasNext() && PropertiesUtil.isPropertyInRoot(registeredRoots, ni)) { - properties.add(property); + propertiesToAdd.add(property); } else { - properties.remove(property); + propertiesToRemove.add(property); if (configSource instanceof EnvConfigSource) { - properties.remove(StringUtil.toLowerCaseAndDotted(property)); + propertiesToRemove.add(StringUtil.toLowerCaseAndDotted(property)); } } } } else { - properties.addAll(configSource.getPropertyNames()); + propertiesToAdd.addAll(configSource.getPropertyNames()); } } + + // A property may exist in an excluded source and an include source. We don't have a way to know, so we + // just remove the excluded ones and add the ones to be included, so the property is back there again + properties.removeAll(propertiesToRemove); + properties.addAll(propertiesToAdd); + return properties; }