systemprompt-identifiers 0.38.0

Typed newtype identifiers (UserId, TraceId, AgentId, McpServerId…) for systemprompt.io AI governance infrastructure. Enforces type-safe IDs across every boundary in the MCP governance pipeline.
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Role identifier.
//!
//! Copyright (c) systemprompt.io — Business Source License 1.1.
//! See <https://systemprompt.io> for licensing details.

// Why: role ids arrive from untrusted input at the access-control endpoints,
// which parse them with `try_new` and reject what does not validate. The
// `non_empty` arm keeps the infallible `new` for the call sites that hold a
// known-good literal, so this adds the fallible constructor without forcing a
// migration.
crate::define_id!(RoleId, non_empty);