Package com.ultikits.ultitools.utils
Class CredentialRotationHandler
java.lang.Object
com.ultikits.ultitools.utils.CredentialRotationHandler
- All Implemented Interfaces:
CloudRequestHandler
Persists a rotated server credential and only then acknowledges it.
The gateway delivers credential.rotate with a new ucs_ credential. Persisting
first keeps the promise that a failed write leaves the old credential in place and produces no
acknowledgement, so the gateway retries; a redelivery is persisted and acknowledged again. The
current connection is not dropped (D-10). In production the persister is
CloudSession.rotateCredential(java.lang.String, java.lang.String): the session that owns the connection is the one owner of the
current credential, so the next handshake and /ulticloud logout use the rotated secret. The
credential is never logged, and no diagnostic here carries it.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interfaceWrites a rotated credential durably. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Loggerprivate final CredentialRotationHandler.CredentialPersister -
Constructor Summary
ConstructorsConstructorDescriptionCreates the handler over a persister. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(CloudRequest request, CloudChannel channel) Validates the payload and handles it on the dispatching thread.
-
Field Details
-
LOGGER
-
persister
-
-
Constructor Details
-
CredentialRotationHandler
CredentialRotationHandler(CredentialRotationHandler.CredentialPersister persister) Creates the handler over a persister.- Parameters:
persister- the durable credential store port
-
-
Method Details
-
handle
Description copied from interface:CloudRequestHandlerValidates the payload and handles it on the dispatching thread. No Bukkit main-thread scheduling is implied; handlers must schedule such work themselves. Synchronous payload validation failures become correlated invalid_message replies; other runtime failures become internal_error without exposing exception text. Asynchronous failures are the handler's responsibility.- Specified by:
handlein interfaceCloudRequestHandler- Parameters:
request- the parsed envelope with a defensively copied payloadchannel- the reply channel, which may close during processing
-