Skip to content

Commit

Permalink
Trying to fix things
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Snaps <[email protected]>
  • Loading branch information
alexsnaps committed Oct 24, 2024
1 parent 0707d5e commit 10eb023
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/evaluators/identity/plain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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")
}
Expand Down

0 comments on commit 10eb023

Please sign in to comment.