Documentation
¶
Overview ¶
Package identity provides a unified user identity type (Sender) and context helpers shared by the auth middleware and the messenger subsystem. It exists as a standalone package to avoid import cycles between pkg/security/auth (which produces identities) and pkg/messenger (which consumes them in MessageOrigin).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Sender ¶
type Sender struct {
// ID is a unique identifier for the user (e.g. Email, Username, API Key abbreviation, or "demo-user").
ID string
// Username is the unique handle (e.g., Slack member ID, Discord username).
Username string
// DisplayName is a human-readable display name, if available.
DisplayName string
// Role defines the access tier of the user (e.g. "admin", "user", "agent", "demo").
Role string
// AuthenticatedVia describes which strategy verified this sender
// (e.g. "oidc", "jwt", "apikey", "password", "none").
AuthenticatedVia string
}
Sender represents the authenticated user or entity interacting with Genie. It unifies platform-level identity (ID, Username, DisplayName) with security metadata (Role, AuthenticatedVia) so that a single type flows through both HTTP-authenticated and messenger-originated requests.
func DemoSender ¶
func DemoSender() Sender
DemoSender returns a Sender that represents the unauthenticated demo user.