aboutsummaryrefslogtreecommitdiff
path: root/pkg/policy/policy.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/policy/policy.go')
-rw-r--r--pkg/policy/policy.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/pkg/policy/policy.go b/pkg/policy/policy.go
new file mode 100644
index 0000000..b4fe920
--- /dev/null
+++ b/pkg/policy/policy.go
@@ -0,0 +1,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
+}