From a310166981c278c028ec5cc8e46d99471b76da6d Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Sun, 24 Apr 2022 18:50:12 +0100 Subject: [PATCH] Remove unused request scope fields --- pkg/apis/middleware/scope.go | 11 ----------- pkg/apis/middleware/scope_test.go | 6 +++--- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/pkg/apis/middleware/scope.go b/pkg/apis/middleware/scope.go index 2d84f00e..34ee1a11 100644 --- a/pkg/apis/middleware/scope.go +++ b/pkg/apis/middleware/scope.go @@ -28,17 +28,6 @@ type RequestScope struct { // Session details the authenticated users information (if it exists). Session *sessions.SessionState - // SaveSession indicates whether the session storage should attempt to save - // the session or not. - SaveSession bool - - // ClearSession indicates whether the user should be logged out or not. - ClearSession bool - - // SessionRevalidated indicates whether the session has been revalidated since - // it was loaded or not. - SessionRevalidated bool - // Upstream tracks which upstream was used for this request Upstream string } diff --git a/pkg/apis/middleware/scope_test.go b/pkg/apis/middleware/scope_test.go index 355365bf..b87c9c7e 100644 --- a/pkg/apis/middleware/scope_test.go +++ b/pkg/apis/middleware/scope_test.go @@ -34,15 +34,15 @@ var _ = Describe("Scope Suite", func() { Context("if the scope is then modified", func() { BeforeEach(func() { - Expect(scope.SaveSession).To(BeFalse()) - scope.SaveSession = true + Expect(scope.RequestID).To(BeEmpty()) + scope.RequestID = "abc123" }) It("returns the updated session", func() { s := middleware.GetRequestScope(request) Expect(s).ToNot(BeNil()) Expect(s).To(Equal(scope)) - Expect(s.SaveSession).To(BeTrue()) + Expect(s.RequestID).To(Equal("abc123")) }) }) })