aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-09-27 23:29:05 +0200
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-09-27 23:31:42 +0200
commit621865f5707eaca22d4a0d162a5390b8440f6b40 (patch)
treecea907f137d29caddaba14884aec999aa51bdc20 /cmd
parent0b0320d8f295394e2afc5f0cf012422e8625518b (diff)
added shard_hint enforcement
Diffstat (limited to 'cmd')
-rw-r--r--cmd/sigsum_log_go/main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/sigsum_log_go/main.go b/cmd/sigsum_log_go/main.go
index 786504d..13bb54d 100644
--- a/cmd/sigsum_log_go/main.go
+++ b/cmd/sigsum_log_go/main.go
@@ -37,6 +37,8 @@ var (
witnesses = flag.String("witnesses", "", "comma-separated list of trusted witness verification keys in hex")
maxRange = flag.Int64("max_range", 10, "maximum number of entries that can be retrived in a single request")
interval = flag.Duration("interval", time.Second*30, "interval used to rotate the log's cosigned STH")
+ shardStart = flag.Int64("shard_interval_start", 0, "start of shard interval since the UNIX epoch in seconds")
+ shardEnd = flag.Int64("shard_interval_end", 0, "end of shard interval since the UNIX epoch in seconds")
gitCommit = "unknown"
)
@@ -102,6 +104,14 @@ func setupInstanceFromFlags() (*sigsum.Instance, error) {
i.MaxRange = *maxRange
i.Deadline = *deadline
i.Interval = *interval
+ i.ShardStart = uint64(*shardStart)
+ if *shardStart < 0 {
+ return nil, fmt.Errorf("shard start must be larger than zero")
+ }
+ i.ShardEnd = uint64(*shardEnd)
+ if *shardEnd < *shardStart {
+ return nil, fmt.Errorf("shard end must be larger than shard start")
+ }
i.Witnesses, err = newWitnessMap(*witnesses)
if err != nil {
return nil, fmt.Errorf("newWitnessMap: %v", err)