Skip to content

Commit

Permalink
fix(app): ignore tink crypto proto from checks at app init
Browse files Browse the repository at this point in the history
  • Loading branch information
amimart authored and ccamel committed Feb 14, 2024
1 parent 993bd68 commit aa36819
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"os"
"path/filepath"
"slices"
"sort"
"strings"

Expand All @@ -20,6 +21,8 @@ import (
"github.com/ignite/cli/ignite/pkg/openapiconsole"
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/cast"
"google.golang.org/protobuf/reflect/protodesc"
"google.golang.org/protobuf/types/descriptorpb"

abci "github.com/cometbft/cometbft/abci/types"
tmos "github.com/cometbft/cometbft/libs/os"
Expand Down Expand Up @@ -858,8 +861,17 @@ func New(
app.setPostHandler()

// At startup, after all modules have been registered, check that all proto
// annotations are correct.
protoFiles, err := proto.MergedRegistry()
// annotations are correct, ignoring `google.crypto.tink`.
fds, err := proto.MergedGlobalFileDescriptors()
if err != nil {
panic(err)
}
fds = &descriptorpb.FileDescriptorSet{
File: slices.DeleteFunc(fds.File, func(e *descriptorpb.FileDescriptorProto) bool {
return e.GetPackage() == "google.crypto.tink"
}),
}
protoFiles, err := protodesc.NewFiles(fds)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ require (
github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
github.com/google/tink/go v1.7.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/hashicorp/go-metrics v0.5.3
github.com/hyperledger/aries-framework-go v0.3.2
Expand Down Expand Up @@ -152,6 +151,7 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/tink/go v1.7.0 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
Expand Down

0 comments on commit aa36819

Please sign in to comment.