Skip to content

Commit bb797e2

Browse files
authored
Merge pull request #51479 from gsmet/3.30.3-backports-1
[3.30] 3.30.3 backports 1
2 parents 8fcbcdd + 9a71103 commit bb797e2

File tree

44 files changed

+819
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+819
-238
lines changed

bom/application/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@
109109
<slf4j-jboss-logmanager.version>2.0.2.Final</slf4j-jboss-logmanager.version>
110110
<wildfly-common.version>2.0.1</wildfly-common.version>
111111
<wildfly-client-config.version>1.0.1.Final</wildfly-client-config.version>
112-
<wildfly-elytron.version>2.7.0.Final</wildfly-elytron.version>
112+
<wildfly-elytron.version>2.7.1.Final</wildfly-elytron.version>
113113
<jboss-marshalling.version>2.2.3.Final</jboss-marshalling.version>
114114
<jboss-threads.version>3.9.1</jboss-threads.version>
115115
<vertx.version>4.5.22</vertx.version>
116116
<httpclient.version>4.5.14</httpclient.version>
117117
<httpcore.version>4.4.16</httpcore.version>
118118
<httpasync.version>4.1.5</httpasync.version>
119119
<cronutils.version>9.2.1</cronutils.version>
120-
<quartz.version>2.5.0</quartz.version>
120+
<quartz.version>2.5.2</quartz.version>
121121
<h2.version>2.4.240</h2.version> <!-- When updating, needs to be matched in io.quarkus.hibernate.orm.runtime.config.DialectVersions
122122
and the dependency jts-core needs to be updated in extensions/jdbc/jdbc-h2/runtime/pom.xml -->
123123
<postgresql-jdbc.version>42.7.8</postgresql-jdbc.version>
@@ -139,7 +139,7 @@
139139
<jboss-logging.version>3.6.1.Final</jboss-logging.version>
140140
<mutiny.version>3.0.3</mutiny.version>
141141
<jctools-core.version>4.0.5</jctools-core.version>
142-
<kafka3.version>4.0.1</kafka3.version>
142+
<kafka.version>4.1.1</kafka.version>
143143
<lz4.version>1.8.0</lz4.version> <!-- dependency of the kafka-clients that could be overridden by other imported BOMs in the platform -->
144144
<snappy.version>1.1.10.8</snappy.version>
145145
<strimzi-test-container.version>0.113.0</strimzi-test-container.version>
@@ -4561,7 +4561,7 @@
45614561
<dependency>
45624562
<groupId>org.apache.kafka</groupId>
45634563
<artifactId>kafka-clients</artifactId>
4564-
<version>${kafka3.version}</version>
4564+
<version>${kafka.version}</version>
45654565
</dependency>
45664566
<dependency>
45674567
<groupId>org.lz4</groupId>
@@ -4586,17 +4586,17 @@
45864586
<dependency>
45874587
<groupId>org.apache.kafka</groupId>
45884588
<artifactId>kafka-streams</artifactId>
4589-
<version>${kafka3.version}</version>
4589+
<version>${kafka.version}</version>
45904590
</dependency>
45914591
<dependency>
45924592
<groupId>org.apache.kafka</groupId>
45934593
<artifactId>kafka-streams-test-utils</artifactId>
4594-
<version>${kafka3.version}</version>
4594+
<version>${kafka.version}</version>
45954595
</dependency>
45964596
<dependency>
45974597
<groupId>org.apache.kafka</groupId>
45984598
<artifactId>kafka_2.13</artifactId>
4599-
<version>${kafka3.version}</version>
4599+
<version>${kafka.version}</version>
46004600
<exclusions>
46014601
<exclusion>
46024602
<groupId>com.google.code.findbugs</groupId>

build-parent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<junit4.version>4.13.2</junit4.version>
9898

9999
<!-- The image to use for tests that run Keycloak -->
100-
<keycloak.server.version>26.4.5</keycloak.server.version>
100+
<keycloak.server.version>26.4.7</keycloak.server.version>
101101
<keycloak.docker.image>quay.io/keycloak/keycloak:${keycloak.server.version}</keycloak.docker.image>
102102

103103
<unboundid-ldap.version>7.0.3</unboundid-ldap.version>

