Skip to content
Merged
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
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/streamingfast/logging v0.0.0-20220304214715-bc750a74b424
github.com/streamingfast/sf-tracing v0.0.0-20240209202324-9daa52c71a52
github.com/stretchr/testify v1.11.1
github.com/test-go/testify v1.1.4
go.uber.org/zap v1.21.0
google.golang.org/grpc v1.77.0
google.golang.org/protobuf v1.36.10
Expand Down
7 changes: 5 additions & 2 deletions middleware/connect/authentication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package server
import (
"context"
"net/http"
"strings"
"testing"

"github.com/streamingfast/dauth"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/test-go/testify/assert"
)

type testAuthenticators struct {
Expand All @@ -22,7 +23,9 @@ func (t testAuthenticators) Ready(_ context.Context) bool {
func (t testAuthenticators) Authenticate(ctx context.Context, path string, headers map[string][]string, ipAddress string) (context.Context, error) {
out := make(dauth.TrustedHeaders)
for key, values := range headers {
out[key] = values[0]
// Lower-case like real authenticators do, otherwise "X-SUBSTREAMS-Ll" and "x-substreams-ll"
// collide in [dauth.WithTrustedHeaders] and the winner depends on map iteration order.
out[strings.ToLower(key)] = values[0]
}
out["x-substreams-ll"] = "987"
out["x-user-id"] = "a1b2c3"
Expand Down
Loading