Documentation
¶
Overview ¶
Package clientidentity derives the safe, stable identity used for untrusted MCP clientInfo names across persisted presence and session rows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AliasCandidate ¶ added in v0.73.0
AliasCandidate is NormalizeRaw with one trailing mcp-remote bridge tag removed, so "claude-ai (via mcp-remote 0.15.2)" classifies as the client behind the bridge. Use it only to look up supported aliases: like NormalizeRaw it preserves controls, and unknown names keep their exact key.
func NormalizeRaw ¶
NormalizeRaw is for exact case-insensitive alias classification only. It intentionally preserves controls, so an escape-prefixed client cannot become a supported alias merely because its display label removes the escape.
func SanitizeDisplay ¶
SanitizeDisplay keeps rendered names safe and bounded.
Types ¶
type Identity ¶
Identity is a safe key and label derived from one untrusted client name. RawNormalized is retained only during the immediate classification step and must never be returned to an API consumer.
func FromRaw ¶
FromRaw derives a common identity for session names and initialize evidence. Key is versioned and namespace-separated: a printable name cannot reproduce the serialized key of a name changed by sanitization or truncation. PublicID keeps ordinary names readable while reserving a sentinel for transformed names; ordinary names beginning with that sentinel are escaped.
func FromStoredKey ¶
FromStoredKey reconstructs the safe display label from a persisted key. The key is already an internal safe representation, so its identity stays exact. Legacy unversioned keys remain readable but never use the old hash-suffix heuristic, which could merge a printable name with a transformed one.