Skip to content

Commit

Permalink
oid_introspection: add SetOIDCClaims
Browse files Browse the repository at this point in the history
This method allows third-party filters to set the oidcClaimsCacheKey
which enables the use of the oidcClaimsQuery filter.

Signed-off-by: Adrien Surée <adrien.suree@zalando.de>
  • Loading branch information
Adrien Surée committed Jan 3, 2025
1 parent 44139f3 commit 333f84b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions filters/auth/oidc_introspection.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ func NewOIDCQueryClaimsFilter() filters.Spec {
}
}

// Sets OIDC claims in the state bag.
// Intended for use with the oidcClaimsQuery filter.
func SetOIDCClaims(ctx filters.FilterContext, claims map[string]interface{}) {
ctx.StateBag()[oidcClaimsCacheKey] = tokenContainer{
Claims: claims,
}
}

func (spec *oidcIntrospectionSpec) Name() string {
switch spec.typ {
case checkOIDCQueryClaims:
Expand Down

0 comments on commit 333f84b

Please sign in to comment.