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 computes AI-event identity for a hook invocation.

This is a thin wrapper over DMG's `internal/device.Gather`. The only adapter logic that lives here is:

  1. Bound the device probe with a 1-second context timeout. Hook invocations have a 15s total budget; identity must not be the thing that exhausts it.

  2. Use the configured device ID when present, otherwise the machine ID; "unknown" when the probe budget ran out, as before (the event ingest contract for an empty device_id is unverified).

  3. Single Gather call per Resolve — no probing twice for the two fields we need.

CustomerID is plumbed through as-is from the caller (typically read from `internal/aiagents/ingest.Snapshot`); device.Gather has no awareness of it.

Index

Constants

View Source
const ProbeTimeout = time.Second

ProbeTimeout is the upper bound on the device.Gather call. Tuned to leave room for enrichment + a 5s upload inside the 15s hook cap.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	CustomerID   string
	DeviceID     string
	UserIdentity string
}

Info is the identity payload attached to every AI-agent event.

The wire field for DeviceID is `device_id`; the wire field for UserIdentity is `user_identity`. See internal/aiagents/event.

func Resolve

func Resolve(ctx context.Context, exec executor.Executor, customerID string) Info

Resolve returns identity information for the current host, using the configured device ID when present.

On probe timeout, DeviceID and other gathered fields fall back to "unknown". A configured device ID still takes precedence.

Jump to

Keyboard shortcuts

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