Skip to content

Commit 53e3612

Browse files
committed
Sync documentation of main branch
1 parent 6a7194d commit 53e3612

7 files changed

+98
-10
lines changed

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

+17
Original file line numberDiff line numberDiff line change
@@ -76499,6 +76499,23 @@ h|[.extension-name]##WebSockets Next##
7649976499
h|Type
7650076500
h|Default
7650176501

76502+
a|icon:lock[title=Fixed at build time] [[quarkus-websockets-next_quarkus-websockets-next-server-activate-request-context]] [.property-path]##link:#quarkus-websockets-next_quarkus-websockets-next-server-activate-request-context[`quarkus.websockets-next.server.activate-request-context`]##
76503+
76504+
[.description]
76505+
--
76506+
Specifies whether to activate the CDI request context when an endpoint callback is invoked. By default, the request context is only activated if needed.
76507+
76508+
76509+
ifdef::add-copy-button-to-env-var[]
76510+
Environment variable: env_var_with_copy_button:+++QUARKUS_WEBSOCKETS_NEXT_SERVER_ACTIVATE_REQUEST_CONTEXT+++[]
76511+
endif::add-copy-button-to-env-var[]
76512+
ifndef::add-copy-button-to-env-var[]
76513+
Environment variable: `+++QUARKUS_WEBSOCKETS_NEXT_SERVER_ACTIVATE_REQUEST_CONTEXT+++`
76514+
endif::add-copy-button-to-env-var[]
76515+
--
76516+
a|tooltip:auto[The request context is only activated if needed, i.e. if there is a request scoped bean , or a bean annotated with a security annotation (such as `@RolesAllowed`) in the dependency tree of the endpoint.], tooltip:always[The request context is always activated.]
76517+
|tooltip:auto[The request context is only activated if needed, i.e. if there is a request scoped bean , or a bean annotated with a security annotation (such as {@code @RolesAllowed}) in the dependency tree of the endpoint.]
76518+
7650276519
a| [[quarkus-websockets-next_quarkus-websockets-next-client-offer-per-message-compression]] [.property-path]##link:#quarkus-websockets-next_quarkus-websockets-next-client-offer-per-message-compression[`quarkus.websockets-next.client.offer-per-message-compression`]##
7650376520

7650476521
[.description]

_generated-doc/main/config/quarkus-websockets-next.adoc

+17
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ h|[.header-title]##Configuration property##
77
h|Type
88
h|Default
99

10+
a|icon:lock[title=Fixed at build time] [[quarkus-websockets-next_quarkus-websockets-next-server-activate-request-context]] [.property-path]##link:#quarkus-websockets-next_quarkus-websockets-next-server-activate-request-context[`quarkus.websockets-next.server.activate-request-context`]##
11+
12+
[.description]
13+
--
14+
Specifies whether to activate the CDI request context when an endpoint callback is invoked. By default, the request context is only activated if needed.
15+
16+
17+
ifdef::add-copy-button-to-env-var[]
18+
Environment variable: env_var_with_copy_button:+++QUARKUS_WEBSOCKETS_NEXT_SERVER_ACTIVATE_REQUEST_CONTEXT+++[]
19+
endif::add-copy-button-to-env-var[]
20+
ifndef::add-copy-button-to-env-var[]
21+
Environment variable: `+++QUARKUS_WEBSOCKETS_NEXT_SERVER_ACTIVATE_REQUEST_CONTEXT+++`
22+
endif::add-copy-button-to-env-var[]
23+
--
24+
a|tooltip:auto[The request context is only activated if needed, i.e. if there is a request scoped bean , or a bean annotated with a security annotation (such as `@RolesAllowed`) in the dependency tree of the endpoint.], tooltip:always[The request context is always activated.]
25+
|tooltip:auto[The request context is only activated if needed, i.e. if there is a request scoped bean , or a bean annotated with a security annotation (such as {@code @RolesAllowed}) in the dependency tree of the endpoint.]
26+
1027
a| [[quarkus-websockets-next_quarkus-websockets-next-client-offer-per-message-compression]] [.property-path]##link:#quarkus-websockets-next_quarkus-websockets-next-client-offer-per-message-compression[`quarkus.websockets-next.client.offer-per-message-compression`]##
1128

1229
[.description]

_generated-doc/main/config/quarkus-websockets-next_quarkus.websockets-next.adoc

+17
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ h|[.header-title]##Configuration property##
77
h|Type
88
h|Default
99

