Documentation
¶
Overview ¶
Package identity defines configured ID validation and automatic user detection. It never uses an attribution ID as an OS account or home directory.
Index ¶
- Constants
- func DetectUser(exec executor.Executor) string
- func DetectUserSession(ctx context.Context, exec executor.Executor) (string, bool)
- func MissingDevice(value string) bool
- func MissingUser(value string) bool
- func Normalize(value, kind string) (string, error)
- func NormalizeDevice(value string) (string, error)
Constants ¶
const MissingUserWarning = "No user identity detected. Scanning will continue. Run this executable with: configure --non-interactive --user-id <ID>"
MissingUserWarning gives runnable arguments without assuming a binary alias.
Variables ¶
This section is empty.
Functions ¶
func DetectUser ¶
DetectUser preserves usable automatic identities, including values outside the configured-ID allowlist. Absent/sentinel env values do not mask OS users.
func DetectUserSession ¶
DetectUserSession takes one OS-user snapshot, keeping session state separate from email attribution and any configured identity applied by the caller.
func MissingDevice ¶
func MissingUser ¶
func Normalize ¶
Normalize validates an explicitly configured user or device ID. Automatically detected identities are not subject to this input allowlist.
func NormalizeDevice ¶
NormalizeDevice validates an explicitly configured device ID. "-" clears the override and is returned as "". A template over {serial} and {hostname} is returned trimmed: the agent expands and sanitizes it on each scan, so only its shape is checked here (known tokens, balanced braces, literal text from the ID allowlist, at most 256 characters). A device is the machine, so there is no user token: {user} is rejected like any other unknown token. Anything else is a literal and must satisfy Normalize.
Types ¶
This section is empty.