source

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package source manages registered inbound sources and their signing secrets.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownVerifier = errors.New("source: unknown verifier")

ErrUnknownVerifier means the requested verifier is not registered.

Functions

This section is empty.

Types

type Input

type Input struct {
	Name        string
	Verifier    string
	Secret      string
	DedupHeader string
}

Input describes a source to register or update. Secret is the plaintext signing secret; an empty Secret leaves an existing secret unchanged on update and means "no secret" on register.

type Service

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

Service is the source registry.

func NewService

func NewService(store storage.Store, sealer *crypto.Sealer, verifiers *signature.Registry) *Service

NewService wires the registry.

func (*Service) Get

func (s *Service) Get(ctx context.Context, name string) (core.Source, error)

Get returns a source by name.

func (*Service) List

func (s *Service) List(ctx context.Context) ([]core.Source, error)

List returns all sources.

func (*Service) Register

func (s *Service) Register(ctx context.Context, in Input) (core.Source, error)

Register creates a new source.

func (*Service) Secret

func (s *Service) Secret(ctx context.Context, name string) ([]byte, error)

Secret returns the decrypted signing secret for a source, or nil when none is configured.

func (*Service) Update

func (s *Service) Update(ctx context.Context, in Input) (core.Source, error)

Update changes an existing source. A non-empty Secret replaces the stored one.

Jump to

Keyboard shortcuts

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