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


##########
common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/form/FormProperty.java:
##########
@@ -109,13 +108,13 @@
 
     @JacksonXmlElementWrapper(localName = "enumValues")
     @JacksonXmlProperty(localName = "enumValue")
-    public List<UserRequestFormPropertyValue> getEnumValues() {
+    public List<FormPropertyValue> getEnumValues() {
         return enumValues;
     }
 
     @JacksonXmlElementWrapper(localName = "dropdownValues")
     @JacksonXmlProperty(localName = "dropdownValue")
-    public List<UserRequestFormPropertyValue> getDropdownValues() {
+    public List<FormPropertyValue> getDropdownValues() {

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



##########
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/1563)



##########
common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/form/MacroTaskForm.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * 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.form;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import 
com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.syncope.common.lib.BaseBean;
+
+public class MacroTaskForm implements BaseBean {
+
+    private static final long serialVersionUID = 8388697351958834257L;
+
+    private final List<FormProperty> properties = new ArrayList<>();
+
+    @JsonIgnore
+    public Optional<FormProperty> getProperty(final String id) {
+        return properties.stream().filter(property -> 
id.equals(property.getId())).findFirst();
+    }
+
+    @JacksonXmlElementWrapper(localName = "properties")
+    @JacksonXmlProperty(localName = "property")
+    public List<FormProperty> getProperties() {

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



##########
ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/to/UserRequestForm.java:
##########
@@ -146,13 +138,13 @@
     }
 
     @JsonIgnore
-    public Optional<UserRequestFormProperty> getProperty(final String id) {
+    public Optional<FormProperty> getProperty(final String id) {
         return properties.stream().filter(property -> 
id.equals(property.getId())).findFirst();
     }
 
     @JacksonXmlElementWrapper(localName = "properties")
     @JacksonXmlProperty(localName = "property")
-    public List<UserRequestFormProperty> getProperties() {
+    public List<FormProperty> getProperties() {

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



##########
common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/FormPropertyDefTO.java:
##########
@@ -0,0 +1,160 @@
+/*
+ * 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<>();
+
+    private String dropdownValueProvider;
+
+    @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/1562)



##########
common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/form/FormProperty.java:
##########
@@ -109,13 +108,13 @@
 
     @JacksonXmlElementWrapper(localName = "enumValues")
     @JacksonXmlProperty(localName = "enumValue")
-    public List<UserRequestFormPropertyValue> getEnumValues() {
+    public List<FormPropertyValue> 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/1560)



-- 
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