Skip to content

Commit

Permalink
fix tests after merge
Browse files Browse the repository at this point in the history
Signed-off-by: notfromstatefarm <[email protected]>
  • Loading branch information
notfromstatefarm committed Jul 12, 2022
1 parent 6499bf8 commit acbf027
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions util/oidc/oidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ clientID: xxx
clientSecret: yyy
requestedScopes: ["oidc"]`, oidcTestServer.URL),
}
app, err := NewClientApp(cdSettings, dexTestServer.URL, "https://argocd.example.com")
app, err := NewClientApp(cdSettings, dexTestServer.URL, nil, "https://argocd.example.com")
require.NoError(t, err)

req := httptest.NewRequest("GET", "https://argocd.example.com/auth/login", nil)
Expand All @@ -140,7 +140,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),

cdSettings.OIDCTLSInsecureSkipVerify = true

app, err = NewClientApp(cdSettings, dexTestServer.URL, "https://argocd.example.com")
app, err = NewClientApp(cdSettings, dexTestServer.URL, nil, "https://argocd.example.com")
require.NoError(t, err)

w = httptest.NewRecorder()
Expand All @@ -165,7 +165,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),
require.NoError(t, err)
cdSettings.Certificate = &cert

app, err := NewClientApp(cdSettings, dexTestServer.URL, "https://argocd.example.com")
app, err := NewClientApp(cdSettings, dexTestServer.URL, nil, "https://argocd.example.com")
require.NoError(t, err)

req := httptest.NewRequest("GET", "https://argocd.example.com/auth/login", nil)
Expand All @@ -180,7 +180,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),

cdSettings.OIDCTLSInsecureSkipVerify = true

app, err = NewClientApp(cdSettings, dexTestServer.URL, "https://argocd.example.com")
app, err = NewClientApp(cdSettings, dexTestServer.URL, nil, "https://argocd.example.com")
require.NoError(t, err)

w = httptest.NewRecorder()
Expand Down Expand Up @@ -209,7 +209,7 @@ clientID: xxx
clientSecret: yyy
requestedScopes: ["oidc"]`, oidcTestServer.URL),
}
app, err := NewClientApp(cdSettings, dexTestServer.URL, "https://argocd.example.com")
app, err := NewClientApp(cdSettings, dexTestServer.URL, nil, "https://argocd.example.com")
require.NoError(t, err)

req := httptest.NewRequest("GET", "https://argocd.example.com/auth/callback", nil)
Expand All @@ -224,7 +224,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),

cdSettings.OIDCTLSInsecureSkipVerify = true

app, err = NewClientApp(cdSettings, dexTestServer.URL, "https://argocd.example.com")
app, err = NewClientApp(cdSettings, dexTestServer.URL, nil, "https://argocd.example.com")
require.NoError(t, err)

w = httptest.NewRecorder()
Expand All @@ -249,7 +249,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),
require.NoError(t, err)
cdSettings.Certificate = &cert

app, err := NewClientApp(cdSettings, dexTestServer.URL, "https://argocd.example.com")
app, err := NewClientApp(cdSettings, dexTestServer.URL, nil, "https://argocd.example.com")
require.NoError(t, err)

req := httptest.NewRequest("GET", "https://argocd.example.com/auth/callback", nil)
Expand All @@ -264,7 +264,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),

cdSettings.OIDCTLSInsecureSkipVerify = true

app, err = NewClientApp(cdSettings, dexTestServer.URL, "https://argocd.example.com")
app, err = NewClientApp(cdSettings, dexTestServer.URL, nil, "https://argocd.example.com")
require.NoError(t, err)

w = httptest.NewRecorder()
Expand Down Expand Up @@ -397,10 +397,10 @@ func TestGenerateAppState_XSS(t *testing.T) {
app, err := NewClientApp(
&settings.ArgoCDSettings{
// Only return URLs starting with this base should be allowed.
URL: "https://argocd.example.com",
URL: "https://argocd.example.com",
ServerSignature: signature,
},
"", "",
"", nil, "",
)
require.NoError(t, err)

Expand Down
12 changes: 6 additions & 6 deletions util/session/sessionmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ rootCA: |
}

