policy

package
v0.0.0-...-cc9bb6a Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultPolicy

type DefaultPolicy struct{}

func (*DefaultPolicy) Logs

func (dp *DefaultPolicy) Logs() []Log

func (*DefaultPolicy) ShardHint

func (dp *DefaultPolicy) ShardHint() uint64

ShardHint returns the smallest shard hint that all logs accept

func (*DefaultPolicy) Verify

Verify checks if the cosigned tree head satisifies the policy "one log and a majority of witnesses". Any unverifiable cosignatures are removed.

func (*DefaultPolicy) Witnesses

func (dp *DefaultPolicy) Witnesses() []Witness

type Log

type Log struct {
	Name       string
	LogURL     string
	PublicKey  types.PublicKey
	ShardStart uint64
	TrustUntil uint64
}

type Policy

type Policy interface {
	// Logs returns the list of known logs.  It is needed so that an
	// appropriate log can be picked when submitting a signed checksum.
	Logs() []Log

	// ShardHint returns a recommended shard hint.
	ShardHint() uint64

	// Verify checks if a cosigned tree head is trustworthy.  On success,
	// any invalid or unknown cosignatures may be removed.
	Verify(*types.CosignedTreeHead) error
}

type Witness

type Witness struct {
	Name       string
	PublicKey  types.PublicKey
	TrustUntil uint64
}

Jump to

Keyboard shortcuts

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