Module org.elasticsearch.xcore
Class SecurityQueryTemplateEvaluator
java.lang.Object
org.elasticsearch.xpack.core.security.authz.support.SecurityQueryTemplateEvaluator
Helper class that helps to evaluate the query source template.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionstatic StringevaluateTemplate(String querySource, ScriptService scriptService, User user) If the query source is a template, then parses the script, compiles the script with user details parameters and then executes it to return the query string.wrap(User user, ScriptService scriptService)
-
Method Details
-
evaluateTemplate
If the query source is a template, then parses the script, compiles the script with user details parameters and then executes it to return the query string.Note: This method always enforces "mustache" script language for the template.
- Parameters:
querySource- query string template to be evaluated.scriptService-ScriptServiceuser-Userdetails for user defined parameters in the script.- Returns:
- resultant query string after compiling and executing the script. If the source does not contain template then it will return the query source without any modifications.
-
wrap
public static SecurityQueryTemplateEvaluator.DlsQueryEvaluationContext wrap(User user, ScriptService scriptService)
-