Class McpRequestStateProtectionContext
java.lang.Object
com.soklet.McpRequestStateProtectionContext
Immutable framework-supplied context for an application request-state
protector.
Associated-data bytes are the exact versioned canonical binding that Soklet can independently reconstruct for the original operation and its retry. A custom protector must authenticate these bytes exactly. Neither they nor the other values in this context are suitable for logs or metric dimensions.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares the exact canonical protection inputs, including associated-data bytes by content.fromComponents(@NonNull String endpointPath, @NonNull McpProtocolVersion protocolVersion, @NonNull String jsonRpcMethod, byte @NonNull [] associatedData) Creates a protection context from its components.byte @NonNull []inthashCode()
-
Method Details
-
fromComponents
public static @NonNull McpRequestStateProtectionContext fromComponents(@NonNull String endpointPath, @NonNull McpProtocolVersion protocolVersion, @NonNull String jsonRpcMethod, byte @NonNull [] associatedData) Creates a protection context from its components. This factory is useful for exercising application-provided request-state protectors in isolation; Soklet constructs the authoritative contexts used for live requests.- Parameters:
endpointPath- normalized endpoint pathprotocolVersion- validated MCP protocol versionjsonRpcMethod- MCP JSON-RPC methodassociatedData- canonical associated data, defensively copied- Returns:
- immutable request-state protection context
- Throws:
NullPointerException- if any argument is null
-
getEndpointPath
- Returns:
- normalized endpoint path
-
getProtocolVersion
- Returns:
- validated MCP protocol version supplied on this request
-
getJsonRpcMethod
- Returns:
- MCP JSON-RPC method
-
getAssociatedData
- Returns:
- defensive copy of the canonical associated data
-
equals
-
hashCode
-