Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(fulcio): Fixes Witness #535 #402

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions signer/fulcio/fulcio.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,7 @@ func newClient(fulcioURL string, fulcioPort int, isInsecure bool) (fulciopb.CACl
creds := credentials.NewTLS(tlsConfig)

// Set up the gRPC dial options
dialOpts := []grpc.DialOption{
grpc.WithAuthority(u.Hostname()),
}

dialOpts := []grpc.DialOption{}
if isInsecure {
dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))
} else {
Expand Down
13 changes: 12 additions & 1 deletion signer/fulcio/fulcio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,19 @@ func TestSigner(t *testing.T) {
require.NotNil(t, signer)
provider = New(WithFulcioURL("https://test"), WithToken(token))
_, err = provider.Signer(ctx)

// A bad url is getting system-specific dns error messages
// This checks for one of those messages
dnsErrChecker := func(err error) bool {
if strings.Contains(err.Error(), "zero addresses") ||
strings.Contains(err.Error(), "record lookup error") {
return true
}
return false
}

//this should be a tranport err since we cant actually test on 443 which is the default
require.ErrorContains(t, err, "lookup test")
require.True(t, dnsErrChecker(err))

// Test signer with token read from file
// NOTE: this function could be refactored to accept a fileSystem or io.Reader so reading the file can be mocked,
Expand Down
Loading