tenant

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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

View Source
const ActionSettings = "tenant.settings"

ActionSettings is the audit action of a change.

Variables

View Source
var DefaultACMELimits = ACMELimits{OrdersPerAccount: 300, FailedPerName: 5, AccountsPerIP: 10}

DefaultACMELimits are the limits of a new tenant (migration 0009).

View Source
var ErrInvalid = errors.New("invalid settings")

ErrInvalid wraps every refused value.

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
}

Settings of a tenant.

type Store

type Store struct {
	DB    *sql.DB // system.db writer
	Clock clock.Clock
	Wake  func()
}

Store reads and writes settings in system.db.

func (*Store) ACMELimits added in v0.2.0

func (s *Store) ACMELimits(ctx context.Context, tenant string) (ACMELimits, error)

ACMELimits returns the limits without a permission check (for the ACME server).

func (*Store) Defaults

func (s *Store) Defaults(ctx context.Context, tenant string) (*Settings, error)

Defaults returns the settings without a permission check (for the services that fill requests).

func (*Store) Get

func (s *Store) Get(ctx context.Context, tenant string, who keys.Who) (*Settings, error)

Get returns the settings; reading needs any role in the tenant.

func (*Store) Set

func (s *Store) Set(ctx context.Context, tenant string, v Settings, who keys.Who) error

Set stores new settings; it needs tenant.manage (tenant admin).

func (*Store) TrustPage added in v0.2.2

func (s *Store) TrustPage(ctx context.Context, tenant string) (bool, error)

TrustPage reports whether the public listener serves the trust page, without a permission check (the public listener asks it per request, so a change applies at once).

Jump to

Keyboard shortcuts

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