[midPoint-git] [Evolveum/midpoint] c9b1ce: Streamline function library handling code

mederly noreply at github.com
Tue Aug 1 16:08:06 CEST 2023


  Branch: refs/heads/master
  Home:   https://github.com/Evolveum/midpoint
  Commit: c9b1ceb18ead45cc193b1991c980015fed12c26e
      https://github.com/Evolveum/midpoint/commit/c9b1ceb18ead45cc193b1991c980015fed12c26e
  Author: Pavol Mederly <mederly at evolveum.com>
  Date:   2023-08-01 (Tue, 01 Aug 2023)

  Changed paths:
    M infra/schema/src/main/java/com/evolveum/midpoint/schema/config/ExpressionConfigItem.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/config/ExpressionParameterConfigItem.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/config/FunctionCallArgumentConfigItem.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/config/FunctionConfigItem.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/config/FunctionExpressionEvaluatorConfigItem.java
    M infra/schema/src/main/java/com/evolveum/midpoint/schema/constants/MidPointConstants.java
    M infra/schema/src/main/java/com/evolveum/midpoint/schema/expression/TypedValue.java
    M model/model-common/src/main/java/com/evolveum/midpoint/model/common/ModelCommonBeans.java
    M model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/evaluator/FunctionExpressionEvaluator.java
    M model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/evaluator/FunctionExpressionEvaluatorFactory.java
    R model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/functions/CustomFunctions.java
    M model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/functions/FunctionLibrary.java
    A model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/functions/FunctionLibraryBinding.java
    A model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/functions/FunctionLibraryManager.java
    M model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/functions/FunctionLibraryUtil.java
    A model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/functions/LibraryFunctionExecutor.java
    M model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/script/AbstractScriptEvaluator.java
    M model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/script/ScriptExpression.java
    M model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/script/ScriptExpressionEvaluationContext.java
    M model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/script/ScriptExpressionFactory.java
    M model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/script/groovy/SandboxTypeCheckingExtension.java
    M model/model-common/src/test/java/com/evolveum/midpoint/model/common/expression/ExpressionTestUtil.java
    M model/model-common/src/test/java/com/evolveum/midpoint/model/common/expression/script/AbstractScriptTest.java
    M model/model-common/src/test/java/com/evolveum/midpoint/model/common/expression/script/TestScriptCaching.java
    M model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/expr/triggerSetter/TriggerCreatorGlobalState.java
    M model/model-impl/src/main/resources/ctx-model.xml
    M model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAssignmentProcessor2.java
    M model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestRunAs.java
    A model/model-intest/src/test/resources/run-as/library-privileged.xml
    A model/model-intest/src/test/resources/run-as/role-with-method-standard.xml
    M model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportServiceImpl.java
    M repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/expression/Expression.java
    A repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/expression/ExpressionEvaluationUtil.java

  Log Message:
  -----------
  Streamline function library handling code

Before providing planned improvements for function libraries (runAs,
runPrivileged, additional security through expression profiles), this
commit tries to streamline and deduplicate the code at least a bit.

In particular,

1. Function calls from scripts (former CustomFunctions, now
LibraryFunctionExecutor) and from expressions
(FunctionExpressionEvaluator) were - at least partly - unified.

2. FunctionLibraryManager was introduced. It serves as a cache for
function libraries and their bindings to script variables.

!!! Incompatible change: resolution of a library object in <function>
expression is now handled by FunctionLibraryManager, right from the
cached data. Hence, no authorizations are checked there. The access
to the functionality provided by these libraries should be restricted
by expression profiles instead. (Note that the calls to functions from
withing scripts ignored authorizations from the beginning.) !!!

3. Parsed (optimized) form of cached FunctionLibraryType object was
introduced: FunctionLibrary. It provides e.g. methods for fast retrieval
of functions declarations. The original FunctionLibrary class was
renamed to FunctionLibraryBinding.

4. Code was moved to find the most appropriate place. Configuration
related code is now in "config items"; some auxiliary evaluation code
was moved to newly-created ExpressionEvaluationUtil, waiting for further
de-duplication, unification, and simplification.

The terminology has to settle a bit. Either we will talk about built-in
libraries (basic, log, midpoint, ...) vs. function libraries, or we'll
retain the term "custom library". However, as we plan to provide
a standard (although customizable) library as part of midPoint
distribution some day, I'm not sure if this is a good idea.


  Commit: 496a0f2bd5a3b86006d7ff56573d95ce2834981b
      https://github.com/Evolveum/midpoint/commit/496a0f2bd5a3b86006d7ff56573d95ce2834981b
  Author: Pavol Mederly <mederly at evolveum.com>
  Date:   2023-08-01 (Tue, 01 Aug 2023)

  Changed paths:
    M gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/factory/panel/SourceOrTargetOfMappingPanelFactory.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/validator/processor/DefaultObjectTypeProcessor.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/validator/processor/DefaultScopeProcessor.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/validator/processor/ExecutionModeProcessor.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/validator/processor/GuiActionNameProcessor.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/validator/processor/ObjectFormsProcessor.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/validator/processor/ReportOutputOidProcessor.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/validator/processor/SearchItemDisplayNameProcessor.java
    A infra/schema/src/main/java/com/evolveum/midpoint/schema/validator/processor/TaskCategoryProcessor.java
    M infra/schema/src/main/java/com/evolveum/midpoint/schema/validator/processor/UserDashboardProcessor.java
    M infra/schema/src/test/java/com/evolveum/midpoint/schema/validator/processor/TestUpgradeProcessors.java
    M infra/schema/src/test/resources/validator/expected/system-configuration.xml
    M infra/schema/src/test/resources/validator/expected/task-livesync.xml
    M infra/schema/src/test/resources/validator/expected/task-recomputation.xml
    M infra/schema/src/test/resources/validator/processor/system-configuration.xml
    M infra/schema/src/test/resources/validator/processor/task-livesync.xml
    M infra/schema/src/test/resources/validator/processor/task-recomputation.xml
    M infra/schema/testng-unit.xml

  Log Message:
  -----------
  Merge remote-tracking branch 'origin/master'


Compare: https://github.com/Evolveum/midpoint/compare/d5fb4233d73b...496a0f2bd5a3


More information about the midPoint-svn mailing list