identity

package
v1.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func DetectUser(exec executor.Executor) string

DetectUser preserves usable automatic identities, including values outside the configured-ID allowlist. Absent/sentinel env values do not mask OS users.

func DetectUserSession

func DetectUserSession(ctx context.Context, exec executor.Executor) (string, bool)

DetectUserSession takes one OS-user snapshot, keeping session state separate from email attribution and any configured identity applied by the caller.

func MissingDevice

func MissingDevice(value string) bool

func MissingUser

func MissingUser(value string) bool

func Normalize

func Normalize(value, kind string) (string, error)

Normalize validates an explicitly configured user or device ID. Automatically detected identities are not subject to this input allowlist.

func NormalizeDevice

func NormalizeDevice(value string) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL