From a9a596031b64e3abd3bb2c5a79e0cfbedecd8ffb Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Thu, 3 Oct 2024 08:40:55 +0100 Subject: [PATCH] Update the tests to handle nonce --- main_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main_test.go b/main_test.go index f09e45d..6b334c5 100644 --- a/main_test.go +++ b/main_test.go @@ -195,6 +195,7 @@ func (suite *TraefikOidcTestSuite) TestServeHTTP_CallbackPath() { session := sessions.NewSession(suite.mockStore, cookieName) session.Values["csrf"] = "test_state" session.Values["incoming_path"] = "/original_path" + session.Values["nonce"] = "test_nonce" // Add nonce to session suite.mockStore.On("Get", req, cookieName).Return(session, nil) suite.mockStore.On("Save", mock.Anything, mock.Anything, mock.Anything).Return(nil) @@ -202,6 +203,7 @@ func (suite *TraefikOidcTestSuite) TestServeHTTP_CallbackPath() { claims := map[string]interface{}{ "exp": float64(time.Now().Add(time.Hour).Unix()), "email": "test@example.com", + "nonce": "test_nonce", // Add nonce to ID Token claims } claimsJSON, _ := json.Marshal(claims) encodedClaims := base64.RawURLEncoding.EncodeToString(claimsJSON)