Documentation
¶
Overview ¶
Package identity bridges kernel.Principal to the v0 int-ID, single-role model during the Phase 2 transition. Services resolving acting identity parse through here so the "invalid user ID" failure stays in one place. Phase 3 modules own their ID shapes; new code must prefer Principal fields over these helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidUserID = kernel.ErrInvalidPrincipalID
ErrInvalidUserID is returned when a principal carries a non-decimal ID. Handlers map it to the same 400 invalid_user_id response the pre-Phase-2 handler-side parse produced. It aliases the kernel sentinel so module services (which cannot import this package) map through the same value.
Functions ¶
func New ¶
New builds a principal from v0 int-ID parts. Importers and tests use it to construct the acting identity they already hold as parts.
func PrimaryRole ¶
PrimaryRole returns the principal's first role, or "" when anonymous. v0 roles are single-valued; multi-role resolution belongs to the users module (Phase 3).
Types ¶
This section is empty.