Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ppl: refactor authorize to evaluate PPL #2224

Merged
merged 9 commits into from
May 21, 2021
Merged

Conversation

calebdoxsey
Copy link
Contributor

Summary

Update the authorize evaluator to use PPL instead of authz.rego.

Checklist

  • reference any related issues
  • updated docs
  • updated unit tests
  • updated UPGRADING.md
  • add appropriate tag (improvement / bug / etc)
  • ready for review

@calebdoxsey calebdoxsey requested a review from a team as a code owner May 19, 2021 19:59
@calebdoxsey calebdoxsey requested a review from wasaga May 19, 2021 19:59
@codeclimate
Copy link

codeclimate bot commented May 19, 2021

Code Climate has analyzed commit 5df492a and detected 0 issues on this pull request.

View more on Code Climate.

authorize/grpc.go Outdated Show resolved Hide resolved
Copy link
Contributor

@desimone desimone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. A few questions and comments.

It looks like half of my review comments were sent as vanilla comments. Sorry about that.

authorize/evaluator/evaluator.go Show resolved Hide resolved
authorize/evaluator/evaluator.go Outdated Show resolved Hide resolved
authorize/evaluator/headers_evaluator.go Outdated Show resolved Hide resolved
h := make(http.Header)

m, ok := vars["result"].(map[string]interface{})
if !ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this an others below be an error that should bubble up from Evaluate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. I can make this change if you want but I suspect we'll have to roll it back. There may be valid reasons why no allow or deny block occurs in the result.

authorize/evaluator/policy_evaluator.go Show resolved Hide resolved
@calebdoxsey calebdoxsey merged commit dad35bc into master May 21, 2021
@calebdoxsey calebdoxsey deleted the cdoxsey/407-ppl-evaluator branch May 21, 2021 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants