Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: notfromstatefarm <86763948+notfromstatefarm@users.noreply.github.com>
  • Loading branch information
notfromstatefarm committed Jul 12, 2022
1 parent acbf027 commit c6ad8cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion util/dex/dex.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type DexTLSConfig struct {
}

func TLSConfig(tlsConfig *DexTLSConfig) *tls.Config {
if tlsConfig == nil {
if tlsConfig == nil || tlsConfig.DisableTLS {
return nil
}
if !tlsConfig.StrictValidation {
Expand Down
9 changes: 3 additions & 6 deletions util/oidc/oidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/argoproj/argo-cd/v2/server/settings/oidc"
"github.com/argoproj/argo-cd/v2/util"
"github.com/argoproj/argo-cd/v2/util/crypto"
"github.com/argoproj/argo-cd/v2/util/dex"
"github.com/argoproj/argo-cd/v2/util/settings"
"github.com/argoproj/argo-cd/v2/util/test"
)
Expand Down Expand Up @@ -178,9 +179,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),
t.Fatal("did not receive expected certificate verification failure error")
}

cdSettings.OIDCTLSInsecureSkipVerify = true

app, err = NewClientApp(cdSettings, dexTestServer.URL, nil, "https://argocd.example.com")
app, err = NewClientApp(cdSettings, dexTestServer.URL, &dex.DexTLSConfig{StrictValidation: false}, "https://argocd.example.com")
require.NoError(t, err)

w = httptest.NewRecorder()
Expand Down Expand Up @@ -262,9 +261,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),
t.Fatal("did not receive expected certificate verification failure error")
}

cdSettings.OIDCTLSInsecureSkipVerify = true

app, err = NewClientApp(cdSettings, dexTestServer.URL, nil, "https://argocd.example.com")
app, err = NewClientApp(cdSettings, dexTestServer.URL, &dex.DexTLSConfig{StrictValidation: false}, "https://argocd.example.com")
require.NoError(t, err)

w = httptest.NewRecorder()
Expand Down

0 comments on commit c6ad8cb

Please sign in to comment.