-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support a filter_by
option in Gaurd
#17
Comments
filter_by
option in Storage or Gaurdfilter_by
option in Gaurd
Probably, I'm missing the point, but what is the benefit of using a separate My view of the situation is the following:
What is needed to be done:
@ketgo, what do you think? |
I agree with the laid out requirements and what is needed to be done. Regarding the
As can be seen, a good grouping strategy will result in better policy evaluation performance. |
Yes, absolutely agree with you. Grouping will let us shard the data-set for a small query scope which will result in much better performance. |
I am not sure if the following fits with the future vision of the package, but wanted to see if it can help resolve the issue -- all policy retrieval from Storage for Regex and Rule based checker.
Provide a
filter_by
option inGuard
initialization, or theGuard.is_allowed
method. This value can be then used by theStorage
to filter policies on DB. In fact, if MongoEngine back-end is used to implement the MongoStorage, the structure offilter_by
can be the same as that used in MongoEngine package. The other option is to just let it be a MongoDB query json.Since the
filter_by
is DB dependent, a unified interface to create these filters that can be used for all storage types might be useful and part of a future feature. Some indexing strategy will also be useful.Overall the approach has the following pros and cons:
Pros:
DB level filtering of policies before evaluation resulting in faster performance.
Cons:
It is possible for a user to use a filter that may result in some policies to be missed for evaluation.
I don't think the con is a big issue since the
filter_by
option can be left for advance usage with a user warning in the docs.The text was updated successfully, but these errors were encountered: