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

authorize: reuse policy evaluators where possible #4710

Merged
merged 4 commits into from Nov 6, 2023

Conversation

kenjenkins
Copy link
Contributor

@kenjenkins kenjenkins commented Nov 4, 2023

Summary

Add a parameter to evaluator.New() for the previous Evaluator (if any). If the evaluatorConfig is the same, reuse any PolicyEvaluators for policies that have not changed from the previous Evaluator.

Use the route IDs along with the policy checksums to determine whether a given policy has changed. Similarly, add a new cacheKey() method to the evaluatorConfig to compute a checksum used for determine whether the evaluatorConfig has changed. (Store this checksum on the Evaluator.)

Related issues

User Explanation

Checklist

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

Add a parameter to evaluator.New() for the previous Evaluator (if any).
If the evaluatorConfig is the same, reuse any PolicyEvaluators for
policies that have not changed from the previous Evaluator.

Use the route IDs along with the policy checksums to determine whether a
given policy has changed. Similarly, add a new cacheKey() method to the
evaluatorConfig to compute a checksum used for determine whether the
evaluatorConfig has changed. (Store this checksum on the Evaluator.)
@coveralls
Copy link

coveralls commented Nov 4, 2023

Coverage Status

coverage: 63.739% (+0.2%) from 63.546%
when pulling f695a79 on kenjenkins/evaluator-diff
into 2771a5a on main.

@calebdoxsey
Copy link
Contributor

lgtm

@kenjenkins kenjenkins marked this pull request as ready for review November 6, 2023 18:19
@kenjenkins kenjenkins requested a review from a team as a code owner November 6, 2023 18:19
@kenjenkins
Copy link
Contributor Author

OK, I've added some unit test cases.

@kenjenkins kenjenkins merged commit ffca3b3 into main Nov 6, 2023
9 checks passed
@kenjenkins kenjenkins deleted the kenjenkins/evaluator-diff branch November 6, 2023 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants