proposalrpc

package
v0.2.2-dev.5 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package proposalrpc is the ProposalService (proto/mistgate/proposal/v1): what the owner sees and decides about the panel's proposals, and the modes of automation. It carries nothing out: Accept only moves a proposal from awaiting to applying and wakes the executor (internal/panel/app), which is the one that makes the change. The roles that serve the admin API plug the handler in with app.Config.ProposalAPI; the Workers that do not (link, public) never link it.

Who may call what is the table of internal/panel/auth (policy_proposal.go): the two reads are any admin's and open to API tokens; accepting, rejecting, reverting and setting a mode are the owner's, signed in, and every handler refuses a token, the assistant and a scheduled task again (auth.OwnerSession). Choosing AUTO also needs a fresh step-up. No address of a server is in a value of this API, in an audit row or in a log line: a proposal has none (store.ErrProposalAddress).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(st *store.Store, a *auth.Service, kick func()) (string, http.Handler)

Handler is app.Config.ProposalAPI: the ProposalService over st, asking a.RequireStepUp for AUTO and calling kick after an accept or a revert.

Types

type Config

type Config struct {
	Store  *store.Store
	StepUp func(context.Context) error // a fresh step-up, asked for to choose AUTO
	Kick   func()                      // wakes the executor after an accept or a revert (the VPS loop); nil = nothing waits
	Log    *slog.Logger
	Now    func() time.Time
}

Config configures Service. Store and StepUp are required; the rest has defaults.

type Service

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

Service implements ProposalService.

func New

func New(cfg Config) *Service

New is a Service; it fills the defaults of cfg.

func (*Service) Handler

func (s *Service) Handler(opts ...connect.HandlerOption) (string, http.Handler)

Handler is the Connect path and handler of the service.

Jump to

Keyboard shortcuts

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