aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/instance/endpoint.go2
-rw-r--r--pkg/instance/endpoint_test.go10
-rw-r--r--pkg/instance/instance.go14
-rw-r--r--pkg/instance/instance_test.go6
-rw-r--r--pkg/instance/metric.go2
-rw-r--r--pkg/mocks/sigsum_state_manager.go (renamed from pkg/mocks/state.go)4
-rw-r--r--pkg/mocks/sigsum_trillian_client.go (renamed from pkg/mocks/stfe.go)4
-rw-r--r--pkg/mocks/trillian_log_client.go (renamed from pkg/mocks/trillian.go)0
-rw-r--r--pkg/state/state_manager.go4
-rw-r--r--pkg/state/state_manager_test.go4
-rw-r--r--pkg/trillian/client.go2
-rw-r--r--pkg/trillian/client_test.go4
-rw-r--r--pkg/trillian/util.go16
-rw-r--r--pkg/types/ascii.go7
-rw-r--r--pkg/types/ascii_test.go6
-rw-r--r--pkg/types/types_test.go18
16 files changed, 51 insertions, 52 deletions
diff --git a/pkg/instance/endpoint.go b/pkg/instance/endpoint.go
index 5085c49..ec87303 100644
--- a/pkg/instance/endpoint.go
+++ b/pkg/instance/endpoint.go
@@ -1,4 +1,4 @@
-package stfe
+package instance
import (
"context"
diff --git a/pkg/instance/endpoint_test.go b/pkg/instance/endpoint_test.go
index fabf2e9..b138936 100644
--- a/pkg/instance/endpoint_test.go
+++ b/pkg/instance/endpoint_test.go
@@ -1,4 +1,4 @@
-package stfe
+package instance
import (
//"reflect"
@@ -11,8 +11,8 @@ import (
"testing"
"github.com/golang/mock/gomock"
- "github.com/system-transparency/stfe/pkg/mocks"
- "github.com/system-transparency/stfe/pkg/types"
+ "golang.sigsum.org/sigsum-log-go/pkg/mocks"
+ "golang.sigsum.org/sigsum-log-go/pkg/types"
)
var (
@@ -60,7 +60,7 @@ func TestAddLeaf(t *testing.T) {
"%s%s%s%s"+"%s%s%s%s"+"%s%s%s%s"+"%s%s%s%s"+"%s%s%s%s",
types.ShardHint, types.Delim, "0", types.EOL,
types.Checksum, types.Delim, "0000000000000000000000000000000000000000000000000000000000000000", types.EOL,
- types.SignatureOverMessage, types.Delim, "4cb410a4d48f52f761a7c01abcc28fd71811b84ded5403caed5e21b374f6aac9637cecd36828f17529fd503413d30ab66d7bb37a31dbf09a90d23b9241c45009", types.EOL,
+ types.Signature, types.Delim, "4cb410a4d48f52f761a7c01abcc28fd71811b84ded5403caed5e21b374f6aac9637cecd36828f17529fd503413d30ab66d7bb37a31dbf09a90d23b9241c45009", types.EOL,
types.VerificationKey, types.Delim, "f2b7a00b625469d32502e06e8b7fad1ef258d4ad0c6cd87b846142ab681957d5", types.EOL,
types.DomainHint, types.Delim, "example.com", types.EOL,
))
@@ -83,7 +83,7 @@ func TestAddLeaf(t *testing.T) {
"%s%s%s%s"+"%s%s%s%s"+"%s%s%s%s"+"%s%s%s%s"+"%s%s%s%s",
types.ShardHint, types.Delim, "1", types.EOL,
types.Checksum, types.Delim, "1111111111111111111111111111111111111111111111111111111111111111", types.EOL,
- types.SignatureOverMessage, types.Delim, "4cb410a4d48f52f761a7c01abcc28fd71811b84ded5403caed5e21b374f6aac9637cecd36828f17529fd503413d30ab66d7bb37a31dbf09a90d23b9241c45009", types.EOL,
+ types.Signature, types.Delim, "4cb410a4d48f52f761a7c01abcc28fd71811b84ded5403caed5e21b374f6aac9637cecd36828f17529fd503413d30ab66d7bb37a31dbf09a90d23b9241c45009", types.EOL,
types.VerificationKey, types.Delim, "f2b7a00b625469d32502e06e8b7fad1ef258d4ad0c6cd87b846142ab681957d5", types.EOL,
types.DomainHint, types.Delim, "example.com", types.EOL,
)),
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go
index 536eb60..87a0c36 100644
--- a/pkg/instance/instance.go
+++ b/pkg/instance/instance.go
@@ -1,4 +1,4 @@
-package stfe
+package instance
import (
"context"
@@ -9,9 +9,9 @@ import (
"time"
"github.com/golang/glog"
- "github.com/system-transparency/stfe/pkg/state"
- "github.com/system-transparency/stfe/pkg/trillian"
- "github.com/system-transparency/stfe/pkg/types"
+ "golang.sigsum.org/sigsum-log-go/pkg/state"
+ "golang.sigsum.org/sigsum-log-go/pkg/trillian"
+ "golang.sigsum.org/sigsum-log-go/pkg/types"
)
// Config is a collection of log parameters
@@ -36,7 +36,7 @@ type Instance struct {
}
// Handler implements the http.Handler interface, and contains a reference
-// to an STFE server instance as well as a function that uses it.
+// to a sigsum server instance as well as a function that uses it.
type Handler struct {
Instance *Instance
Endpoint types.Endpoint
@@ -44,7 +44,7 @@ type Handler struct {
Handler func(context.Context, *Instance, http.ResponseWriter, *http.Request) (int, error)
}
-// Handlers returns a list of STFE handlers
+// Handlers returns a list of sigsum handlers
func (i *Instance) Handlers() []Handler {
return []Handler{
Handler{Instance: i, Handler: addLeaf, Endpoint: types.EndpointAddLeaf, Method: http.MethodPost},
@@ -60,7 +60,7 @@ func (i *Instance) Handlers() []Handler {
// Path returns a path that should be configured for this handler
func (h Handler) Path() string {
- return h.Endpoint.Path(h.Instance.Prefix, "st", "v0")
+ return h.Endpoint.Path(h.Instance.Prefix, "sigsum", "v0")
}
// ServeHTTP is part of the http.Handler interface
diff --git a/pkg/instance/instance_test.go b/pkg/instance/instance_test.go
index f864628..1eba2bf 100644
--- a/pkg/instance/instance_test.go
+++ b/pkg/instance/instance_test.go
@@ -1,11 +1,11 @@
-package stfe
+package instance
import (
"net/http"
"net/http/httptest"
"testing"
- "github.com/system-transparency/stfe/pkg/types"
+ "golang.sigsum.org/sigsum-log-go/pkg/types"
)
// TestHandlers check that the expected handlers are configured
@@ -74,7 +74,7 @@ func TestPath(t *testing.T) {
Endpoint: types.EndpointAddLeaf,
Method: http.MethodPost,
}
- if got, want := handler.Path(), "testonly/st/v0/add-leaf"; got != want {
+ if got, want := handler.Path(), "testonly/sigsum/v0/add-leaf"; got != want {
t.Errorf("got path %v but wanted %v", got, want)
}
}
diff --git a/pkg/instance/metric.go b/pkg/instance/metric.go
index db11bd2..cbd0223 100644
--- a/pkg/instance/metric.go
+++ b/pkg/instance/metric.go
@@ -1,4 +1,4 @@
-package stfe
+package instance
import (
"github.com/google/trillian/monitoring"
diff --git a/pkg/mocks/state.go b/pkg/mocks/sigsum_state_manager.go
index 41d8d08..b999677 100644
--- a/pkg/mocks/state.go
+++ b/pkg/mocks/sigsum_state_manager.go
@@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT.
-// Source: github.com/system-transparency/stfe/pkg/state (interfaces: StateManager)
+// Source: golang.sigsum.org/sigsum-log-go/pkg/state (interfaces: StateManager)
// Package mocks is a generated GoMock package.
package mocks
@@ -9,7 +9,7 @@ import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
- types "github.com/system-transparency/stfe/pkg/types"
+ types "golang.sigsum.org/sigsum-log-go/pkg/types"
)
// MockStateManager is a mock of StateManager interface.
diff --git a/pkg/mocks/stfe.go b/pkg/mocks/sigsum_trillian_client.go
index def5bc6..cc5f8af 100644
--- a/pkg/mocks/stfe.go
+++ b/pkg/mocks/sigsum_trillian_client.go
@@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT.
-// Source: github.com/system-transparency/stfe/trillian (interfaces: Client)
+// Source: golang.sigsum.org/sigsum-log-go/pkg/trillian (interfaces: Client)
// Package mocks is a generated GoMock package.
package mocks
@@ -9,7 +9,7 @@ import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
- types "github.com/system-transparency/stfe/pkg/types"
+ types "golang.sigsum.org/sigsum-log-go/pkg/types"
)
// MockClient is a mock of Client interface.
diff --git a/pkg/mocks/trillian.go b/pkg/mocks/trillian_log_client.go
index 8aa3a58..8aa3a58 100644
--- a/pkg/mocks/trillian.go
+++ b/pkg/mocks/trillian_log_client.go
diff --git a/pkg/state/state_manager.go b/pkg/state/state_manager.go
index dfa73f4..7ddf986 100644
--- a/pkg/state/state_manager.go
+++ b/pkg/state/state_manager.go
@@ -10,8 +10,8 @@ import (
"github.com/golang/glog"
"github.com/google/certificate-transparency-go/schedule"
- "github.com/system-transparency/stfe/pkg/trillian"
- "github.com/system-transparency/stfe/pkg/types"
+ "golang.sigsum.org/sigsum-log-go/pkg/trillian"
+ "golang.sigsum.org/sigsum-log-go/pkg/types"
)
// StateManager coordinates access to the log's tree heads and (co)signatures
diff --git a/pkg/state/state_manager_test.go b/pkg/state/state_manager_test.go
index 08990cc..acc2319 100644
--- a/pkg/state/state_manager_test.go
+++ b/pkg/state/state_manager_test.go
@@ -12,8 +12,8 @@ import (
"time"
"github.com/golang/mock/gomock"
- "github.com/system-transparency/stfe/pkg/mocks"
- "github.com/system-transparency/stfe/pkg/types"
+ "golang.sigsum.org/sigsum-log-go/pkg/mocks"
+ "golang.sigsum.org/sigsum-log-go/pkg/types"
)
var (
diff --git a/pkg/trillian/client.go b/pkg/trillian/client.go
index 9523e56..2412074 100644
--- a/pkg/trillian/client.go
+++ b/pkg/trillian/client.go
@@ -7,7 +7,7 @@ import (
"github.com/golang/glog"
"github.com/google/trillian"
ttypes "github.com/google/trillian/types"
- "github.com/system-transparency/stfe/pkg/types"
+ "golang.sigsum.org/sigsum-log-go/pkg/types"
"google.golang.org/grpc/codes"
)
diff --git a/pkg/trillian/client_test.go b/pkg/trillian/client_test.go
index 6b3d881..70dbd39 100644
--- a/pkg/trillian/client_test.go
+++ b/pkg/trillian/client_test.go
@@ -9,8 +9,8 @@ import (
"github.com/golang/mock/gomock"
"github.com/google/trillian"
ttypes "github.com/google/trillian/types"
- "github.com/system-transparency/stfe/pkg/mocks"
- "github.com/system-transparency/stfe/pkg/types"
+ "golang.sigsum.org/sigsum-log-go/pkg/mocks"
+ "golang.sigsum.org/sigsum-log-go/pkg/types"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
diff --git a/pkg/trillian/util.go b/pkg/trillian/util.go
index 4cf31fb..6de78f7 100644
--- a/pkg/trillian/util.go
+++ b/pkg/trillian/util.go
@@ -4,12 +4,12 @@ import (
"fmt"
trillian "github.com/google/trillian/types"
- siglog "github.com/system-transparency/stfe/pkg/types"
+ sigsum "golang.sigsum.org/sigsum-log-go/pkg/types"
)
-func treeHeadFromLogRoot(lr *trillian.LogRootV1) *siglog.TreeHead {
- var hash [siglog.HashSize]byte
- th := siglog.TreeHead{
+func treeHeadFromLogRoot(lr *trillian.LogRootV1) *sigsum.TreeHead {
+ var hash [sigsum.HashSize]byte
+ th := sigsum.TreeHead{
Timestamp: uint64(lr.TimestampNanos / 1000 / 1000 / 1000),
TreeSize: uint64(lr.TreeSize),
RootHash: &hash,
@@ -18,14 +18,14 @@ func treeHeadFromLogRoot(lr *trillian.LogRootV1) *siglog.TreeHead {
return &th
}
-func nodePathFromHashes(hashes [][]byte) ([]*[siglog.HashSize]byte, error) {
- var path []*[siglog.HashSize]byte
+func nodePathFromHashes(hashes [][]byte) ([]*[sigsum.HashSize]byte, error) {
+ var path []*[sigsum.HashSize]byte
for _, hash := range hashes {
- if len(hash) != siglog.HashSize {
+ if len(hash) != sigsum.HashSize {
return nil, fmt.Errorf("unexpected hash length: %v", len(hash))
}
- var h [siglog.HashSize]byte
+ var h [sigsum.HashSize]byte
copy(h[:], hash)
path = append(path, &h)
}
diff --git a/pkg/types/ascii.go b/pkg/types/ascii.go
index d27d79b..7643ab1 100644
--- a/pkg/types/ascii.go
+++ b/pkg/types/ascii.go
@@ -30,7 +30,7 @@ const (
// New leaf keys
ShardHint = "shard_hint"
Checksum = "checksum"
- SignatureOverMessage = "signature_over_message"
+ Signature = "signature"
VerificationKey = "verification_key"
DomainHint = "domain_hint"
@@ -54,7 +54,6 @@ const (
RootHash = "root_hash"
// Signature and signer-identity keys
- Signature = "signature"
KeyHash = "key_hash"
)
@@ -201,7 +200,7 @@ func (l *Leaf) MarshalASCII(w io.Writer) error {
if err := writeASCII(w, Checksum, hex.EncodeToString(l.Checksum[:])); err != nil {
return fmt.Errorf("writeASCII: %v", err)
}
- if err := writeASCII(w, SignatureOverMessage, hex.EncodeToString(l.Signature[:])); err != nil {
+ if err := writeASCII(w, Signature, hex.EncodeToString(l.Signature[:])); err != nil {
return fmt.Errorf("writeASCII: %v", err)
}
if err := writeASCII(w, KeyHash, hex.EncodeToString(l.KeyHash[:])); err != nil {
@@ -393,7 +392,7 @@ func (req *LeafRequest) UnmarshalASCII(r io.Reader) error {
if req.Checksum, err = msg.GetHash(Checksum); err != nil {
return fmt.Errorf("GetHash(Checksum): %v", err)
}
- if req.Signature, err = msg.GetSignature(SignatureOverMessage); err != nil {
+ if req.Signature, err = msg.GetSignature(Signature); err != nil {
return fmt.Errorf("GetSignature: %v", err)
}
if req.VerificationKey, err = msg.GetVerificationKey(VerificationKey); err != nil {
diff --git a/pkg/types/ascii_test.go b/pkg/types/ascii_test.go
index 92732f9..74a1e37 100644
--- a/pkg/types/ascii_test.go
+++ b/pkg/types/ascii_test.go
@@ -106,12 +106,12 @@ func TestLeafMarshalASCII(t *testing.T) {
// Leaf 1
ShardHint, Delim, 123, EOL,
Checksum, Delim, testBuffer32[:], EOL,
- SignatureOverMessage, Delim, testBuffer64[:], EOL,
+ Signature, Delim, testBuffer64[:], EOL,
KeyHash, Delim, testBuffer32[:], EOL,
// Leaf 2
ShardHint, Delim, 456, EOL,
Checksum, Delim, testBuffer32[:], EOL,
- SignatureOverMessage, Delim, testBuffer64[:], EOL,
+ Signature, Delim, testBuffer64[:], EOL,
KeyHash, Delim, testBuffer32[:], EOL,
))
buf := bytes.NewBuffer(nil)
@@ -399,7 +399,7 @@ func TestLeafRequestUnmarshalASCII(t *testing.T) {
"%s%s%d%s"+"%s%s%x%s"+"%s%s%x%s"+"%s%s%x%s"+"%s%s%s%s",
ShardHint, Delim, 123, EOL,
Checksum, Delim, testBuffer32[:], EOL,
- SignatureOverMessage, Delim, testBuffer64[:], EOL,
+ Signature, Delim, testBuffer64[:], EOL,
VerificationKey, Delim, testBuffer32[:], EOL,
DomainHint, Delim, "example.com", EOL,
)),
diff --git a/pkg/types/types_test.go b/pkg/types/types_test.go
index da89c59..a71d14b 100644
--- a/pkg/types/types_test.go
+++ b/pkg/types/types_test.go
@@ -5,42 +5,42 @@ import (
)
func TestEndpointPath(t *testing.T) {
- base, prefix, proto := "example.com", "log", "st/v0"
+ base, prefix, proto := "example.com", "log", "sigsum/v0"
for _, table := range []struct {
endpoint Endpoint
want string
}{
{
endpoint: EndpointAddLeaf,
- want: "example.com/log/st/v0/add-leaf",
+ want: "example.com/log/sigsum/v0/add-leaf",
},
{
endpoint: EndpointAddCosignature,
- want: "example.com/log/st/v0/add-cosignature",
+ want: "example.com/log/sigsum/v0/add-cosignature",
},
{
endpoint: EndpointGetTreeHeadLatest,
- want: "example.com/log/st/v0/get-tree-head-latest",
+ want: "example.com/log/sigsum/v0/get-tree-head-latest",
},
{
endpoint: EndpointGetTreeHeadToSign,
- want: "example.com/log/st/v0/get-tree-head-to-sign",
+ want: "example.com/log/sigsum/v0/get-tree-head-to-sign",
},
{
endpoint: EndpointGetTreeHeadCosigned,
- want: "example.com/log/st/v0/get-tree-head-cosigned",
+ want: "example.com/log/sigsum/v0/get-tree-head-cosigned",
},
{
endpoint: EndpointGetConsistencyProof,
- want: "example.com/log/st/v0/get-consistency-proof",
+ want: "example.com/log/sigsum/v0/get-consistency-proof",
},
{
endpoint: EndpointGetProofByHash,
- want: "example.com/log/st/v0/get-proof-by-hash",
+ want: "example.com/log/sigsum/v0/get-proof-by-hash",
},
{
endpoint: EndpointGetLeaves,
- want: "example.com/log/st/v0/get-leaves",
+ want: "example.com/log/sigsum/v0/get-leaves",
},
} {
if got, want := table.endpoint.Path(base+"/"+prefix+"/"+proto), table.want; got != want {