From 13eaddb7babe630750361c6d8f3ffc736898ddec Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Tue, 19 Jul 2022 16:36:31 +0200 Subject: [PATCH] fix: mark gosec false positives --- internal/testhelpers/selfservice_settings.go | 1 + selfservice/strategy/oidc/strategy_helper_test.go | 1 + test/e2e/hydra-login-consent/main.go | 1 + 3 files changed, 3 insertions(+) diff --git a/internal/testhelpers/selfservice_settings.go b/internal/testhelpers/selfservice_settings.go index 254485c53bf1..51e0a7ae88a4 100644 --- a/internal/testhelpers/selfservice_settings.go +++ b/internal/testhelpers/selfservice_settings.go @@ -190,6 +190,7 @@ func NewSettingsAPIServer(t *testing.T, reg *driver.RegistryDefault, ids map[str reg.Config(context.Background()).MustSet(config.ViperKeyPublicBaseURL, tsp.URL) reg.Config(context.Background()).MustSet(config.ViperKeyAdminBaseURL, tsa.URL) + // #nosec G112 return tsp, tsa, AddAndLoginIdentities(t, reg, &httptest.Server{Config: &http.Server{Handler: public}, URL: tsp.URL}, ids) } diff --git a/selfservice/strategy/oidc/strategy_helper_test.go b/selfservice/strategy/oidc/strategy_helper_test.go index 6190b44eaf39..8fd37ee5b838 100644 --- a/selfservice/strategy/oidc/strategy_helper_test.go +++ b/selfservice/strategy/oidc/strategy_helper_test.go @@ -152,6 +152,7 @@ func newHydraIntegration(t *testing.T, remote *string, subject *string, claims * parsed, err := url.ParseRequestURI(addr) require.NoError(t, err) + // #nosec G112 server := &http.Server{Addr: ":" + parsed.Port(), Handler: router} go func(t *testing.T) { if err := server.ListenAndServe(); err != http.ErrServerClosed { diff --git a/test/e2e/hydra-login-consent/main.go b/test/e2e/hydra-login-consent/main.go index 14d3f9885bce..facc10efadf7 100644 --- a/test/e2e/hydra-login-consent/main.go +++ b/test/e2e/hydra-login-consent/main.go @@ -158,6 +158,7 @@ func main() { }) addr := ":" + osx.GetenvDefault("PORT", "4446") + // #nosec G112 server := &http.Server{Addr: addr, Handler: router} fmt.Printf("Starting web server at %s\n", addr) check(server.ListenAndServe())