trustedagents

package
v1.10.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package trustedagents holds the daemon-side service that periodically refreshes the trusted-agents allowlist from GitHub. The data layer (embedded JSON, Agent type, IsTrusted, All) lives in internal/trustedagents so the CLI can read the list without pulling in an L11 plugin import.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTrusted

func IsTrusted(nodeID uint32) (string, bool)

IsTrusted is re-exported for source compatibility. New code should import internal/trustedagents.IsTrusted directly.

func Run

func Run(ctx context.Context)

Run polls the canonical URL on a timer, replacing the active list whenever a new one is fetched. Blocks until ctx is cancelled. The first fetch is delayed 0–30s so a fleet rebooting at the same time doesn't thunder the URL.

func SetForTest

func SetForTest(agents []Agent) (restore func())

SetForTest is re-exported for source compatibility.

Types

type Agent

type Agent = internaltrusted.Agent

Agent is re-exported for source compatibility. New code should import internal/trustedagents.Agent directly.

func All

func All() []Agent

All is re-exported for source compatibility.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the L11 plugin adapter. Implements both coreapi.Service (lifecycle) and coreapi.TrustChecker (trust gate). Daemon stores it twice — once in the plugin registry, once as the trust checker — but it's the same struct.

func NewService

func NewService() *Service

NewService returns a Service ready for daemon.RegisterPlugin and daemon.RegisterTrustChecker.

func (*Service) IsTrusted

func (s *Service) IsTrusted(nodeID uint32) (string, bool)

IsTrusted is the coreapi.TrustChecker side of the plugin. Delegates to the package-global allowlist that Run() maintains.

func (*Service) Name

func (s *Service) Name() string

func (*Service) Order

func (s *Service) Order() int

Order: 50 — must start BEFORE handshake (~order 70) so the allowlist is populated when the first trust handshake arrives.

func (*Service) Start

func (s *Service) Start(ctx context.Context, deps coreapi.Deps) error

func (*Service) Stop

func (s *Service) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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