Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Principal ¶
type Principal struct {
// ID is a unique identifier for the user (e.g. Email, Username, API Key abbreviation, or "demo-user")
ID string
// Name is a human-readable display name, if available.
Name string
// Role defines the access tier of the user (e.g. "admin", "user", "agent", "demo")
Role string
// AuthenticatedVia describes which strategy verified this principal ("oidc", "jwt", "apikey", "password", "none")
AuthenticatedVia string
}
Principal represents the authenticated user or entity interacting with Genie.
func GetPrincipal ¶
GetPrincipal retrieves the Principal from the context. If no principal is found (meaning authentication was completely disabled or misconfigured), it returns a safe "demo" user to ensure the rest of the chain doesn't panic on nil.
Click to show internal directories.
Click to hide internal directories.