Documentation
¶
Overview ¶
Package tenant holds the settings of a tenant (PHASE1 step 18): whether the server may generate keys, and the subject defaults that fill empty fields of a request – what pki.conf of legacy/pki.sh did.
Index ¶
- Constants
- Variables
- type ACMELimits
- type Settings
- type Store
- func (s *Store) ACMELimits(ctx context.Context, tenant string) (ACMELimits, error)
- func (s *Store) AgentEnrollment(ctx context.Context, tenant string) (string, error)
- func (s *Store) Defaults(ctx context.Context, tenant string) (*Settings, error)
- func (s *Store) Get(ctx context.Context, tenant string, who keys.Who) (*Settings, error)
- func (s *Store) Set(ctx context.Context, tenant string, v Settings, who keys.Who) error
- func (s *Store) TrustPage(ctx context.Context, tenant string) (bool, error)
Constants ¶
const ( EnrollAuto = "auto" EnrollVerified = "verified" EnrollManual = "manual" )
Agent enrollment modes (docs/PHASE3.md §6.1).
const ActionSettings = "tenant.settings"
ActionSettings is the audit action of a change.
const DefaultStepUpMinutes = 5
DefaultStepUpMinutes preserves the lifetime used before v0.3.1.
Variables ¶
var DefaultACMELimits = ACMELimits{OrdersPerAccount: 300, FailedPerName: 5, AccountsPerIP: 10}
DefaultACMELimits are the limits of a new tenant (migration 0009).
var EnrollmentModes = []string{EnrollAuto, EnrollVerified, EnrollManual}
EnrollmentModes lists the valid modes.
var ErrInvalid = errors.New("invalid settings")
ErrInvalid wraps every refused value.
var StepUpMinuteValues = []int{5, 10, 15, 30, 60}
StepUpMinuteValues lists the allowed proof lifetimes in minutes.
Functions ¶
This section is empty.
Types ¶
type ACMELimits ¶ added in v0.2.0
type ACMELimits struct {
OrdersPerAccount int // new orders per account
FailedPerName int // failed validations per name
AccountsPerIP int // new accounts per client address (IPv6: per /64)
}
ACMELimits are per hour (PHASE2 step 11).
type Settings ¶
type Settings struct {
AllowServerKeygen bool
Organization string
OrganizationalUnit string
Locality string
State string
Country string
// ACME: the rate limits of the ACME server. Get always fills it; in
// Set, nil keeps the stored limits (a v0.1 client doesn't send them).
ACME *ACMELimits
// TrustPage: the public listener serves the trust page at / (v0.2.2,
// default on). Get always fills it; in Set, nil keeps the stored value
// (a v0.2 client doesn't send it).
TrustPage *bool
// AgentEnrollment: how agents are admitted (v0.3.0, ADR-18) – auto,
// verified (default) or manual. Get always fills it; in Set, nil keeps
// the stored value.
AgentEnrollment *string
// StepUpMinutes is the lifetime of new second-factor proofs (v0.3.1).
// Get always fills it; in Set, nil keeps the stored value.
StepUpMinutes *int
// Separate predecessor defaults for agent deployments and other renewals.
// In Set, nil keeps the corresponding stored policy.
AgentPredecessor *predecessor.Policy
OtherPredecessor *predecessor.Policy
}
Settings of a tenant.
type Store ¶
Store reads and writes settings in system.db.
func (*Store) ACMELimits ¶ added in v0.2.0
ACMELimits returns the limits without a permission check (for the ACME server).
func (*Store) AgentEnrollment ¶ added in v0.3.0
AgentEnrollment returns how agents are admitted, without a permission check (the agent listener asks it per enrollment).
func (*Store) Defaults ¶
Defaults returns the settings without a permission check (for the services that fill requests).