Class McpAdmissionIdentity
java.lang.Object
com.soklet.McpAdmissionIdentity
Shallowly immutable application-supplied identity and stable, opaque
partition keys. The carrier itself is safe for concurrent access;
applications retain responsibility for the thread-safety of principal and
application-context objects they place inside it.
Instances intentionally retain reference identity. Principal and application-context objects are opaque security capabilities and do not participate in framework-defined structural equality. Authorization code must compare the documented stable partition keys or apply its own principal policy explicitly.
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable builder for an immutableMcpAdmissionIdentity. -
Field Summary
FieldsModifier and TypeFieldDescriptionMaximum UTF-8 encoding length of either partition key. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull McpAdmissionIdentityReturns the canonical anonymous identity.Returns the opaque authorization partition key.withRateLimitPartitionKey(@NonNull String rateLimitPartitionKey) Vends an identity builder primed with a stable rate-limit partition key.
-
Field Details
-
MAXIMUM_PARTITION_KEY_SIZE_IN_UTF_8_BYTES
Maximum UTF-8 encoding length of either partition key.
-
-
Method Details
-
anonymousInstance
Returns the canonical anonymous identity.- Returns:
- shared anonymous identity
-
withRateLimitPartitionKey
public static @NonNull McpAdmissionIdentity.Builder withRateLimitPartitionKey(@NonNull String rateLimitPartitionKey) Vends an identity builder primed with a stable rate-limit partition key.- Parameters:
rateLimitPartitionKey- opaque, fleet-stable partition key- Returns:
- identity builder
-
isAuthenticated
- Returns:
- whether a principal is present
-
getPrincipal
- Returns:
- application principal, when authenticated
-
getApplicationContext
- Returns:
- optional application context propagated to later MCP hooks
-
getRateLimitPartitionKey
- Returns:
- opaque rate-limit partition key
-
getAuthorizationPartitionKey
Returns the opaque authorization partition key. Absence selects Soklet's endpoint-scoped anonymous authorization partition.- Returns:
- authorization partition key, when supplied
-