[jira] [Created] (SYNCOPE-1684) NotFoundException thrown when enabled/disabled audit from console

2022-06-23 Thread Samuel Garofalo (Jira)
Samuel Garofalo created SYNCOPE-1684:


 Summary: NotFoundException thrown when enabled/disabled audit from 
console
 Key: SYNCOPE-1684
 URL: https://issues.apache.org/jira/browse/SYNCOPE-1684
 Project: Syncope
  Issue Type: Bug
  Components: console
Affects Versions: 3.0.0
Reporter: Samuel Garofalo
 Fix For: 3.0.0






--
This message was sent by Atlassian Jira
(v8.20.7#820007)


[GitHub] [syncope] github-code-scanning[bot] commented on a diff in pull request #355: [SYNCOPE-1682] Introducing AttrRepo entity for AttrReleasePolicy

2022-06-23 Thread GitBox


github-code-scanning[bot] commented on code in PR #355:
URL: https://github.com/apache/syncope/pull/355#discussion_r905006953


##
common/am/lib/src/main/java/org/apache/syncope/common/lib/attr/JDBCAttrRepoConf.java:
##
@@ -0,0 +1,157 @@
+/*
+ * 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.attr;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.syncope.common.lib.AbstractJDBCConf;
+
+public class JDBCAttrRepoConf extends AbstractJDBCConf implements AttrRepoConf 
{
+
+private static final long serialVersionUID = -4474060002361453868L;
+
+public enum CaseCanonicalizationMode {
+
+LOWER,
+UPPER,
+NONE;
+
+}
+
+public enum QueryType {
+AND,
+OR
+
+}
+
+/**
+ * Designed to work against a table where there is a mapping of one row to 
one user.
+ */
+private boolean singleRow = true;
+
+/**
+ * If the SQL should only be run if all attributes listed in the mappings 
exist in the query.
+ */
+private boolean requireAllAttributes = true;
+
+/**
+ * When constructing the final person object from the attribute repository,
+ * indicate how the username should be canonicalized.
+ */
+private CaseCanonicalizationMode caseCanonicalization = 
CaseCanonicalizationMode.NONE;
+
+/**
+ * Indicates how multiple attributes in a query should be concatenated 
together.
+ */
+private QueryType queryType = QueryType.AND;
+
+/**
+ * Used only when there is a mapping of many rows to one user.
+ * This is done using a key-value structure where the key is the
+ * name of the "attribute name" column the value is the name of the 
"attribute value" column.
+ */
+private final Map columnMappings = new HashMap<>(0);
+
+/**
+ * Username attribute(s) to use when running the SQL query.
+ */
+private final List username = new ArrayList<>(0);
+
+/**
+ * Map of attributes to fetch from the database.
+ * Attributes are defined using a key-value structure
+ * where CAS allows the attribute name/key to be renamed virtually
+ * to a different attribute. The key is the attribute fetched
+ * from the data source and the value is the attribute name CAS should
+ * use for virtual renames.
+ */
+private final Map attributes = new HashMap<>(0);
+
+/**
+ * Collection of attributes, used to build the SQL query, that should go 
through
+ * a case canonicalization process defined as {@code key->value}.
+ */
+private final List caseInsensitiveQueryAttributes = new 
ArrayList<>(0);
+
+/**
+ * Define a {@code Map} of query attribute names to data-layer attribute 
names to use when building the query.
+ * The key is always the name of the query attribute that is defined by 
CAS and passed internally,
+ * and the value is the database column that should map.
+ */
+private final Map queryAttributes = new HashMap<>(0);
+
+public boolean isSingleRow() {
+return singleRow;
+}
+
+public void setSingleRow(final boolean singleRow) {
+this.singleRow = singleRow;
+}
+
+public boolean isRequireAllAttributes() {
+return requireAllAttributes;
+}
+
+public void setRequireAllAttributes(final boolean requireAllAttributes) {
+this.requireAllAttributes = requireAllAttributes;
+}
+
+public CaseCanonicalizationMode getCaseCanonicalization() {
+return caseCanonicalization;
+}
+
+public void setCaseCanonicalization(final CaseCanonicalizationMode 
caseCanonicalization) {
+this.caseCanonicalization = caseCanonicalization;
+}
+
+public QueryType getQueryType() {
+return queryType;
+}
+
+public void setQueryType(final QueryType queryType) {
+this.queryType = queryType;
+}
+
+public Map getColumnMappings() {
+return columnMappings;
+}
+
+public List getUsername() {
+return username;
+}
+
+public Map getAttributes() {
+return attributes;
+}
+
+public List