Documentation
¶
Overview ¶
Package statestore persists atomic protocol byte records in SQLite, PostgreSQL and MySQL.
Design ¶
Security services use these records for grants, certificate associations, revocation and quota accounting across replicas. Transactions lock fixed shards in deterministic order before reading database time, bounding lock metadata and coordinating expiry decisions. The protocol-state schema has its own migrations. The caller owns the database pool and chooses serialization and namespaces through domain interfaces.
References ¶
- https://github.com/deploymenttheory/go-apple-dm/blob/main/docs/research/decisions/0047-enrollment-authentication-and-optional-security-services.md
- state.Store
- server/sqlstore/sqlcommon
Index ¶
- func MigrationSet(d sqlcommon.Dialect) (sqlcommon.MigrationSet, error)
- func PublishCertificate(ctx context.Context, tx state.Tx, identity lifecycle.Identity, ...) error
- type Store
- func (s *Store) Get(ctx context.Context, k string) (state.Record, error)
- func (s *Store) List(ctx context.Context, prefix, after string, limit int) ([]state.Record, error)
- func (s *Store) Prune(ctx context.Context, limit int) (int, error)
- func (s *Store) Rewrap(ctx context.Context) (int, error)
- func (s *Store) Update(ctx context.Context, keys []string, fn func(state.Tx) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrationSet ¶
func MigrationSet(d sqlcommon.Dialect) (sqlcommon.MigrationSet, error)
MigrationSet exposes the schema to coordinated backup and restore tools.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements state.Store with SQL transactions and authoritative database time.
func Open ¶
func Open( ctx context.Context, db *sql.DB, d sqlcommon.Dialect, keys ...*crypt.Keyring, ) (*Store, error)
Open applies the separate state schema migrations and wraps the caller's pool.
func (*Store) Rewrap ¶
Rewrap rotates protocol state under the active key. Call until it returns zero.