Skip to content

Commit

Permalink
fix: make staticheck happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Stockton committed Feb 6, 2025
1 parent 911954c commit 9b3a1d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
6 changes: 3 additions & 3 deletions internal/conf/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,15 +874,15 @@ func TestMethods(t *testing.T) {
}

got := val.AllAllowedHeaders(nil)
sort.Sort(sort.StringSlice(got))
sort.Strings(got)
require.Equal(t, []string{"X-Test1"}, got)

got = val.AllAllowedHeaders([]string{"X-Test2"})
sort.Sort(sort.StringSlice(got))
sort.Strings(got)
require.Equal(t, []string{"X-Test1", "X-Test2"}, got)

val.AllowedHeaders = nil
sort.Sort(sort.StringSlice(got))
sort.Strings(got)
got = val.AllAllowedHeaders([]string{"X-Test2"})
require.Equal(t, []string{"X-Test2"}, got)

Expand Down
7 changes: 1 addition & 6 deletions internal/conf/jwk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,6 @@ func TestJWTConfiguration(t *testing.T) {
}
}

func helpToJSON(t *testing.T, v any) string {
b, err := json.Marshal(v)
require.NoError(t, err)
return string(b)
}

func helpToMap(t *testing.T, str string) map[string]map[string]interface{} {
out := make(map[string]map[string]interface{})

Expand All @@ -420,6 +414,7 @@ func helpToMockKey(t *testing.T, mockErr error) *mockKey {
require.NoError(t, err)

privJwk, err := jwk.ParseKey(jwt)
require.NoError(t, err)
return &mockKey{Key: privJwk, err: mockErr}
}

Expand Down
4 changes: 2 additions & 2 deletions internal/conf/saml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestSAMLConfiguration(t *testing.T) {
err := c.PopulateFields("https://projectref.supabase.co")
require.NoError(t, err)

isSet := 0 != (c.Certificate.KeyUsage & x509.KeyUsageDataEncipherment)
isSet := (c.Certificate.KeyUsage & x509.KeyUsageDataEncipherment) != 0
require.False(t, isSet)
require.NotNil(t, c.RSAPrivateKey)
require.NotNil(t, c.RSAPublicKey)
Expand All @@ -60,7 +60,7 @@ func TestSAMLConfiguration(t *testing.T) {
err := c.PopulateFields("https://projectref.supabase.co")
require.NoError(t, err)

isSet := 0 != (c.Certificate.KeyUsage & x509.KeyUsageDataEncipherment)
isSet := (c.Certificate.KeyUsage & x509.KeyUsageDataEncipherment) != 0
require.True(t, isSet)
require.NotNil(t, c.RSAPrivateKey)
require.NotNil(t, c.RSAPublicKey)
Expand Down

0 comments on commit 9b3a1d1

Please sign in to comment.