Documentation
¶
Overview ¶
Package deviceinfo collects the platform hardware product model and the platform values used by device-related risk-control headers.
Index ¶
Constants ¶
const ( OSTypeUnknown = "0" OSTypeWindows = "1" OSTypeLinux = "2" OSTypeMacOS = "3" )
OS type enum values for X-Agent-Os-Type.
const ( // TerminalTypePC is the fixed X-Agent-Terminal-Type value for the CLI. TerminalTypePC = "1" // Unknown is used when the hardware product model cannot be collected. Unknown = "Unknown" )
const ( HeaderProductModel = "X-Agent-Device-Type" HeaderOSType = "X-Agent-Os-Type" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HostSource ¶
type HostSource struct {
// contains filtered or unexported fields
}
HostSource lazily reads host signals once, after outbound policy authorizes the first request. Failed probes are cached and are not retried per request.
func NewHostSource ¶
func NewHostSource() *HostSource
NewHostSource creates the production host signal source.
func (*HostSource) Snapshot ¶
func (s *HostSource) Snapshot() Snapshot
Snapshot returns the cached host signal snapshot.
type Snapshot ¶
Snapshot contains the deliberately small risk-control signal set. ProductModel is omitted when the platform cannot provide a safe value.
type Source ¶
type Source interface {
Snapshot() Snapshot
}
Source supplies one immutable process-level snapshot.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is the feature's final outbound boundary. It removes caller- or extension-supplied signal headers first and writes trusted values only after authorizing an official SDK origin and authentication state.
func NewTransport ¶
func NewTransport(next http.RoundTripper, source Source) *Transport
NewTransport creates the final SDK outbound policy boundary. A nil source disables collection and injection while preserving restricted-header stripping for opt-out and extension-credential requests.