identity

package
v1.11.6 Latest Latest
Warning

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

Go to latest
Published: May 27, 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. Pass `"unknown"` through verbatim. device.Gather already returns that sentinel for failed probes; we do NOT rewrite it to "" — the backend distinguishes "not collected" from "actively unknown".

  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.

On probe timeout or any executor error, fields fall back to the `"unknown"` sentinel that device.Gather emits internally — this function does not synthesize "" or any other replacement.

Jump to

Keyboard shortcuts

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