From 10eb023440c9b5fd6dd44e2041ae0187353f5b1f Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Thu, 24 Oct 2024 12:58:16 -0400 Subject: [PATCH] Trying to fix things Signed-off-by: Alex Snaps --- pkg/evaluators/identity/plain.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/evaluators/identity/plain.go b/pkg/evaluators/identity/plain.go index c6bc5ee0..8f3ec65a 100644 --- a/pkg/evaluators/identity/plain.go +++ b/pkg/evaluators/identity/plain.go @@ -8,6 +8,7 @@ import ( "github.com/kuadrant/authorino/pkg/auth" "github.com/kuadrant/authorino/pkg/expressions" + "github.com/kuadrant/authorino/pkg/json" envoy_auth "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" ) @@ -18,10 +19,12 @@ type Plain struct { } func (p *Plain) Call(pipeline auth.AuthPipeline, ctx context.Context) (interface{}, error) { - if object, err := p.Value.ResolveFor(pipeline.GetAuthorizationJSON()); object != nil { - return object, nil - } else if err != nil { + pattern := json.JSONValue{Pattern: p.Pattern} + if object, err := pattern.ResolveFor(pipeline.GetAuthorizationJSON()); err != nil { return nil, err + } else if object != nil { + + return object, nil } return nil, fmt.Errorf("could not retrieve identity object or null") }