10+
a|icon:lock[title=Fixed at build time] [[quarkus-websockets-next_quarkus-websockets-next-server-activate-request-context]] [.property-path]##link:#quarkus-websockets-next_quarkus-websockets-next-server-activate-request-context[`quarkus.websockets-next.server.activate-request-context`]##
11+
12+
[.description]
13+
--
14+
Specifies whether to activate the CDI request context when an endpoint callback is invoked. By default, the request context is only activated if needed.
15+
16+
17+
ifdef::add-copy-button-to-env-var[]
18+
Environment variable: env_var_with_copy_button:+++QUARKUS_WEBSOCKETS_NEXT_SERVER_ACTIVATE_REQUEST_CONTEXT+++[]
19+
endif::add-copy-button-to-env-var[]
20+
ifndef::add-copy-button-to-env-var[]
21+
Environment variable: `+++QUARKUS_WEBSOCKETS_NEXT_SERVER_ACTIVATE_REQUEST_CONTEXT+++`
22+
endif::add-copy-button-to-env-var[]
23+
--
24+
a|tooltip:auto[The request context is only activated if needed, i.e. if there is a request scoped bean , or a bean annotated with a security annotation (such as `@RolesAllowed`) in the dependency tree of the endpoint.], tooltip:always[The request context is always activated.]
25+
|tooltip:auto[The request context is only activated if needed, i.e. if there is a request scoped bean , or a bean annotated with a security annotation (such as {@code @RolesAllowed}) in the dependency tree of the endpoint.]
26+
1027
a| [[quarkus-websockets-next_quarkus-websockets-next-client-offer-per-message-compression]] [.property-path]##link:#quarkus-websockets-next_quarkus-websockets-next-client-offer-per-message-compression[`quarkus.websockets-next.client.offer-per-message-compression`]##
1128

1229
[.description]

_versions/main/guides/deploying-to-google-cloud.adoc

+8-1
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,20 @@ WARNING: This only works when your application is running inside a Google Cloud
291291

292292
=== Using Cloud SQL with native executables
293293

294-
When generating native executables, you must also mark `jnr.ffi.provider.jffi.NativeFinalizer$SingletonHolder` as runtime initialized.
294+
When generating native executables, you must mark `jnr.ffi.provider.jffi.NativeFinalizer$SingletonHolder` as runtime initialized.
295295

296296
[source,properties]
297297
----
298298
quarkus.native.additional-build-args=--initialize-at-run-time=jnr.ffi.provider.jffi.NativeFinalizer$SingletonHolder
299299
----
300300

301+
Additionally, starting with `com.google.cloud.sql:postgres-socket-factory:1.17.0`, you must also mark `com.kenai.jffi.internal.Cleaner` as runtime initialized.
302+
303+
[source,properties]
304+
----
305+
quarkus.native.additional-build-args=--initialize-at-run-time=jnr.ffi.provider.jffi.NativeFinalizer$SingletonHolder\\,com.kenai.jffi.internal.Cleaner
306+
----
307+
301308
== Going further
302309

303310
You can find a set of extensions to access various Google Cloud Services in the Quarkiverse (a GitHub organization for Quarkus extensions maintained by the community),

_versions/main/guides/grpc-service-implementation.adoc

