Class SmallRyeAuthGraphQLWSHandler
java.lang.Object
io.quarkus.smallrye.graphql.runtime.SmallRyeAuthGraphQLWSHandler
A class which is capable of performing authentication against connection_init payloads for all GraphQL WebSocket
subprotocols.
Is also responsible for handling the closing of WebSockets when authentication expires.
-
Constructor Summary
ConstructorsConstructorDescriptionSmallRyeAuthGraphQLWSHandler(io.smallrye.graphql.websocket.GraphQLWebSocketSession session, io.vertx.ext.web.RoutingContext ctx, SmallRyeGraphQLAbstractHandler handler, Optional<String> authorizationClientInitPayloadName) -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic io.smallrye.mutiny.subscription.CancellablecreateAuthExpiryTask(io.vertx.ext.web.RoutingContext ctx, io.smallrye.graphql.websocket.GraphQLWebSocketSession webSocketSession) (package private) voidhandlePayload(Map<String, Object> payload, Runnable successCallback, Consumer<Throwable> failureHandler) Takes the payload sent from connection_init, and if quarkus.smallrye-graphql.authorization-client-init-payload-name is defined, then will take the value from the payload that matches the configured value.
-
Constructor Details
-
SmallRyeAuthGraphQLWSHandler
public SmallRyeAuthGraphQLWSHandler(io.smallrye.graphql.websocket.GraphQLWebSocketSession session, io.vertx.ext.web.RoutingContext ctx, SmallRyeGraphQLAbstractHandler handler, Optional<String> authorizationClientInitPayloadName)
-
-
Method Details
-
handlePayload
void handlePayload(Map<String, Object> payload, Runnable successCallback, Consumer<Throwable> failureHandler) Takes the payload sent from connection_init, and if quarkus.smallrye-graphql.authorization-client-init-payload-name is defined, then will take the value from the payload that matches the configured value. The value is treated as an Authorization header.- Parameters:
payload- The connection_init payloadsuccessCallback- Will back called once the authentication has completed (or is skipped if not required)failureHandler- Any errors which occur during authentication will be passed to this handler
-
cancelAuthExpiry
public void cancelAuthExpiry() -
createAuthExpiryTask
public static io.smallrye.mutiny.subscription.Cancellable createAuthExpiryTask(io.vertx.ext.web.RoutingContext ctx, io.smallrye.graphql.websocket.GraphQLWebSocketSession webSocketSession)
-