sensor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sensor ships the browser attestation script (spec §6 L3/L4) and parses its reports. Stdlib-only leaf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Script

func Script() []byte

Script returns the embedded sensor JavaScript. Every call hands out the same slice — treat it as read-only; mutating it changes what all later clients download.

Types

type Report

type Report struct {
	Webdriver     bool   `json:"webdriver"`
	Languages     int    `json:"languages"`
	Timezone      string `json:"tz"`
	PointerEvents int    `json:"pointer_events"`
}

Report is what the sensor posts to /__merlon/attest. Minimal L4 telemetry (plan ruling 1): presence of real pointer activity plus a non-headless environment profile is the M3 consistency signal.

func ParseReport

func ParseReport(r io.Reader) (*Report, error)

ParseReport reads a size-capped JSON report: the read is capped at maxReportBytes (4 KiB) and anything larger is rejected with "sensor: report too large"; decode errors pass through unwrapped. Callers treat any error as a bad report — handlers/challenge.go maps them all to 400.

func (*Report) Consistent

func (rep *Report) Consistent() bool

Consistent reports whether the environment looks like a real interactive browser: not webdriver-flagged, languages and timezone present, and at least one pointer event observed during the sampling window.

Jump to

Keyboard shortcuts

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