settingsMgr := settings.NewSettingsManager(context.Background(), getKubeClientWithConfig(dexConfig, nil), "argocd")
mgr := NewSessionManager(settingsMgr, getProjLister(), "", NewUserStateStorage(nil))
mgr := NewSessionManager(settingsMgr, getProjLister(), "", nil, NewUserStateStorage(nil))
mgr.verificationDelayNoiseEnabled = false

claims := jwt.RegisteredClaims{Audience: jwt.ClaimStrings{"test-client"}, Subject: "admin", ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Hour * 24))}
Expand Down Expand Up @@ -575,7 +575,7 @@ rootCA: |
}

settingsMgr := settings.NewSettingsManager(context.Background(), getKubeClientWithConfig(dexConfig, secretConfig), "argocd")
mgr := NewSessionManager(settingsMgr, getProjLister(), dexTestServer.URL, NewUserStateStorage(nil))
mgr := NewSessionManager(settingsMgr, getProjLister(), dexTestServer.URL, nil, NewUserStateStorage(nil))
mgr.verificationDelayNoiseEnabled = false

claims := jwt.RegisteredClaims{Audience: jwt.ClaimStrings{"test-client"}, Subject: "admin", ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Hour * 24))}
Expand Down Expand Up @@ -612,7 +612,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),
}

settingsMgr := settings.NewSettingsManager(context.Background(), getKubeClientWithConfig(dexConfig, secretConfig), "argocd")
mgr := NewSessionManager(settingsMgr, getProjLister(), "", NewUserStateStorage(nil))
mgr := NewSessionManager(settingsMgr, getProjLister(), "", nil, NewUserStateStorage(nil))
mgr.verificationDelayNoiseEnabled = false

claims := jwt.RegisteredClaims{Audience: jwt.ClaimStrings{"test-client"}, Subject: "admin", ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Hour * 24))}
Expand Down Expand Up @@ -649,7 +649,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),
}

settingsMgr := settings.NewSettingsManager(context.Background(), getKubeClientWithConfig(dexConfig, secretConfig), "argocd")
mgr := NewSessionManager(settingsMgr, getProjLister(), dexTestServer.URL, NewUserStateStorage(nil))
mgr := NewSessionManager(settingsMgr, getProjLister(), dexTestServer.URL, nil, NewUserStateStorage(nil))
mgr.verificationDelayNoiseEnabled = false

claims := jwt.RegisteredClaims{Audience: jwt.ClaimStrings{"test-client"}, Subject: "admin", ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Hour * 24))}
Expand Down Expand Up @@ -687,7 +687,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),
}

settingsMgr := settings.NewSettingsManager(context.Background(), getKubeClientWithConfig(dexConfig, secretConfig), "argocd")
mgr := NewSessionManager(settingsMgr, getProjLister(), "", NewUserStateStorage(nil))
mgr := NewSessionManager(settingsMgr, getProjLister(), "", nil, NewUserStateStorage(nil))
mgr.verificationDelayNoiseEnabled = false

claims := jwt.RegisteredClaims{Audience: jwt.ClaimStrings{"test-client"}, Subject: "admin", ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Hour * 24))}
Expand Down Expand Up @@ -716,7 +716,7 @@ requestedScopes: ["oidc"]`, oidcTestServer.URL),
}

settingsMgr := settings.NewSettingsManager(context.Background(), getKubeClientWithConfig(dexConfig, nil), "argocd")
mgr := NewSessionManager(settingsMgr, getProjLister(), "", NewUserStateStorage(nil))
mgr := NewSessionManager(settingsMgr, getProjLister(), "", nil, NewUserStateStorage(nil))
mgr.verificationDelayNoiseEnabled = false

claims := jwt.RegisteredClaims{Audience: jwt.ClaimStrings{"test-client"}, Subject: "admin", ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Hour * 24))}
Expand Down

0 comments on commit acbf027

Please sign in to comment.