Hi all,
I want to make the PrivilegesEvaluator flexible so that any user can use his/her own implementation of PrivilegesEvaluator
This is the idea
-
Introduce a new property as to which evaluator is to be initialized
-
Create an abstract class Evaluator. // Parent class of any evaluator
PrivilegesEvaluator implements the abstract class (only override the evaluate() api) -
Similarly,
create abstract class EvaluatorResponse // Parent class of any evaluatorResponse -
Create a EvaluatorFactory which returns the specified evaluator to be used when invoked.
Here are the links for PrivilegesEvaluator and PrivilegesEvaluatorResponse classes :
-
security/PrivilegesEvaluator.java at main · opendistro-for-elasticsearch/security · GitHub
-
security/PrivilegesEvaluatorResponse.java at main · opendistro-for-elasticsearch/security · GitHub
Is this design viable to be contributed or if not, please suggest changes?