github-advanced-security[bot] commented on code in PR #696:
URL: https://github.com/apache/syncope/pull/696#discussion_r1574753511


##########
core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/api/MacroActions.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.logic.api;
+
+import java.util.Map;
+import javax.validation.ValidationException;
+import org.apache.syncope.common.lib.command.CommandArgs;
+import org.apache.syncope.common.lib.form.MacroTaskForm;
+
+/**
+ * Interface for actions to be performed during macro execution.
+ */
+public interface MacroActions {
+
+    default void validate(MacroTaskForm macroTaskForm) throws 
ValidationException {
+        // does nothing by default
+    }
+
+    default Map<String, String> getDropdownValues(String formProperty) {
+        return Map.of();
+    }
+
+    default void beforeAll() {
+        // does nothing by default
+    }
+
+    default void beforeCommand(Command<CommandArgs> command, CommandArgs args) 
{

Review Comment:
   ## Useless parameter
   
   The parameter 'args' is never used.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1569)



##########
core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/api/MacroActions.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.logic.api;
+
+import java.util.Map;
+import javax.validation.ValidationException;
+import org.apache.syncope.common.lib.command.CommandArgs;
+import org.apache.syncope.common.lib.form.MacroTaskForm;
+
+/**
+ * Interface for actions to be performed during macro execution.
+ */
+public interface MacroActions {
+
+    default void validate(MacroTaskForm macroTaskForm) throws 
ValidationException {
+        // does nothing by default
+    }
+
+    default Map<String, String> getDropdownValues(String formProperty) {
+        return Map.of();
+    }
+
+    default void beforeAll() {
+        // does nothing by default
+    }
+
+    default void beforeCommand(Command<CommandArgs> command, CommandArgs args) 
{
+        // does nothing by default
+    }
+
+    default void afterCommand(Command<CommandArgs> command, CommandArgs args, 
String output) {

Review Comment:
   ## Useless parameter
   
   The parameter 'args' is never used.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1566)



##########
core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/jexl/JexlUtils.java:
##########
@@ -87,29 +91,35 @@
         return JEXL_ENGINE;
     }
 
-    public static JxltEngine newJxltEngine() {
-        return getEngine().createJxltEngine(false);
+    private static JxltEngine getJxltEngine() {
+        synchronized (LOG) {
+            if (JXTL_ENGINE == null) {
+                JXTL_ENGINE = getJexlEngine().createJxltEngine(false);
+            }
+        }
+
+        return JXTL_ENGINE;
     }
 
     public static boolean isExpressionValid(final String expression) {
         boolean result;
         try {
-            getEngine().createExpression(expression);
+            getJexlEngine().createExpression(expression);
             result = true;
         } catch (JexlException e) {
-            LOG.error("Invalid jexl expression: " + expression, e);
+            LOG.error("Invalid JEXL expression: " + expression, e);

Review Comment:
   ## Insertion of sensitive information into log files
   
   This [potentially sensitive information](1) is written to a log file.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1574)



##########
core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/api/MacroActions.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.logic.api;
+
+import java.util.Map;
+import javax.validation.ValidationException;
+import org.apache.syncope.common.lib.command.CommandArgs;
+import org.apache.syncope.common.lib.form.MacroTaskForm;
+
+/**
+ * Interface for actions to be performed during macro execution.
+ */
+public interface MacroActions {
+
+    default void validate(MacroTaskForm macroTaskForm) throws 
ValidationException {
+        // does nothing by default
+    }
+
+    default Map<String, String> getDropdownValues(String formProperty) {
+        return Map.of();
+    }
+
+    default void beforeAll() {
+        // does nothing by default
+    }
+
+    default void beforeCommand(Command<CommandArgs> command, CommandArgs args) 
{

Review Comment:
   ## Useless parameter
   
   The parameter 'command' is never used.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1568)



##########
common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/FormPropertyDefTO.java:
##########
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.to;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.syncope.common.lib.form.FormPropertyType;
+
+public class FormPropertyDefTO implements NamedEntityTO {
+
+    private static final long serialVersionUID = -6862109424380661428L;
+
+    private String key;
+
+    private String name;
+
+    private FormPropertyType type;
+
+    private boolean readable;
+
+    private boolean writable;
+
+    private boolean required;
+
+    private String datePattern;
+
+    private final Map<String, String> enumValues = new HashMap<>();
+
+    @Override
+    public String getKey() {
+        return key;
+    }
+
+    @Override
+    public void setKey(final String key) {
+        this.key = key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    public FormPropertyType getType() {
+        return type;
+    }
+
+    public void setType(final FormPropertyType type) {
+        this.type = type;
+    }
+
+    public boolean isReadable() {
+        return readable;
+    }
+
+    public void setReadable(final boolean readable) {
+        this.readable = readable;
+    }
+
+    public boolean isWritable() {
+        return writable;
+    }
+
+    public void setWritable(final boolean writable) {
+        this.writable = writable;
+    }
+
+    public boolean isRequired() {
+        return required;
+    }
+
+    public void setRequired(final boolean required) {
+        this.required = required;
+    }
+
+    public String getDatePattern() {
+        return datePattern;
+    }
+
+    public void setDatePattern(final String datePattern) {
+        this.datePattern = datePattern;
+    }
+
+    public Map<String, String> getEnumValues() {

Review Comment:
   ## Exposing internal representation
   
   getEnumValues exposes the internal representation stored in field 
enumValues. The value may be modified [after this call to getEnumValues](1).
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1572)



##########
core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/api/MacroActions.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.logic.api;
+
+import java.util.Map;
+import javax.validation.ValidationException;
+import org.apache.syncope.common.lib.command.CommandArgs;
+import org.apache.syncope.common.lib.form.MacroTaskForm;
+
+/**
+ * Interface for actions to be performed during macro execution.
+ */
+public interface MacroActions {
+
+    default void validate(MacroTaskForm macroTaskForm) throws 
ValidationException {
+        // does nothing by default
+    }
+
+    default Map<String, String> getDropdownValues(String formProperty) {
+        return Map.of();
+    }
+
+    default void beforeAll() {
+        // does nothing by default
+    }
+
+    default void beforeCommand(Command<CommandArgs> command, CommandArgs args) 
{
+        // does nothing by default
+    }
+
+    default void afterCommand(Command<CommandArgs> command, CommandArgs args, 
String output) {

Review Comment:
   ## Useless parameter
   
   The parameter 'output' is never used.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1567)



##########
core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/api/MacroActions.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.logic.api;
+
+import java.util.Map;
+import javax.validation.ValidationException;
+import org.apache.syncope.common.lib.command.CommandArgs;
+import org.apache.syncope.common.lib.form.MacroTaskForm;
+
+/**
+ * Interface for actions to be performed during macro execution.
+ */
+public interface MacroActions {
+
+    default void validate(MacroTaskForm macroTaskForm) throws 
ValidationException {
+        // does nothing by default
+    }
+
+    default Map<String, String> getDropdownValues(String formProperty) {
+        return Map.of();
+    }
+
+    default void beforeAll() {
+        // does nothing by default
+    }
+
+    default void beforeCommand(Command<CommandArgs> command, CommandArgs args) 
{
+        // does nothing by default
+    }
+
+    default void afterCommand(Command<CommandArgs> command, CommandArgs args, 
String output) {

Review Comment:
   ## Useless parameter
   
   The parameter 'command' is never used.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1565)



##########
core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/api/MacroActions.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.logic.api;
+
+import java.util.Map;
+import javax.validation.ValidationException;
+import org.apache.syncope.common.lib.command.CommandArgs;
+import org.apache.syncope.common.lib.form.MacroTaskForm;
+
+/**
+ * Interface for actions to be performed during macro execution.
+ */
+public interface MacroActions {
+
+    default void validate(MacroTaskForm macroTaskForm) throws 
ValidationException {

Review Comment:
   ## Useless parameter
   
   The parameter 'macroTaskForm' is never used.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1571)



##########
core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/api/MacroActions.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.logic.api;
+
+import java.util.Map;
+import javax.validation.ValidationException;
+import org.apache.syncope.common.lib.command.CommandArgs;
+import org.apache.syncope.common.lib.form.MacroTaskForm;
+
+/**
+ * Interface for actions to be performed during macro execution.
+ */
+public interface MacroActions {
+
+    default void validate(MacroTaskForm macroTaskForm) throws 
ValidationException {
+        // does nothing by default
+    }
+
+    default Map<String, String> getDropdownValues(String formProperty) {

Review Comment:
   ## Useless parameter
   
   The parameter 'formProperty' is never used.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1570)



##########
common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/MacroTaskTO.java:
##########
@@ -80,6 +84,20 @@
         this.saveExecs = saveExecs;
     }
 
+    @JacksonXmlElementWrapper(localName = "formPropertyDefs")
+    @JacksonXmlProperty(localName = "formPropertyDef")
+    public List<FormPropertyDefTO> getFormPropertyDefs() {

Review Comment:
   ## Exposing internal representation
   
   getFormPropertyDefs exposes the internal representation stored in field 
formPropertyDefs. The value may be modified [after this call to 
getFormPropertyDefs](1).
   getFormPropertyDefs exposes the internal representation stored in field 
formPropertyDefs. The value may be modified [after this call to 
getFormPropertyDefs](2).
   getFormPropertyDefs exposes the internal representation stored in field 
formPropertyDefs. The value may be modified [after this call to 
getFormPropertyDefs](3).
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1573)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@syncope.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to