Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Janardhan Sharma <[email protected]>
  • Loading branch information
Janardhan Sharma committed May 10, 2024
1 parent aef72d0 commit 3307de3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions filters/openpolicyagent/evaluation.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,21 @@ func setDecisionIdInRequest(req *ext_authz_v3.CheckRequest, decisionId string) e
FilterMetadata: map[string]*pbstruct.Struct{},
}
}
filterMeta, err := formOpenPolicyAgentMetaDataObject(decisionId)

if err == nil {
req.Attributes.MetadataContext.FilterMetadata["open_policy_agent"] = filterMeta
filterMeta, err := formOpenPolicyAgentMetaDataObject(decisionId)
if err != nil {
return err
}
return err
req.Attributes.MetadataContext.FilterMetadata["open_policy_agent"] = filterMeta
return nil
}

func formOpenPolicyAgentMetaDataObject(decisionId string) (*pbstruct.Struct, error) {

innerFields := make(map[string]interface{})
innerFields["decision_id"] = decisionId

openPolicyAgentMetaDataObject, err := pbstruct.NewStruct(innerFields)

return openPolicyAgentMetaDataObject, err
return pbstruct.NewStruct(innerFields)
}

func (opa *OpenPolicyAgentInstance) logDecision(ctx context.Context, input interface{}, result *envoyauth.EvalResult, err error) error {
Expand Down

0 comments on commit 3307de3

Please sign in to comment.