Skip to content

Commit

Permalink
Change Checkpoint origin to be "Hostname - Tree ID" (#1013)
Browse files Browse the repository at this point in the history
This follows the checkpoint specification, making the origin unique per
environment and shard.

Fixes #1010

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
  • Loading branch information
haydentherapper committed Aug 30, 2022
1 parent ae429bb commit 7492834
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/api/tlog.go
Expand Up @@ -69,7 +69,7 @@ func GetLogInfoHandler(params tlog.GetLogInfoParams) middleware.Responder {
treeSize := int64(root.TreeSize)

sth, err := util.CreateSignedCheckpoint(util.Checkpoint{
Origin: "Rekor",
Origin: fmt.Sprintf("%s - %d", viper.GetString("rekor_server.hostname"), tc.ranges.ActiveTreeID()),
Size: root.TreeSize,
Hash: root.RootHash,
})
Expand Down Expand Up @@ -170,7 +170,7 @@ func inactiveShardLogInfo(ctx context.Context, tid int64) (*models.InactiveShard
treeSize := int64(root.TreeSize)

sth, err := util.CreateSignedCheckpoint(util.Checkpoint{
Origin: "Rekor",
Origin: fmt.Sprintf("%s - %d", viper.GetString("rekor_server.hostname"), tid),
Size: root.TreeSize,
Hash: root.RootHash,
})
Expand Down

0 comments on commit 7492834

Please sign in to comment.