Commit a6883f95 authored by naji's avatar naji
Browse files

Merge branch 'test/merge' into 'feat/test'

Merge mis a jour vitam-ui

See merge request !51
parents 2e759b82 3f27cdf5
......@@ -232,13 +232,20 @@ deployment/playbooks/templates/vitamui/conf/*/*.p12
###################################
# Vitam development configuration #
###################################
api/api-archive-search/archive-search-internal/src/main/config/dev-vitam/*
api/api-ingest/ingest-internal/src/main/config/dev-vitam/*
api/api-referential/referential-internal/src/main/config/dev-vitam/*
api/api-ingest/ingest-internal/src/main/config/dev-vitam/*
api/api-iam/iam-internal/src/main/config/dev-vitam/*
api/api-archive-search/archive-search-internal/src/main/resources/dev/vitam/*
api/api-ingest/ingest-internal/src/main/resources/dev/vitam/*
api/api-referential/referential-internal/src/main/resources/dev/vitam/*
api/api-ingest/ingest-internal/src/main/resources/dev/vitam/*
api/api-iam/iam-internal/src/main/resources/dev/vitam/*
##########################################
# Mongo workspace entry-point #
##########################################
tools/docker/mongo/mongo-entrypoint
##########################################
# Angular Package-lock files ###########
################################""
ui/ui-frontend-common/package-lock.json
ui/ui-frontend/package-lock.json
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="2 - Security-Internal" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="spring-boot:run" />
</list>
</option>
<option name="pomFileName" />
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/api/api-security/security-internal" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<configuration default="false" name="2 - Security-Internal" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings"/>
<option name="myRunnerSettings"/>
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set/>
</option>
<option name="goals">
<list>
<option value="spring-boot:run"/>
<option value="-Pdev"/>
</list>
</option>
<option name="pomFileName"/>
<option name="profilesMap">
<map/>
</option>
<option name="resolveToWorkspace" value="false"/>
<option name="workingDirPath" value="$PROJECT_DIR$/api/api-security/security-internal"/>
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2"/>
</configuration>
</component>
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="3 - IAM-Internal" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="spring-boot:run" />
</list>
</option>
<option name="pomFileName" />
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/api/api-iam/iam-internal" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<configuration default="false" name="3 - IAM-Internal" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings"/>
<option name="myRunnerSettings"/>
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set/>
</option>
<option name="goals">
<list>
<option value="spring-boot:run"/>
<option value="-Pdev"/>
</list>
</option>
<option name="pomFileName"/>
<option name="profilesMap">
<map/>
</option>
<option name="resolveToWorkspace" value="false"/>
<option name="workingDirPath" value="$PROJECT_DIR$/api/api-iam/iam-internal"/>
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2"/>
</configuration>
</component>
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="4 - IAM-External" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="spring-boot:run" />
</list>
</option>
<option name="pomFileName" />
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/api/api-iam/iam-external" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<configuration default="false" name="4 - IAM-External" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings"/>
<option name="myRunnerSettings"/>
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set/>
</option>
<option name="goals">
<list>
<option value="spring-boot:run"/>
<option value="-Pdev"/>
</list>
</option>
<option name="pomFileName"/>
<option name="profilesMap">
<map/>
</option>
<option name="resolveToWorkspace" value="false"/>
<option name="workingDirPath" value="$PROJECT_DIR$/api/api-iam/iam-external"/>
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2"/>
</configuration>
</component>
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="6 - UI-Portal back" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="spring-boot:run" />
</list>
</option>
<option name="pomFileName" />
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/ui/ui-portal" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<configuration default="false" name="6 - UI-Portal back" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings"/>
<option name="myRunnerSettings"/>
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set/>
</option>
<option name="goals">
<list>
<option value="spring-boot:run"/>
<option value="-Pdev"/>
</list>
</option>
<option name="pomFileName"/>
<option name="profilesMap">
<map/>
</option>
<option name="resolveToWorkspace" value="false"/>
<option name="workingDirPath" value="$PROJECT_DIR$/ui/ui-portal"/>
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2"/>
</configuration>
</component>
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="7 - UI-Identity back" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="spring-boot:run" />
</list>
</option>
<option name="pomFileName" />
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/ui/ui-identity" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<configuration default="false" name="7 - UI-Identity back" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings"/>
<option name="myRunnerSettings"/>
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set/>
</option>
<option name="goals">
<list>
<option value="spring-boot:run"/>
<option value="-Pdev"/>
</list>
</option>
<option name="pomFileName"/>
<option name="profilesMap">
<map/>
</option>
<option name="resolveToWorkspace" value="false"/>
<option name="workingDirPath" value="$PROJECT_DIR$/ui/ui-identity"/>
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2"/>
</configuration>
</component>
......@@ -9,4 +9,4 @@
<envs />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
</component>
......@@ -40,14 +40,38 @@ pipeline {
agent none
steps {
script {
env.DO_MAJ_CONTEXT = 'true'
env.DO_TEST = 'true'
env.DO_BUILD = 'true'
env.DO_PUBLISH = 'true'
env.DO_CHECKMARX = 'true'
env.DO_CHECKMARX = 'false'
}
}
}
stage('Upgrade build context') {
when {
environment(name: 'DO_MAJ_CONTEXT', value: 'true')
}
environment {
NODE_JS_DOWNLOAD_URL="https://rpm.nodesource.com/setup_16.x"
http_proxy="http://${env.SERVICE_PROXY_HOST}:${env.SERVICE_PROXY_PORT}"
https_proxy="http://${env.SERVICE_PROXY_HOST}:${env.SERVICE_PROXY_PORT}"
}
steps {
sh 'sudo yum install -y gcc-c++ make'
sh 'sudo yum remove -y nodejs'
sh 'curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash -'
// sh 'sudo yum install -y nodejs'
sh 'sudo yum install -y nodejs-16.9.0-1nodesource'
sh 'node -v'
sh '/usr/bin/node -v'
sh 'npm -v'
sh 'sudo rm /usr/local/bin/node'
sh 'sudo rm /usr/local/bin/npm'
sh 'node -v;npm -v'
}
}
stage('Check vulnerabilities and tests.') {
when {
......@@ -58,9 +82,13 @@ pipeline {
JAVA_TOOL_OPTIONS=""
}
steps {
sh 'node -v'
sh 'npmrc default'
// sh '''
// $MVN_COMMAND clean verify org.owasp:dependency-check-maven:aggregate -Pvitam -pl '!cots/vitamui-nginx,!cots/vitamui-mongod,!cots/vitamui-logstash,!cots/vitamui-mongo-express' $JAVA_TOOL_OPTIONS
// '''
sh '''
$MVN_COMMAND clean verify org.owasp:dependency-check-maven:aggregate -Pvitam -pl '!cots/vitamui-nginx,!cots/vitamui-mongod,!cots/vitamui-logstash,!cots/vitamui-mongo-express' $JAVA_TOOL_OPTIONS
$MVN_COMMAND clean verify -Pvitam -pl '!cots/vitamui-nginx,!cots/vitamui-mongod,!cots/vitamui-logstash,!cots/vitamui-mongo-express' $JAVA_TOOL_OPTIONS
'''
}
post {
......@@ -86,7 +114,7 @@ pipeline {
steps {
sh 'npmrc default'
sh '''
$MVN_COMMAND deploy -Pvitam,rpm,webpack -DskipTests -DskipAllFrontend=true -Dlicense.skip=true -pl '!cots/vitamui-nginx,!cots/vitamui-mongod,!cots/vitamui-logstash,!cots/vitamui-mongo-express' $JAVA_TOOL_OPTIONS
$MVN_COMMAND deploy -Pvitam,deb,rpm -DskipTests -DskipAllFrontend=true -DskipAllFrontendTests=true -Dlicense.skip=true -pl '!cots/vitamui-nginx,!cots/vitamui-mongod,!cots/vitamui-logstash,!cots/vitamui-mongo-express' $JAVA_TOOL_OPTIONS
'''
}
}
......@@ -103,7 +131,7 @@ pipeline {
sh 'npmrc internet'
dir('cots/') {
sh '''
$MVN_COMMAND deploy -Pvitam,rpm -DskipTests -Dlicense.skip=true $JAVA_TOOL_OPTIONS
$MVN_COMMAND deploy -Pvitam,deb,rpm -DskipTests -Dlicense.skip=true $JAVA_TOOL_OPTIONS
'''
}
}
......@@ -125,14 +153,15 @@ pipeline {
}
}
stage("Publish rpm") {
stage("Publish rpm and deb") {
when {
environment(name: 'DO_PUBLISH', value: 'true')
environment(name: 'DO_BUILD', value: 'true')
}
steps {
sshagent (credentials: ['jenkins_sftp_to_repository']) {
sh 'vitam-build.git/push_vitamui_repo.sh contrib $SERVICE_REPO_SSHURL'
sh 'vitam-build.git/push_vitamui_repo.sh contrib $SERVICE_REPO_SSHURL rpm'
sh 'vitam-build.git/push_vitamui_repo.sh contrib $SERVICE_REPO_SSHURL deb'
}
}
}
......@@ -142,7 +171,7 @@ pipeline {
anyOf {
branch "develop*"
branch "master_*"
tag pattern: "^[1-9]+\\.[0-9]+\\.[0-9]*+-?[0-9]*\$", comparator: "REGEXP"
tag pattern: "^[1-9]+(\\.rc)?(\\.[0-9]+)?\\.[0-9]+(-.*)?", comparator: "REGEXP"
}
environment(name: 'DO_PUBLISH', value: 'true')
environment(name: 'DO_BUILD', value: 'true')
......@@ -160,7 +189,7 @@ pipeline {
branch "develop*"
branch "master_*"
branch "master"
tag pattern: "^[1-9]+\\.[0-9]+\\.[0-9]+-?[0-9]*\$", comparator: "REGEXP"
tag pattern: "^[1-9]+(\\.rc)?(\\.[0-9]+)?\\.[0-9]+(-.*)?", comparator: "REGEXP"
}
environment(name: 'DO_CHECKMARX', value: 'true')
}
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>api-archive-search</artifactId>
<groupId>fr.gouv.vitamui</groupId>
<version>4.4.0-SNAPSHOT</version>
<version>5.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -37,6 +37,9 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
</dependencies>
</project>
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2015-2021)
*
* contact.vitam@culture.gouv.fr
*
* This software is a computer program whose purpose is to implement a digital archiving back-office system managing
* high volumetry securely and efficiently.
*
* This software is governed by the CeCILL 2.1 license under French law and abiding by the rules of distribution of free
* software. You can use, modify and/ or redistribute the software under the terms of the CeCILL 2.1 license as
* circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
* users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
* successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
* developing or reproducing the software by the user in light of its specific status of free software, that may mean
* that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
* experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
* to be ensured and, more generally, to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you
* accept its terms.
*/
package fr.gouv.vitamui.archives.search.common.common;
import lombok.Data;
@Data
public class AppraisalRuleOriginRuleCriteria {
private Boolean waitingToRecalculate;
private Boolean inheritAtLeastOneRule;
private Boolean hasAtLeastOneRule;
private Boolean hasNoRule;
public boolean containsOriginRule() {
return this.waitingToRecalculate != null || this.inheritAtLeastOneRule != null || hasAtLeastOneRule != null ||
hasNoRule != null;
}
}
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2015-2021)
*
* contact.vitam@culture.gouv.fr
*
* This software is a computer program whose purpose is to implement a digital archiving back-office system managing
* high volumetry securely and efficiently.
*
* This software is governed by the CeCILL 2.1 license under French law and abiding by the rules of distribution of free
* software. You can use, modify and/ or redistribute the software under the terms of the CeCILL 2.1 license as
* circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
* users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the
* successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or
* developing or reproducing the software by the user in light of its specific status of free software, that may mean
* that it is complicated to manipulate, and that also therefore means that it is reserved for developers and
* experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling the security of their systems and/or data
* to be ensured and, more generally, to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had knowledge of the CeCILL 2.1 license and that you
* accept its terms.
*/
package fr.gouv.vitamui.archives.search.common.common;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
import java.util.Map;
public class ArchiveSearchConsts {
public static final String RULE_NAME_FIELD = "RuleValue";
public static final String RULE_TITLE_FIELD = "AppraisalRuleTitle";
public static final String RULE_IDENTIFIER_FIELD = "AppraisalRuleIdentifier";
public static final String RULE_ID_FIELD = "RuleId";
public static final String RULE_TYPE_FIELD = "RuleType";
public static final String APPRAISAL_RULE_TYPE = "AppraisalRule";
public final static String APPRAISAL_RULE_FINAL_ACTION_TYPE_ELIMINATION =
"APPRAISAL_RULE_FINAL_ACTION_TYPE_ELIMINATION";
public final static String APPRAISAL_RULE_FINAL_ACTION_TYPE_KEEP = "APPRAISAL_RULE_FINAL_ACTION_TYPE_KEEP";
public final static String APPRAISAL_RULE_FINAL_ACTION_TYPE_NOT_SPECIFIED =
"APPRAISAL_RULE_FINAL_ACTION_TYPE_NOT_SPECIFIED";
public enum CriteriaDataType {
STRING, DATE, INTERVAL
}
public enum CriteriaCategory {
FIELDS, APPRAISAL_RULE, NODES
}
public enum AppraisalRuleOrigin {
INHERITED, SCOPED, ANY
}
public enum AppraisalRuleOriginValues {
APPRAISAL_RULE_ORIGIN_WAITING_RECALCULATE, APPRAISAL_RULE_ORIGIN_INHERITE_AT_LEAST_ONE, APPRAISAL_RULE_ORIGIN_HAS_NO_ONE, APPRAISAL_RULE_ORIGIN_HAS_AT_LEAST_ONE
}
public final static String APPRAISAL_RULE_FINAL_ACTION_INHERITE_FINAL_ACTION =
"APPRAISAL_RULE_FINAL_ACTION_INHERITE_FINAL_ACTION";
public final static String APPRAISAL_RULE_FINAL_ACTION_HAS_FINAL_ACTION =
"APPRAISAL_RULE_FINAL_ACTION_HAS_FINAL_ACTION";
public final static String APPRAISAL_RULE_FINAL_ACTION = "APPRAISAL_RULE_FINAL_ACTION";
public final static String APPRAISAL_RULE_FINAL_ACTION_TYPE = "APPRAISAL_RULE_FINAL_ACTION_TYPE";
public final static String APPRAISAL_RULE_ORIGIN = "APPRAISAL_RULE_ORIGIN";
public final static String APPRAISAL_RULE_IDENTIFIER = "APPRAISAL_RULE_IDENTIFIER";
public final static String APPRAISAL_RULE_TITLE = "APPRAISAL_RULE_TITLE";
public final static String APPRAISAL_RULE_END_DATE = "APPRAISAL_RULE_END_DATE";
public static final String ISO_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
public static final String ONLY_DATE_FORMAT = "yyyy-MM-dd";
public static final String TRUE_CRITERIA_VALUE = "true";
public static final String FALSE_CRITERIA_VALUE = "false";
public static final DateTimeFormatter ISO_FRENCH_FORMATER =
DateTimeFormatter.ofPattern(ArchiveSearchConsts.ISO_DATE_FORMAT, Locale.FRENCH);
public static final DateTimeFormatter ONLY_DATE_FRENCH_FORMATER =
DateTimeFormatter.ofPattern(ArchiveSearchConsts.ONLY_DATE_FORMAT, Locale.FRENCH);
/*
Operators for criteria
*/
public enum CriteriaOperators {
EQ, MATCH, LT, GT, LTE, GTE, NOT_EQ, EXISTS, NOT_EXISTS, MISSING, NOT_MATCH, IN, NOT_IN
}
public static Map<String, String> SCOPED_APPRAISAL_MGT_RULES_SIMPLE_FIELDS_MAPPING =
Map.of(ArchiveSearchConsts.APPRAISAL_RULE_IDENTIFIER, "#management.AppraisalRule.Rules.Rule",
ArchiveSearchConsts.APPRAISAL_RULE_END_DATE, "#management.AppraisalRule.Rules.EndDate"
);
public static Map<String, String> INHERITED_APPRAISAL_MGT_RULES_SIMPLE_FIELDS_MAPPING =
Map.of(ArchiveSearchConsts.APPRAISAL_RULE_IDENTIFIER, "#computedInheritedRules.AppraisalRule.EndDates",
<