Skip to content

Commit 973f0e6

Browse files
committed
's|github.com/transparency-dev/trillian-tessera/personalities/sctfe|github.com/transparency-dev/static-ct|g'
1 parent 7bba8ca commit 973f0e6

15 files changed

+46
-32
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To re-generate these files, first install the right tools:
2727

2828
Then, generate the files:
2929
```bash
30-
cd $(go list -f '{{ .Dir }}' github.com/transparency-dev/trillian-tessera/personalities/sctfe); \
30+
cd $(go list -f '{{ .Dir }}' github.com/transparency-dev/static-ct); \
3131
go generate -x ./... # hunts for //go:generate comments and runs them
3232
```
3333

cert_checker_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/google/certificate-transparency-go/x509"
2626
"github.com/google/certificate-transparency-go/x509/pkix"
2727
"github.com/google/certificate-transparency-go/x509util"
28-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe/testdata"
28+
"github.com/transparency-dev/static-ct/testdata"
2929
)
3030

3131
func wipeExtensions(cert *x509.Certificate) *x509.Certificate {

ct_server_gcp/main.go

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ import (
3434
"github.com/prometheus/client_golang/prometheus/promhttp"
3535
"github.com/rs/cors"
3636
tessera "github.com/transparency-dev/trillian-tessera"
37-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe"
38-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe/modules/dedup"
39-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe/storage/bbolt"
40-
gcpSCTFE "github.com/transparency-dev/trillian-tessera/personalities/sctfe/storage/gcp"
37+
"github.com/transparency-dev/static-ct"
38+
"github.com/transparency-dev/static-ct/modules/dedup"
39+
"github.com/transparency-dev/static-ct/storage/bbolt"
40+
gcpSCTFE "github.com/transparency-dev/static-ct/storage/gcp"
4141
gcpTessera "github.com/transparency-dev/trillian-tessera/storage/gcp"
4242
"golang.org/x/mod/sumdb/note"
4343
"k8s.io/klog/v2"
@@ -111,22 +111,16 @@ func main() {
111111

112112
// Register handlers for all the configured logs using the correct RPC
113113
// client.
114-
opts := sctfe.InstanceOptions{
115-
Validated: vCfg,
116-
Deadline: *rpcDeadline,
117-
MetricFactory: prometheus.MetricFactory{},
118-
RequestLog: new(sctfe.DefaultRequestLog),
119-
MaskInternalErrors: *maskInternalErrors,
120-
CreateStorage: newGCPStorage,
121-
}
122-
123-
inst, err := sctfe.SetUpInstance(ctx, opts)
114+
// TODO(phboneff): setupAndRegister can probably be inlined / removed later
115+
_, err = setupAndRegister(ctx,
116+
*rpcDeadline,
117+
vCfg,
118+
corsMux,
119+
*maskInternalErrors,
120+
)
124121
if err != nil {
125122
klog.Exitf("Failed to set up log instance for %+v: %v", vCfg, err)
126123
}
127-
for path, handler := range inst.Handlers {
128-
corsMux.Handle(path, handler)
129-
}
130124

131125
// Return a 200 on the root, for GCE default health checking :/
132126
corsMux.HandleFunc("/", func(resp http.ResponseWriter, req *http.Request) {
@@ -227,6 +221,26 @@ func awaitSignal(doneFn func()) {
227221
doneFn()
228222
}
229223

224+
func setupAndRegister(ctx context.Context, deadline time.Duration, vCfg *sctfe.ValidatedLogConfig, mux *http.ServeMux, maskInternalErrors bool) (*sctfe.Instance, error) {
225+
opts := sctfe.InstanceOptions{
226+
Validated: vCfg,
227+
Deadline: deadline,
228+
MetricFactory: prometheus.MetricFactory{},
229+
RequestLog: new(sctfe.DefaultRequestLog),
230+
MaskInternalErrors: maskInternalErrors,
231+
CreateStorage: newGCPStorage,
232+
}
233+
234+
inst, err := sctfe.SetUpInstance(ctx, opts)
235+
if err != nil {
236+
return nil, err
237+
}
238+
for path, handler := range inst.Handlers {
239+
mux.Handle(path, handler)
240+
}
241+
return inst, nil
242+
}
243+
230244
func newGCPStorage(ctx context.Context, signer note.Signer) (*sctfe.CTStorage, error) {
231245
gcpCfg := gcpTessera.Config{
232246
ProjectID: *projectID,

handlers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ import (
3636
"github.com/google/go-cmp/cmp/cmpopts"
3737
"github.com/google/trillian/monitoring"
3838
"github.com/transparency-dev/trillian-tessera/ctonly"
39-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe/mockstorage"
40-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe/testdata"
39+
"github.com/transparency-dev/static-ct/mockstorage"
40+
"github.com/transparency-dev/static-ct/testdata"
4141
"google.golang.org/grpc/codes"
4242
"google.golang.org/grpc/status"
4343
"google.golang.org/protobuf/proto"

instance_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func TestSetUpInstanceSetsValidationOpts(t *testing.T) {
199199

200200
signer, err := pem.ReadPrivateKeyFile("./testdata/ct-http-server.privkey.pem", "dirk")
201201
if err != nil {
202-
t.Fatalf(fmt.Sprintf("Can't open key: %v", err))
202+
t.Fatalf("Can't open key: %v", err)
203203
}
204204

205205
var tests = []struct {

mockstorage/gen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
// Package mockclient provides a mockable version of the Trillian log client API.
1616
package mockstorage
1717

18-
//go:generate mockgen -package mockstorage -destination mock_ct_storage.go github.com/transparency-dev/trillian-tessera/personalities/sctfe Storage
18+
//go:generate mockgen -package mockstorage -destination mock_ct_storage.go github.com/transparency-dev/static-ct Storage

mockstorage/mock_ct_storage.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto_gen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
package sctfe
55

6-
//go:generate sh -c "protoc -I=. -I$(go list -f '{{ .Dir }}' github.com/google/trillian) -I$(go list -f '{{ .Dir }}' github.com/transparency-dev/trillian-tessera/personalities/sctfe) --go_out=paths=source_relative:. configpb/config.proto"
6+
//go:generate sh -c "protoc -I=. -I$(go list -f '{{ .Dir }}' github.com/google/trillian) -I$(go list -f '{{ .Dir }}' github.com/transparency-dev/static-ct) --go_out=paths=source_relative:. configpb/config.proto"

serialize.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"github.com/google/certificate-transparency-go/tls"
2626
"github.com/transparency-dev/formats/log"
27-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe/modules/dedup"
27+
"github.com/transparency-dev/static-ct/modules/dedup"
2828
"golang.org/x/crypto/cryptobyte"
2929
"golang.org/x/mod/sumdb/note"
3030

serialize_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/google/certificate-transparency-go/x509"
2424
"github.com/google/certificate-transparency-go/x509util"
2525
"github.com/kylelemons/godebug/pretty"
26-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe/testdata"
26+
"github.com/transparency-dev/static-ct/testdata"
2727

2828
ct "github.com/google/certificate-transparency-go"
2929
)

storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/google/certificate-transparency-go/x509"
2525
tessera "github.com/transparency-dev/trillian-tessera"
2626
"github.com/transparency-dev/trillian-tessera/ctonly"
27-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe/modules/dedup"
27+
"github.com/transparency-dev/static-ct/modules/dedup"
2828
"k8s.io/klog/v2"
2929
)
3030

storage/bbolt/dedup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
"encoding/hex"
3232
"fmt"
3333

34-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe/modules/dedup"
34+
"github.com/transparency-dev/static-ct/modules/dedup"
3535

3636
bolt "go.etcd.io/bbolt"
3737
"k8s.io/klog/v2"

storage/gcp/dedup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020

2121
"cloud.google.com/go/spanner"
2222
"cloud.google.com/go/spanner/apiv1/spannerpb"
23-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe/modules/dedup"
23+
"github.com/transparency-dev/static-ct/modules/dedup"
2424
"google.golang.org/grpc/codes"
2525
)
2626

storage/gcp/issuers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"path"
2222

2323
gcs "cloud.google.com/go/storage"
24-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe"
24+
"github.com/transparency-dev/static-ct"
2525
"google.golang.org/api/googleapi"
2626
"google.golang.org/api/iterator"
2727
"k8s.io/klog/v2"

structures_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"testing"
2222
"time"
2323

24-
"github.com/transparency-dev/trillian-tessera/personalities/sctfe/testdata"
24+
"github.com/transparency-dev/static-ct/testdata"
2525
)
2626

2727
var (

0 commit comments

Comments
 (0)