Skip to content

pilot-protocol/trustedagents

Repository files navigation

trustedagents

ci codecov License: AGPL-3.0

Trusted-agents plugin for the Pilot Protocol daemon. Ships an embedded allowlist of public node IDs that the daemon auto-accepts handshake requests from, plus a 1-hour refresher loop that pulls the canonical list from this repo on a schedule.

Install

import "github.com/pilot-protocol/trustedagents"

Usage

// Lookup:
name, ok := trustedagents.IsTrusted(nodeID)
_ = name
_ = ok

// Daemon registration:
rt.Register(trustedagents.NewService())

Layout

File What it does
data.go Embedded JSON list. Load, All, IsTrusted(nodeID) → (description, ok), SetForTest.
runtime.go Run(ctx) — periodic fetcher over HTTPS to raw.githubusercontent.com.
service.go *Servicecoreapi.Service adapter (Name/Order/Start/Stop + IsTrusted). Build tag !no_trustedagents.
service_disabled.go Stub *Service when build tag no_trustedagents is set.
trusted-agents.json The list itself. PRs adding entries land here.

Updating the list

Edit trusted-agents.json and open a PR. Once merged, daemons in the field pick up the new list on their next 1-hour refresh tick. Brand-new daemons get the embedded copy compiled into the binary.

Build tags

Tag Effect
no_trustedagents Compiles a stub that always returns ("", false) from IsTrusted. Used by integration tests that need a clean trust state.

License

AGPL-3.0-or-later. See LICENSE.

About

Pilot Protocol trusted-agents plugin — embedded auto-trust allowlist + IsTrusted() gate

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages