forwarderstore

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package forwarderstore backs the device-forwarder enrollment flow with SQLite, the way executorstore backs the executor-agent one.

It is a type-converting adapter and nothing else: pkg/statedb owns the rows, pkg/deviceforward owns the protocol and the crypto, and this package joins them. The separation keeps pkg/deviceforward free of a SQLite dependency — the forwarder binary on an edge device imports deviceforward, and linking a database engine into a process whose whole job is to copy bytes between a device and a socket would be dead weight on exactly the hardware that can least afford it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements deviceforward.Store over a *statedb.DB.

func New

func New(db *statedb.DB) (*Store, error)

New wraps a database handle.

func (*Store) GetEnrollment

func (s *Store) GetEnrollment(id string) (deviceforward.EnrollmentRecord, error)

GetEnrollment loads a token by ID.

func (*Store) GetForwarder

func (s *Store) GetForwarder(forwarderID string) (deviceforward.ForwarderRecord, error)

GetForwarder loads a forwarder by ID.

func (*Store) ListEnrollments

func (s *Store) ListEnrollments() ([]deviceforward.EnrollmentRecord, error)

ListEnrollments returns every token.

func (*Store) ListForwarders

func (s *Store) ListForwarders() ([]deviceforward.ForwarderRecord, error)

ListForwarders returns every forwarder.

func (*Store) PutEnrollment

func (s *Store) PutEnrollment(rec deviceforward.EnrollmentRecord) error

PutEnrollment persists a minted token.

func (*Store) PutForwarder

func (s *Store) PutForwarder(rec deviceforward.ForwarderRecord) error

PutForwarder persists a forwarder credential.

func (*Store) RedeemEnrollment

func (s *Store) RedeemEnrollment(id, forwarderID string, at time.Time) error

RedeemEnrollment atomically claims a token.

func (*Store) RevokeEnrollment

func (s *Store) RevokeEnrollment(id string, at time.Time) error

RevokeEnrollment marks a token revoked.

func (*Store) RevokeForwarder

func (s *Store) RevokeForwarder(forwarderID string, at time.Time) error

RevokeForwarder marks a credential revoked.

func (*Store) TouchForwarder

func (s *Store) TouchForwarder(forwarderID string, at time.Time) error

TouchForwarder records that a forwarder was seen.

Jump to

Keyboard shortcuts

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