Skip to content

Commit

Permalink
chore: fix compile and lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Sep 7, 2022
1 parent a28bcf1 commit 81503e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions client/sdk_test.go
Expand Up @@ -253,7 +253,7 @@ func TestClientSDK(t *testing.T) {
expected := deepcopy.Copy(client).(*models.OAuth2Client)
expected.RedirectUris = append(expected.RedirectUris, value)

result, err := c.Admin.PatchOAuth2Client(admin.NewPatchOAuth2ClientParams().WithID(client.ClientID).WithBody(models.PatchRequest{{Op: &op, Path: &path, Value: value}}))
result, err := c.Admin.PatchOAuth2Client(admin.NewPatchOAuth2ClientParams().WithID(client.ClientID).WithBody(models.JSONPatchDocument{{Op: &op, Path: &path, Value: value}}))
require.NoError(t, err)
expected.CreatedAt = result.Payload.CreatedAt
expected.UpdatedAt = result.Payload.UpdatedAt
Expand All @@ -272,7 +272,7 @@ func TestClientSDK(t *testing.T) {
_, err := c.Admin.CreateOAuth2Client(admin.NewCreateOAuth2ClientParams().WithBody(client))
require.NoError(t, err)

_, err = c.Admin.PatchOAuth2Client(admin.NewPatchOAuth2ClientParams().WithID(client.ClientID).WithBody(models.PatchRequest{{Op: &op, Path: &path, Value: value}}))
_, err = c.Admin.PatchOAuth2Client(admin.NewPatchOAuth2ClientParams().WithID(client.ClientID).WithBody(models.JSONPatchDocument{{Op: &op, Path: &path, Value: value}}))
require.Error(t, err)
})

Expand All @@ -286,9 +286,9 @@ func TestClientSDK(t *testing.T) {
_, err := c.Admin.CreateOAuth2Client(admin.NewCreateOAuth2ClientParams().WithBody(client))
require.NoError(t, err)

result1, err := c.Admin.PatchOAuth2Client(admin.NewPatchOAuth2ClientParams().WithID(client.ClientID).WithBody(models.PatchRequest{{Op: &op, Path: &path, Value: value}}))
result1, err := c.Admin.PatchOAuth2Client(admin.NewPatchOAuth2ClientParams().WithID(client.ClientID).WithBody(models.JSONPatchDocument{{Op: &op, Path: &path, Value: value}}))
require.NoError(t, err)
result2, err := c.Admin.PatchOAuth2Client(admin.NewPatchOAuth2ClientParams().WithID(client.ClientID).WithBody(models.PatchRequest{{Op: &op, Path: &path, Value: value}}))
result2, err := c.Admin.PatchOAuth2Client(admin.NewPatchOAuth2ClientParams().WithID(client.ClientID).WithBody(models.JSONPatchDocument{{Op: &op, Path: &path, Value: value}}))
require.NoError(t, err)

// secret hashes shouldn't change between these PUT calls
Expand Down
4 changes: 2 additions & 2 deletions cmd/server/handler.go
Expand Up @@ -311,12 +311,12 @@ func serve(

var tlsConfig *tls.Config
if tc := d.Config().TLS(ctx, iface); tc.Enabled() && len(tc.AllowTerminationFrom()) == 0 {
// #nosec G402 - This is a false positive because we use graceful.WithDefaults which sets the correct TLS settings.
tlsConfig = &tls.Config{Certificates: GetOrCreateTLSCertificate(ctx, cmd, d, iface)}
}

var srv = graceful.WithDefaults(&http.Server{
Handler: handler,
// #nosec G402 - This is a false positive because we use graceful.WithDefaults which sets the correct TLS settings.
Handler: handler,
TLSConfig: tlsConfig,
})

Expand Down

0 comments on commit 81503e0

Please sign in to comment.