+25-6
Original file line numberDiff line numberDiff line change
@@ -521,29 +521,48 @@ quarkus.http.auth.basic=true <1>
521521
----
522522
package org.acme.grpc.auth;
523523
524-
import static org.assertj.core.api.Assertions.assertThat;
524+
import static org.hamcrest.MatcherAssert.assertThat;
525+
import static org.hamcrest.Matchers.is;
525526
527+
import org.acme.proto.Greeter;
528+
import org.acme.proto.HelloRequest;
526529
import io.grpc.Metadata;
527530
import io.quarkus.grpc.GrpcClient;
528531
import io.quarkus.grpc.GrpcClientUtils;
529532
import java.util.concurrent.CompletableFuture;
533+
import java.util.concurrent.ExecutionException;
534+
import java.util.concurrent.TimeUnit;
535+
import java.util.concurrent.TimeoutException;
536+
537+
import io.quarkus.test.junit.QuarkusTest;
530538
import org.junit.jupiter.api.Test;
531539
532-
public class HelloServiceTest implements Greeter {
540+
@QuarkusTest
541+
public class GreeterServiceTest {
542+
543+
private static final Metadata.Key<String> AUTHORIZATION = Metadata.Key.of("Authorization", Metadata.ASCII_STRING_MARSHALLER);
533544
534545
@GrpcClient
535546
Greeter greeterClient;
536547
537548
@Test
538-
void shouldReturnHello() {
549+
void shouldReturnHello() throws ExecutionException, InterruptedException, TimeoutException {
539550
Metadata headers = new Metadata();
540-
headers.put("Authorization", "Basic am9objpqb2hu");
551+
552+
// Set the headers - Basic auth for testing
553+
headers.put(AUTHORIZATION, "Basic YWxpY2U6YWxpY2U="); // alice:alice with "admin" role
541554
var client = GrpcClientUtils.attachHeaders(greeterClient, headers);
542555
556+
// Call the client
543557
CompletableFuture<String> message = new CompletableFuture<>();
544558
client.sayHello(HelloRequest.newBuilder().setName("Quarkus").build())
545559
.subscribe().with(reply -> message.complete(reply.getMessage()));
546-
assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo("Hello Quarkus");
560+
561+
// Get the values
562+
String theValue = message.get(5, TimeUnit.SECONDS);
563+
564+
// Assert
565+
assertThat(theValue, is("Hello Quarkus"));
547566
}
548567
}
549568
----
@@ -596,7 +615,7 @@ import io.quarkus.security.identity.request.UsernamePasswordAuthenticationReques
596615
@Singleton
597616
public class CustomGrpcSecurityMechanism implements GrpcSecurityMechanism {
598617
599-
private static final String AUTHORIZATION = "Authorization";
618+
private static final Metadata.Key<String> AUTHORIZATION = Metadata.Key.of("Authorization", Metadata.ASCII_STRING_MARSHALLER);
600619
601620
@Override
602621
public boolean handles(Metadata metadata) {

_versions/main/guides/tls-registry-reference.adoc

+10-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ endif::no-reactive-routes[]
2828
.
2929

3030
As a result, applications that use the TLS Registry can be ready to handle secure communications out of the box.
31-
TLS Registry also provides features like automatic certificate reloading, Let's Encrypt (ACME) integration, Kubernetes Cert-Manager support, and compatibility with various keystore formats, such as PKCS12, PEM, and JKS.
31+
32+
TLS Registry also provides automatic certificate reloading
33+
ifndef::no-lets-encrypt[]
34+
, integration with Let's Encrypt (ACME)
35+
endif::no-lets-encrypt[]
36+
ifndef::no-kubernetes-secrets-or-cert-manager[]
37+
, support for Kubernetes Cert-Manager,
38+
endif::no-kubernetes-secrets-or-cert-manager[]
39+
and compatibility with various keystore formats, such as PKCS12, PEM, and JKS.
3240

3341
[[using-the-tls-registry]]
3442
== Using the TLS registry
@@ -675,7 +683,7 @@ quarkus.tls.http.key-store.pem.0.cert=tls.crt
675683
quarkus.tls.http.key-store.pem.0.key=tls.key
676684
----
677685

678-
IMPORTANT: Impacted server and client may need to listen to the `CertificateReloadedEvent` to apply the new certificates.
686+
IMPORTANT: Impacted server and client may need to listen to the `CertificateUpdatedEvent` to apply the new certificates.
679687
This is automatically done for the Quarkus HTTP server, including the management interface if it is enabled.
680688

681689
ifndef::no-kubernetes-secrets-or-cert-manager[]

_versions/main/guides/websockets-next-reference.adoc

+4-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ The session context remains active until the `@OnClose` method completes executi
182182
In cases where a WebSocket endpoint does not declare an `@OnOpen` method, the session context is still created.
183183
It remains active until the connection terminates, regardless of the presence of an `@OnClose` method.
184184

185-
Methods annotated with `@OnTextMessage,` `@OnBinaryMessage,` `@OnOpen`, and `@OnClose` also have the request scope activated for the duration of the method execution (until it produced its result).
185+
Endpoint callbacks may also have the request context activated for the duration of the method execution (until it produced its result).
186+
By default, the request context is only activated if needed, i.e. if there is a request scoped bean , or a bean annotated with a security annotation (such as `@RolesAllowed`) in the dependency tree of the endpoint.
187+
However, it is possible to set the `quarkus.websockets-next.server.activate-request-context` config property to `always`.
188+
In this case, the request context is always activated when an endpoint callback is invoked.
186189

187190
[[callback-methods]]
188191
=== Callback methods

0 commit comments

Comments
 (0)