From c893a510232b8e0011140e3de903ac94548b5f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Sur=C3=A9e?= Date: Fri, 15 Nov 2024 14:28:41 +0100 Subject: [PATCH 1/2] oid_introspection: add MakeTokenContainer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This method allows third-party filters to set the oidcClaimsCacheKey which enables the use of the oidcClaimsQuery filter. Signed-off-by: Adrien Surée --- filters/auth/oidc_introspection.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/filters/auth/oidc_introspection.go b/filters/auth/oidc_introspection.go index a32752a7c0..e02950e305 100644 --- a/filters/auth/oidc_introspection.go +++ b/filters/auth/oidc_introspection.go @@ -42,6 +42,12 @@ func NewOIDCQueryClaimsFilter() filters.Spec { } } +func MakeTokenContainer(h map[string]interface{}) tokenContainer { + return tokenContainer{ + Claims: h, + } +} + func (spec *oidcIntrospectionSpec) Name() string { switch spec.typ { case checkOIDCQueryClaims: From 4f4de084c1e72515d347fd321ad063eac5044379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Sur=C3=A9e?= Date: Mon, 18 Nov 2024 14:55:38 +0100 Subject: [PATCH 2/2] Replace MakeContainer by SetOIDCClaims MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Surée --- filters/auth/oidc_introspection.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filters/auth/oidc_introspection.go b/filters/auth/oidc_introspection.go index e02950e305..e60d845a73 100644 --- a/filters/auth/oidc_introspection.go +++ b/filters/auth/oidc_introspection.go @@ -42,8 +42,8 @@ func NewOIDCQueryClaimsFilter() filters.Spec { } } -func MakeTokenContainer(h map[string]interface{}) tokenContainer { - return tokenContainer{ +func SetOIDCClaims(ctx filters.FilterContext, h map[string]interface{}) { + ctx.StateBag()[oidcClaimsCacheKey] = tokenContainer{ Claims: h, } }