core/deployment/src/main/java/io/quarkus/deployment/DebugConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public interface DebugConfig {
2121

2222
/**
2323
* If set to true, writes a list of all reflective classes to META-INF
24+
* <p>
25+
* For fast-jar the META-INF is inside of quarkus-app/quarkus/generated-bytecode.jar
2426
*/
2527
@WithDefault("false")
2628
boolean reflection();

core/runtime/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
<runnerParentFirstArtifact>org.graalvm.sdk:jniutils</runnerParentFirstArtifact>
237237
<runnerParentFirstArtifact>org.graalvm.sdk:word</runnerParentFirstArtifact>
238238
<runnerParentFirstArtifact>org.graalvm.sdk:collections</runnerParentFirstArtifact>
239-
<runnerParentFirstArtifact>org.graalvm.sdk:native-bridge</runnerParentFirstArtifact>
239+
<runnerParentFirstArtifact>org.graalvm.sdk:nativebridge</runnerParentFirstArtifact>
240240
<!-- /support for GraalVM js -->
241241
<runnerParentFirstArtifact>io.quarkus:quarkus-bootstrap-runner</runnerParentFirstArtifact>
242242
<runnerParentFirstArtifact>io.quarkus:quarkus-classloader-commons</runnerParentFirstArtifact>

core/runtime/src/main/java/io/quarkus/runtime/logging/LogRuntimeConfig.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ public interface LogRuntimeConfig {
3939
* <p>
4040
* JBoss Logging supports Apache-style log levels:
4141
* <p>
42-
* * {@link org.jboss.logmanager.Level#FATAL}
43-
* * {@link org.jboss.logmanager.Level#ERROR}
44-
* * {@link org.jboss.logmanager.Level#WARN}
45-
* * {@link org.jboss.logmanager.Level#INFO}
46-
* * {@link org.jboss.logmanager.Level#DEBUG}
47-
* * {@link org.jboss.logmanager.Level#TRACE}
42+
* <ul>
43+
* <li>{@link org.jboss.logmanager.Level#FATAL}</li>
44+
* <li>{@link org.jboss.logmanager.Level#ERROR}</li>
45+
* <li>{@link org.jboss.logmanager.Level#WARN}</li>
46+
* <li>{@link org.jboss.logmanager.Level#INFO}</li>
47+
* <li>{@link org.jboss.logmanager.Level#DEBUG}</li>
48+
* <li>{@link org.jboss.logmanager.Level#TRACE}</li>
49+
* </ul>
4850
*
4951
* In addition, it also supports the standard JDK log levels.
50-
*
51-
* @asciidoclet
5252
*/
5353
@WithDefault("INFO")
5454
@WithConverter(LevelConverter.class)

devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/QuarkusPlugin.java

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.nio.file.Path;
88
import java.util.HashMap;
99
import java.util.HashSet;
10-
import java.util.List;
1110
import java.util.Map;
1211
import java.util.Optional;
1312
import java.util.Set;
@@ -474,7 +473,7 @@ public boolean isSatisfiedBy(Task t) {
474473
// add the code gen sources
475474
final SourceSet generatedSourceSet = sourceSets
476475
.getByName(QuarkusGenerateCode.QUARKUS_GENERATED_SOURCES);
477-
addCodeGenSourceDirs(compileJava, generatedSourceSet, quarkusExt);
476+
addCodeGenSourceDirs(compileJava, generatedSourceSet);
478477
// quarkusGenerateCode is a dependency
479478
compileJava.dependsOn(quarkusGenerateCode);
480479
// quarkusGenerateCodeDev must run before compileJava in case quarkusDev is the target
@@ -495,7 +494,7 @@ public boolean isSatisfiedBy(Task t) {
495494
// add the code gen test sources
496495
final SourceSet generatedSourceSet = sourceSets
497496
.getByName(QuarkusGenerateCode.QUARKUS_TEST_GENERATED_SOURCES);
498-
addCodeGenSourceDirs(compileTestJava, generatedSourceSet, quarkusExt);
497+
addCodeGenSourceDirs(compileTestJava, generatedSourceSet);
499498
compileTestJava.dependsOn(quarkusGenerateCode, quarkusGenerateCodeTests);
500499
if (tasks.contains(new NamedImpl(generatedSourceSet.getCompileJavaTaskName()))) {
501500
compileTestJava.mustRunAfter(tasks.named(generatedSourceSet.getCompileJavaTaskName()));
@@ -511,7 +510,7 @@ public boolean isSatisfiedBy(Task t) {
511510
tasks.named("compileKotlin", task -> {
512511
final SourceSet generatedSourceSet = project.getExtensions().getByType(SourceSetContainer.class)
513512
.getByName(QuarkusGenerateCode.QUARKUS_GENERATED_SOURCES);
514-
addCodeGenSourceDirs(task, generatedSourceSet, quarkusExt);
513+
addCodeGenSourceDirs(task, generatedSourceSet);
515514
task.dependsOn(quarkusGenerateCode);
516515
task.mustRunAfter(quarkusGenerateCodeDev);
517516
if (tasks.contains(new NamedImpl(generatedSourceSet.getCompileJavaTaskName()))) {
@@ -525,7 +524,7 @@ public boolean isSatisfiedBy(Task t) {
525524
tasks.named("compileTestKotlin", task -> {
526525
final SourceSet generatedSourceSet = project.getExtensions().getByType(SourceSetContainer.class)
527526
.getByName(QuarkusGenerateCode.QUARKUS_TEST_GENERATED_SOURCES);
528-
addCodeGenSourceDirs(task, generatedSourceSet, quarkusExt);
527+
addCodeGenSourceDirs(task, generatedSourceSet);
529528
task.dependsOn(quarkusGenerateCodeTests);
530529
if (tasks.contains(new NamedImpl(generatedSourceSet.getCompileJavaTaskName()))) {
531530
task.mustRunAfter(tasks.named(generatedSourceSet.getCompileJavaTaskName()));
@@ -538,22 +537,14 @@ public boolean isSatisfiedBy(Task t) {
538537
});
539538
}
540539

541-
private static void addCodeGenSourceDirs(JavaCompile compileJava, SourceSet generatedSourceSet,
542-
QuarkusPluginExtension quarkusExt) {
540+
private static void addCodeGenSourceDirs(JavaCompile compileJava, SourceSet generatedSourceSet) {
543541
final File baseDir = generatedSourceSet.getJava().getClassesDirectory().get().getAsFile();
544-
for (String provider : quarkusExt.getCodeGenerationProviders().get()) {
545-
compileJava.source(new File(baseDir, provider));
546-
}
542+
compileJava.source(baseDir);
547543
}
548544

549-
private static void addCodeGenSourceDirs(Task compileKotlin, SourceSet generatedSourceSet,
550-
QuarkusPluginExtension quarkusExt) {
545+
private static void addCodeGenSourceDirs(Task compileKotlin, SourceSet generatedSourceSet) {
551546
final File baseDir = generatedSourceSet.getJava().getClassesDirectory().get().getAsFile();
552-
final List<String> codeGenProviders = quarkusExt.getCodeGenerationProviders().get();
553-
final Object[] codeGenDirs = new Object[codeGenProviders.size()];
554-
for (int i = 0; i < codeGenDirs.length; ++i) {
555-
codeGenDirs[i] = new File(baseDir, codeGenProviders.get(i));
556-
}
547+
final Object[] codeGenDirs = new Object[] { baseDir };
557548
try {
558549
var sourcesMethod = compileKotlin.getClass().getMethod("source", Object[].class);
559550
sourcesMethod.invoke(compileKotlin, new Object[] { codeGenDirs });

devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/lgtm-codestart/java/src/test/java/org/acme/SimpleTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.acme;
22

3-
import org.eclipse.microprofile.config.inject.ConfigProperty;;
3+
import org.eclipse.microprofile.config.inject.ConfigProperty;
44
import org.jboss.logging.Logger;
55
import org.junit.jupiter.api.Test;
66
import org.junit.jupiter.api.condition.DisabledOnOs;

docs/src/main/asciidoc/cdi.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,8 @@ import jakarta.decorator.Delegate;
443443
import jakarta.annotation.Priority;
444444
import jakarta.inject.Inject;
445445
import jakarta.enterprise.inject.Any;
446+
import jakarta.enterprise.inject.Decorated;
447+
import jakarta.enterprise.inject.spi.Bean;
446448

447449
public interface Account {
448450
void withdraw(BigDecimal amount);
@@ -461,7 +463,6 @@ public class LargeTxAccount implements Account { <3>
461463
@Decorated
462464
Bean<Account> delegateInfo; <5>
463465

464-
465466
@Inject
466467
LogService logService; <6>
467468

docs/src/main/asciidoc/rest-client.adoc

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,9 @@ public class TestClientRequestFilter implements ResteasyReactiveClientRequestFil
13411341
}
13421342
----
13431343

1344-
== Customizing the ObjectMapper in REST Client Jackson
1344+
== Jackson-specific features
1345+
1346+
=== Customizing the ObjectMapper in REST Client Jackson
13451347

13461348
The REST Client supports adding a custom ObjectMapper to be used only the Client using the annotation `@ClientObjectMapper`.
13471349

@@ -1369,6 +1371,60 @@ public interface ExtensionsService {
13691371
<2> It's must be a static method. Also, the parameter `defaultObjectMapper` will be resolved via CDI. If not found, it will throw an exception at runtime.
13701372
<3> In this example, we're creating a copy of the default object mapper. You should *NEVER* modify the default object mapper, but create a copy instead.
13711373

1374+
=== @JsonView support
1375+
1376+
Jakarta REST methods can be annotated with https://fasterxml.github.io/jackson-annotations/javadoc/2.10/com/fasterxml/jackson/annotation/JsonView.html[@JsonView]
1377+
in order to customize the serialization of the returned POJO, on a per method-basis. This is best explained with an example.
1378+
1379+
A typical use of `@JsonView` is to hide certain fields on certain methods. In that vein, let's define two views:
1380+
1381+
[source,java]
1382+
----
1383+
public class Views {
1384+
1385+
public static class Public {
1386+
}
1387+
1388+
public static class Private extends Public {
1389+
}
1390+
}
1391+
----
1392+
1393+
Let's assume we have the `User` POJO on which we want to hide some field during serialization. A simple example of this is:
1394+
1395+
[source,java]
1396+
----
1397+
public class User {
1398+
1399+
@JsonView(Views.Private.class)
1400+
public int id;
1401+
1402+
@JsonView(Views.Public.class)
1403+
public String name;
1404+
}
1405+
----
1406+
1407+
The REST Client supports `@JsonView` both for sending content to the REST API and for retrieving data from it:
1408+
1409+
[source,java]
1410+
----
1411+
@Path("/users")
1412+
@RegisterRestClient
1413+
public interface UserClient {
1414+
@GET
1415+
@Path("/{id}")
1416+
@Produces(MediaType.APPLICATION_JSON)
1417+
@JsonView(Views.Public.class)
1418+
User get(@RestPath String id);
1419+
1420+
@POST
1421+
@Consumes(MediaType.APPLICATION_JSON)
1422+
Response create(@JsonView(Views.Public.class) User user);
1423+
}
1424+
----
1425+
1426+
In the preceding code, the `get` method would return a `User` whose `id` is always `null` while the `create` method would never include `id` in the JSON it sends to the REST API.
1427+
13721428
== Exception handling
13731429

13741430
The MicroProfile REST Client specification introduces the `org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper` whose purpose is to convert an HTTP response to an exception.

docs/src/main/asciidoc/security-cors.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ The filter then adds CORS headers to the HTTP response, informing browsers about
3434
For preflight requests, the filter returns an HTTP response immediately.
3535
For regular CORS requests, the filter denies access with an HTTP 403 status if the request violates the configured policy; otherwise, the filter forwards the request to the destination if the policy allows it.
3636

37+
[NOTE]
38+
====
39+
Despite its name the CORS filter may also prevent CSRF attacks based on link:https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#using-standard-headers-to-verify-origin[Origin verification].
40+
Therefore, since an [Origin](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Origin) header is expected to be set by the browser for cross-origin JavaScript and HTML form requests, you may want to consider using it instead of the xref:security-csrf-prevention.adoc[REST CSRF filter].
41+
42+
You must confirm that the browser does set an `Origin` header for cross-origin requests when accessing your application, especially with HTML forms, before using the CORS filter to prevent CSRF with the link:https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#using-standard-headers-to-verify-origin[Origin verification].
43+
====
44+
3745
For detailed configuration options, see the following Configuration Properties section.
3846

3947
include::{generated-dir}/config/quarkus-vertx-http_quarkus.http.cors.adoc[leveloffset=+1, opts=optional]

0 commit comments

Comments
 (0)