Skip to content

Commit a1e95a6

Browse files
authored
Don't validate that the issuer bucket exists, and fail if it does not. (#31)
This allows to remove permissions from the service accounts running the binary.
1 parent 75cf6c0 commit a1e95a6

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

storage/gcp/issuers.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ import (
2121
"path"
2222

2323
gcs "cloud.google.com/go/storage"
24-
"github.com/transparency-dev/static-ct"
24+
sctfe "github.com/transparency-dev/static-ct"
2525
"google.golang.org/api/googleapi"
26-
"google.golang.org/api/iterator"
2726
"k8s.io/klog/v2"
2827
)
2928

@@ -43,19 +42,6 @@ func NewIssuerStorage(ctx context.Context, projectID string, bucket string, pref
4342
return nil, fmt.Errorf("failed to create GCS client: %v", err)
4443
}
4544

46-
it := c.Buckets(ctx, projectID)
47-
for {
48-
bAttrs, err := it.Next()
49-
if err == iterator.Done {
50-
return nil, fmt.Errorf("bucket %q does not exist, please create it", bucket)
51-
}
52-
if err != nil {
53-
return nil, fmt.Errorf("error scanning buckets: %v", err)
54-
}
55-
if bAttrs.Name == bucket {
56-
break
57-
}
58-
}
5945
r := &IssuersStorage{
6046
bucket: c.Bucket(bucket),
6147
prefix: prefix,

0 commit comments

Comments
 (0)