Skip to content

Commit

Permalink
Merge pull request #41798 from gsmet/3.12.2-backports-1
Browse files Browse the repository at this point in the history
[3.12] 3.12.2 backports 1
  • Loading branch information
gsmet authored Jul 10, 2024
2 parents 08f02f0 + fa9a9ca commit 5c7542e
Show file tree
Hide file tree
Showing 67 changed files with 564 additions and 164 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ updates:
- dependency-name: biz.paluch.logging:logstash-gelf
- dependency-name: org.bitbucket.b_c:jose4j
- dependency-name: io.fabric8:maven-model-helper
- dependency-name: org.codejive:java-properties
ignore:
# this one cannot be upgraded due to the usage of proxies in new versions
# the proxy implements interfaces in a random order which causes issues
Expand Down
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<extension>
<groupId>io.quarkus.develocity</groupId>
<artifactId>quarkus-project-develocity-extension</artifactId>
<version>1.1.1</version>
<version>1.1.3</version>
</extension>
</extensions>
4 changes: 2 additions & 2 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@
<!-- GraalVM sdk 23.1.2 has a minimum JDK requirement of 17+ at runtime -->
<graal-sdk.version>23.1.2</graal-sdk.version>
<gizmo.version>1.8.0</gizmo.version>
<jackson-bom.version>2.17.1</jackson-bom.version>
<jackson-bom.version>2.17.2</jackson-bom.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<commons-codec.version>1.17.0</commons-codec.version>
<classmate.version>1.7.0</classmate.version>
<!-- See root POM for hibernate-orm.version, hibernate-reactive.version, hibernate-validator.version,
hibernate-search.version, antlr.version, bytebuddy.version, hibernate-commons-annotations.version -->
<narayana.version>7.0.1.Final</narayana.version>
<narayana.version>7.0.2.Final</narayana.version>
<agroal.version>2.4</agroal.version>
<jboss-transaction-spi.version>8.0.0.Final</jboss-transaction-spi.version>
<elasticsearch-opensource-components.version>8.14.0</elasticsearch-opensource-components.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ public Iterable<? extends JavaFileObject> getJavaSources(Iterable<? extends File
@Override
public JavaFileObject getJavaFileForInput(Location location, String className, JavaFileObject.Kind kind)
throws IOException {
JavaFileObject file = this.fileManager.getJavaFileForInput(location, className, kind);
// Ignore the module info of the application in dev mode.
if (context.ignoreModuleInfo() && "CLASS_OUTPUT".equalsIgnoreCase(location.getName())
if (file != null && context.ignoreModuleInfo() && "CLASS_OUTPUT".equalsIgnoreCase(location.getName())
&& "module-info".equalsIgnoreCase(className)) {
if (once.compareAndSet(false, true)) {
Logger.getLogger(StaticFileManager.class).info("Ignoring module-info.java in dev mode, " +
"set the `quarkus.live-reload.ignore-module-info` property to `false` in your project descriptor (`pom.xml` or `build.gradle`) to disable this behavior.");
}
return null;
}
return this.fileManager.getJavaFileForInput(location, className, kind);
return file;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1235,9 +1235,16 @@ public void prepare(MethodContext context) {
public void handle(MethodContext context, MethodCreator method,
DeferredArrayStoreParameter out) {
//get the collection
ResultHandle prop = method.invokeVirtualMethod(
MethodDescriptor.ofMethod(i.getReadMethod()),
context.loadDeferred(out));
ResultHandle prop;
if (i.getReadMethod().isDefault()) {
prop = method.invokeInterfaceMethod(
MethodDescriptor.ofMethod(i.getReadMethod()),
context.loadDeferred(out));
} else {
prop = method.invokeVirtualMethod(
MethodDescriptor.ofMethod(i.getReadMethod()),
context.loadDeferred(out));
}
for (DeferredParameter i : params) {
//add the parameter
//TODO: this is not guarded against large collections, probably not an issue in practice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ void reinitHostNameUtil(BuildProducer<RuntimeReinitializedClassBuildItem> runtim
// so we reinitialize this to re-compute the field (and other related fields) during native application's
// runtime
runtimeReInitClass.produce(new RuntimeReinitializedClassBuildItem("org.wildfly.common.net.HostName"));
runtimeReInitClass.produce(new RuntimeReinitializedClassBuildItem("io.smallrye.common.net.HostName"));
}

private Boolean isSslNativeEnabled(SslNativeConfigBuildItem sslNativeConfig,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/cdi-integration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ IMPORTANT: It is not possible to conditionally enable/disable additional beans v
----
@BuildStep
AdditionalBeanBuildItem additionalBeans() {
return new AdditionalBeanBuildItem(SmallRyeHealthReporter.class, HealthServlet.class)); <1>
return new AdditionalBeanBuildItem(SmallRyeHealthReporter.class, HealthServlet.class); <1>
}
----
<1> `AdditionalBeanBuildItem.Builder` can be used for more complex use cases.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/security-customization.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ The observers can be either synchronous or asynchronous.
* `io.quarkus.oidc.SecurityEvent`
* `io.quarkus.vertx.http.runtime.security.FormAuthenticationEvent`

[[TIP]]
[TIP]
For more information about security events specific to the Quarkus OpenID Connect extension, please see
the xref:security-oidc-code-flow-authentication.adoc#listen-to-authentication-events[Listening to important authentication events]
section of the OIDC code flow mechanism for protecting web applications guide.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ To start a Keycloak server, use the following Docker command:
docker run --name keycloak -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin -p 8543:8443 -v "$(pwd)"/config/keycloak-keystore.jks:/etc/keycloak-keystore.jks quay.io/keycloak/keycloak:{keycloak.version} start --hostname-strict=false --https-key-store-file=/etc/keycloak-keystore.jks
----
where `keycloak.version` must be `23.0.0` or later and the `keycloak-keystore.jks` can be found in https://github.com/quarkusio/quarkus-quickstarts/blob/main/security-keycloak-authorization-quickstart/config/keycloak-keystore.jks[quarkus-quickstarts/security-keycloak-authorization-quickstart/config].
where `keycloak.version` must be `25.0.0` or later and the `keycloak-keystore.jks` can be found in https://github.com/quarkusio/quarkus-quickstarts/blob/main/security-keycloak-authorization-quickstart/config/keycloak-keystore.jks[quarkus-quickstarts/security-keycloak-authorization-quickstart/config].
Try to access your Keycloak server at https://localhost:8543[localhost:8543].
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/security-oidc-auth0-tutorial.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ quarkus.oidc.auth-server-url=https://dev-3ve0cgn7.us.auth0.com

which is all what is needed for the OIDC `service` application to fetch Auth0 public verification keys and use them to verify Auth0 access tokens in JWT format.

[[NOTE]]
[NOTE]
====
In this tutorial you have already configured the OIDC `hybrid` application which can handle both authorization code and bearer token authentication flows. In production you will run microservices as separate servers but for the sake of simplicity `ApiEchoService` will not have to be started as a second server with its own configuration containing `quarkus.oidc.auth-server-url=https://dev-3ve0cgn7.us.auth0.com` only, and therefore the current configuration which already has the Auth0 dev tenant address configured will be reused.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ For more information, see the <<keycloak-dev-mode>> section.
docker run --name keycloak -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin -p 8180:8080 quay.io/keycloak/keycloak:{keycloak.version} start-dev
----
====
* Where the `keycloak.version` is set to version `23.0.0` or later.
* Where the `keycloak.version` is set to version `25.0.0` or later.
. You can access your Keycloak server at http://localhost:8180[localhost:8180].
. To access the Keycloak Administration console, log in as the `admin` user by using the following login credentials:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ To start a Keycloak server, use Docker and run the following command:
docker run --name keycloak -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin -p 8180:8080 quay.io/keycloak/keycloak:{keycloak.version} start-dev
----

where `keycloak.version` is set to `23.0.0` or later.
where `keycloak.version` is set to `25.0.0` or later.

You can access your Keycloak Server at http://localhost:8180[localhost:8180].

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/security-openid-connect-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ To start a Keycloak Server, you can use Docker and just run the following comman
docker run --name keycloak -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin -p 8180:8080 quay.io/keycloak/keycloak:{keycloak.version} start-dev
----

Set `{keycloak.version}` to `23.0.0` or later.
Set `{keycloak.version}` to `25.0.0` or later.

You can access your Keycloak Server at http://localhost:8180[localhost:8180].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ To start a Keycloak server, you can use Docker and run the following command:
docker run --name keycloak -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin -p 8180:8080 quay.io/keycloak/keycloak:{keycloak.version} start-dev
----

where `keycloak.version` is set to `23.0.0` or higher.
where `keycloak.version` is set to `25.0.0` or higher.

Access your Keycloak server at http://localhost:8180[localhost:8180].

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/telemetry-micrometer.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Given the following declaration of a timer: `registry.timer("http.server.request
=== Define dimensions for aggregation

Metrics, single numerical measurements, often have additional data captured with them. This ancillary data is used to group or aggregate metrics for analysis.
The Micrometer API refers to this dimensional data as tags, but you may it referred to as "labels" or "attributes" in other documentation sources.
The Micrometer API refers to this dimensional data as tags, but you may see it referred to as "labels" or "attributes" in other documentation sources.

Micrometer is built primariliy for backend monitoring systems that support dimensional data (metric names that are enchriched with key/value pairs).
For heirarchical systems that only support a flat metric name, Micrometer will flatten the set of key/value pairs (sorted by key) and add them to the name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ private static String rewriteContent(String fileName,
addError(errors, fileName, "Unable to find title for: " + mr.group() + " [" + reference + "]");
title = "~~ unknown title ~~";
}
return "xref:" + trimReference(mr.group(1)) + "[" + title.trim() + "]";
return "xref:" + trimReference(mr.group(1)) + "[" + escapeXrefTitleForReplaceAll(title) + "]";
});

content = ANGLE_BRACKETS_WITHOUT_DESCRIPTION_PATTERN.matcher(content).replaceAll(mr -> {
Expand All @@ -436,11 +436,11 @@ private static String rewriteContent(String fileName,
addError(errors, fileName, "Unable to find title for: " + mr.group() + " [" + reference + "]");
title = "~~ unknown title ~~";
}
return "xref:" + trimReference(mr.group(1)) + "[" + title.trim() + "]";
return "xref:" + trimReference(mr.group(1)) + "[" + escapeXrefTitleForReplaceAll(title) + "]";
});

content = ANGLE_BRACKETS_WITH_DESCRIPTION_PATTERN.matcher(content).replaceAll(mr -> {
return "xref:" + trimReference(mr.group(1)) + "[" + mr.group(2).trim() + "]";
return "xref:" + trimReference(mr.group(1)) + "[" + escapeXrefTitleForReplaceAll(mr.group(2)) + "]";
});

content = XREF_GUIDE_PATTERN.matcher(content).replaceAll(mr -> {
Expand All @@ -466,6 +466,10 @@ private static String rewriteContent(String fileName,
return content;
}

private static String escapeXrefTitleForReplaceAll(String title) {
return title.trim().replace("]", "\\\\]");
}

private static String trimReference(String reference) {
reference = normalizeAdoc(reference);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Gradle properties
#Tue Mar 17 10:20:48 UTC 2020
# Gradle properties

quarkusPluginVersion=${project.version}
quarkusPlatformArtifactId=quarkus-bom
quarkusPlatformVersion=${project.version}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.quarkus.cache.runtime;

import java.time.Duration;
import java.util.concurrent.Executor;
import java.util.function.Function;
import java.util.function.Supplier;

Expand All @@ -17,10 +16,6 @@
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.TimeoutException;
import io.smallrye.mutiny.Uni;
import io.vertx.core.Context;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.impl.ContextInternal;

@CacheResult(cacheName = "") // The `cacheName` attribute is @Nonbinding.
@Interceptor
Expand Down Expand Up @@ -58,7 +53,6 @@ public Object intercept(InvocationContext invocationContext) throws Throwable {
try {
ReturnType returnType = determineReturnType(invocationContext.getMethod().getReturnType());
if (returnType != ReturnType.NonAsync) {
Context context = Vertx.currentContext();
Uni<Object> cacheValue = cache.getAsync(key, new Function<Object, Uni<Object>>() {
@SuppressWarnings("unchecked")
@Override
Expand All @@ -76,48 +70,6 @@ public Uni<Object> apply(Object key) {
public Uni<?> apply(Throwable throwable) {
return cache.invalidate(key).replaceWith(throwable);
}
}).emitOn(new Executor() {
// We need make sure we go back to the original context when the cache value is computed.
// Otherwise, we would always emit on the context having computed the value, which could
// break the duplicated context isolation.
@Override
public void execute(Runnable command) {
Context ctx = Vertx.currentContext();
if (context == null) {
// We didn't capture a context
if (ctx == null) {
// We are not on a context => we can execute immediately.
command.run();
} else {
// We are on a context.
// We cannot continue on the current context as we may share a duplicated context.
// We need a new one. Note that duplicate() does not duplicate the duplicated context,
// but the root context.
((ContextInternal) ctx).duplicate()
.runOnContext(new Handler<Void>() {
@Override
public void handle(Void ignored) {
command.run();
}
});
}
} else {
// We captured a context.
if (ctx == context) {
// We are on the same context => we can execute immediately
command.run();
} else {
// 1) We are not on a context (ctx == null) => we need to switch to the captured context.
// 2) We are on a different context (ctx != null) => we need to switch to the captured context.
context.runOnContext(new Handler<Void>() {
@Override
public void handle(Void ignored) {
command.run();
}
});
}
}
}
});

if (binding.lockTimeout() <= 0) {
Expand Down
Loading

0 comments on commit 5c7542e

Please sign in to comment.