Class McpAdmissionRejection
java.lang.Object
com.soklet.McpAdmissionRejection
Typed MCP admission rejection. Soklet owns envelope serialization and
suppresses the body for notifications. Application response headers are
validated by the builder and revalidated before transport. A
BearerAuthenticationChallenge supplies a validated
WWW-Authenticate value; the application owns token verification,
protected-resource metadata, and scope policy. Unsafe,
framework-owned, hop-by-hop, CORS, and obsolete transport-state headers
fail during header construction without exposing custom names or values.
Header names must be ASCII HTTP tokens and unique ignoring case. Value lists must be nonempty; each value may be empty but must contain only visible ASCII or horizontal tabs. The fixed limits are 100 header fields and 65,536 bytes, counting each field as its name length plus value length plus four bytes.
Reserved names, ignoring case, are Cache-Control, Connection,
Content-Encoding, Content-Length, Content-Type,
Keep-Alive, Proxy-Authenticate, Proxy-Authorization,
Proxy-Connection, TE, Trailer, Transfer-Encoding,
Upgrade, Retry-After, Mcp-Session-Id, Last-Event-ID,
and every name beginning with Access-Control-.
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable builder for an immutableMcpAdmissionRejection. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the immutable snapshot of validated application response headers.inthashCode()withBearerAuthenticationChallengeAndError(@NonNull BearerAuthenticationChallenge bearerAuthenticationChallenge, @NonNull McpJsonRpcError jsonRpcError) Vends a rejection builder using the challenge's recommended HTTP status and adding its renderedWWW-Authenticatevalue.withStatusCodeAndError(@NonNull Integer statusCode, @NonNull McpJsonRpcError jsonRpcError) Vends a rejection builder primed with an HTTP status and JSON-RPC error.
-
Method Details
-
withStatusCodeAndError
public static @NonNull McpAdmissionRejection.Builder withStatusCodeAndError(@NonNull Integer statusCode, @NonNull McpJsonRpcError jsonRpcError) Vends a rejection builder primed with an HTTP status and JSON-RPC error.- Parameters:
statusCode- HTTP status from 400 through 599jsonRpcError- client-visible JSON-RPC error- Returns:
- rejection builder
- Throws:
NullPointerException- ifstatusCodeorjsonRpcErroris null
-
withBearerAuthenticationChallengeAndError
public static @NonNull McpAdmissionRejection.Builder withBearerAuthenticationChallengeAndError(@NonNull BearerAuthenticationChallenge bearerAuthenticationChallenge, @NonNull McpJsonRpcError jsonRpcError) Vends a rejection builder using the challenge's recommended HTTP status and adding its renderedWWW-Authenticatevalue.- Parameters:
bearerAuthenticationChallenge- validated Bearer challengejsonRpcError- client-visible JSON-RPC error- Returns:
- rejection builder
-
getStatusCode
- Returns:
- rejection HTTP status
-
getJsonRpcError
- Returns:
- client-visible JSON-RPC error
-
getHeaders
-
equals
-
hashCode
-