aboutsummaryrefslogtreecommitdiff
path: root/pkg/policy/policy.go
blob: b4fe9206b8a242142bec495e475b6ead3affc195 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package policy

import (
	"git.sigsum.org/sigsum-lib-go/pkg/types"
)

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 Log struct {
	Name       string
	LogURL     string
	PublicKey  types.PublicKey
	ShardStart uint64
	TrustUntil uint64
}

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