Skip to content
Snippets Groups Projects
Commit 81c30bfd authored by pybelecalo's avatar pybelecalo
Browse files

Merge branch 'develop' into feature/design-bis

parents 41561db4 317e327c
No related branches found
No related tags found
No related merge requests found
Showing
with 125 additions and 154 deletions
......@@ -107,5 +107,4 @@ public class IamExternalRestClientFactory extends BaseRestClientFactory {
public LogbookExternalRestClient getLogbookExternalRestClient() {
return new LogbookExternalRestClient(getRestTemplate(), getBaseUrl());
}
}
......@@ -118,6 +118,15 @@ customer-init:
- ROLE_CREATE_INGEST
- ROLE_GET_ALL_INGEST
- name: Profil Arbres et Plans
description: Gestion des application d'import d'arbres de positionnement et plans de classement
app-name: HOLDING_FILLING_SCHEME_APP
level:
roles:
- ROLE_CREATE_HOLDING_FILLING_SCHEME
- ROLE_GET_HOLDING_FILLING_SCHEME
- ROLE_GET_ALL_HOLDING_FILLING_SCHEME
#- name: profileName
# description: desc
# level: 1
......
......@@ -11,6 +11,10 @@ spring:
enabled: false
register: false
data:
mongodb:
uri: mongodb://mongod_dbuser_iam:mongod_dbpwd_iam@localhost:27018/iam?connectTimeoutMS=2000
multipart:
enabled: true
......
......@@ -38,6 +38,7 @@ package fr.gouv.vitamui.ingest.internal.server.config;
import fr.gouv.vitam.ingest.external.client.IngestExternalClient;
import fr.gouv.vitamui.commons.api.application.AbstractContextConfiguration;
import fr.gouv.vitamui.commons.mongo.config.MongoConfig;
import fr.gouv.vitamui.commons.rest.RestExceptionHandler;
import fr.gouv.vitamui.commons.rest.client.configuration.RestClientConfiguration;
import fr.gouv.vitamui.commons.rest.configuration.SwaggerConfiguration;
......@@ -64,7 +65,7 @@ import org.springframework.context.annotation.Import;
import com.fasterxml.jackson.databind.ObjectMapper;
@Configuration
@Import({RestExceptionHandler.class, SwaggerConfiguration.class, WebSecurityConfig.class, VitamAccessConfig.class, VitamIngestConfig.class,
@Import({RestExceptionHandler.class, MongoConfig.class, SwaggerConfiguration.class, WebSecurityConfig.class, VitamAccessConfig.class, VitamIngestConfig.class,
VitamAdministrationConfig.class})
public class ApiIngestInternalServerConfig extends AbstractContextConfiguration {
......
......@@ -56,7 +56,6 @@ public class ReferentialDtoBuilder {
contextDto.setStatus(ContextStatus.ACTIVE.toString());
contextDto.setEnableControl(true);
contextDto.setSecurityProfile("securityProfile");
// contextDto.setPermissions(buildPermissions());
return contextDto;
}
......
......@@ -353,6 +353,16 @@ public class ServicesData {
public static final String ROLE_GET_INGEST = GET_ROLE_PREFIX + SERVICE_INGEST;
public static final String ROLE_GET_ALL_INGEST = GET_ROLE_PREFIX + "ALL_" + SERVICE_INGEST;
//------------------------------------ API TREES & PLANS -----------------------------------------
public static final String SERVICE_HOLDING_FILLING_SCHEME_ROLE = "HOLDING_FILLING_SCHEME";
public static final String ROLE_CREATE_HOLDING_FILLING_SCHEME_ROLE = CREATE_ROLE_PREFIX + SERVICE_HOLDING_FILLING_SCHEME_ROLE;
public static final String ROLE_GET_HOLDING_FILLING_SCHEME_ROLE = GET_ROLE_PREFIX + SERVICE_HOLDING_FILLING_SCHEME_ROLE;
public static final String ROLE_GET_ALL_HOLDING_FILLING_SCHEME_ROLE = GET_ROLE_PREFIX + "ALL_" + SERVICE_HOLDING_FILLING_SCHEME_ROLE;
//@formatter:off
/**
......@@ -438,7 +448,11 @@ public class ServicesData {
ROLE_GET_ALL_INGEST,
ROLE_GET_INGEST,
ROLE_CREATE_INGEST
ROLE_CREATE_INGEST,
ROLE_CREATE_HOLDING_FILLING_SCHEME_ROLE,
ROLE_GET_HOLDING_FILLING_SCHEME_ROLE,
ROLE_GET_ALL_HOLDING_FILLING_SCHEME_ROLE
);
/**
......@@ -548,7 +562,11 @@ public class ServicesData {
ROLE_GET_ALL_INGEST,
ROLE_GET_INGEST,
ROLE_CREATE_INGEST
ROLE_CREATE_INGEST,
ROLE_CREATE_HOLDING_FILLING_SCHEME_ROLE,
ROLE_GET_HOLDING_FILLING_SCHEME_ROLE,
ROLE_GET_ALL_HOLDING_FILLING_SCHEME_ROLE
);
//@formatter:on
......
......@@ -3,46 +3,6 @@
customer-init:
# Default profiles for each customer created
profiles:
- name: Profil pour la gestion des profiles de sécurité
description: Gestion des profiles de sécurité dans Vitam
app-name: SECURITY_PROFILES_APP
level:
roles:
- ROLE_GET_SECURITY_PROFILES
- ROLE_CREATE_SECURITY_PROFILES
- ROLE_UPDATE_SECURITY_PROFILES
- ROLE_DELETE_SECURITY_PROFILES
- name: Profil pour la gestion des formats de fichiers
description: Gestion des formats de fichiers dans Vitam
app-name: FILE_FORMATS_APP
level:
roles:
- ROLE_GET_FILE_FORMATS
- ROLE_CREATE_FILE_FORMATS
- ROLE_UPDATE_FILE_FORMATS
- ROLE_DELETE_FILE_FORMATS
- ROLE_IMPORT_FILE_FORMATS
- name: Profil pour la gestion des ontologies
description: Gestion des ontologies dans Vitam
app-name: ONTOLOGY_APP
level:
roles:
- ROLE_GET_ONTOLOGIES
- ROLE_CREATE_ONTOLOGIES
- ROLE_DELETE_ONTOLOGIES
- ROLE_IMPORT_ONTOLOGIES
- name: Profile pour la gestion des contrats des contextes
description: Gestion des contrats des contextes dans Vitam
app-name: CONTEXTS_APP
level:
roles:
- ROLE_GET_CONTEXTS
- ROLE_CREATE_CONTEXTS
- ROLE_UPDATE_CONTEXTS
#- name: profileName
# description: desc
# level: 1
......@@ -147,6 +107,25 @@ customer-init:
- ROLE_CREATE_INGEST
- ROLE_GET_ALL_INGEST
- name: Profil Arbres et Plans
description: Gestion des application d'import d'arbres de positionnement et plans de classement
app-name: HOLDING_FILLING_SCHEME_APP
level:
roles:
- ROLE_CREATE_HOLDING_FILLING_SCHEME
- ROLE_GET_HOLDING_FILLING_SCHEME
- ROLE_GET_ALL_HOLDING_FILLING_SCHEME
- name: Profil pour la gestion des règles de gestion
description: Gestion des règles de gestion
app-name: RULES_APP
level:
roles:
- ROLE_GET_RULES
- ROLE_CREATE_RULES
- ROLE_UPDATE_RULES
- ROLE_DELETE_RULES
# Other Default profiles for admin group
admin-profiles:
#- name: profileName
......
......@@ -6,6 +6,9 @@ spring:
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
data:
mongodb:
uri: "mongodb://{{ mongodb.iam.user }}:{{ mongodb.iam.password }}@{{ mongodb.host }}:{{ mongodb.mongod_port }}/{{ mongodb.iam.db }}?replicaSet={{ mongod_replicaset_name }}&connectTimeoutMS={{ mongod_client_connect_timeout_ms }}"
# should we fix some limit here ?
spring.servlet.multipart.max-file-size: -1
......
......@@ -105,6 +105,13 @@ ui-identity:
{% else %}
identity: "{{ url_prefix }}/identity" # TODO OMA : revoir avec les redirections du RP
{% endif %}
portal-categories:
{% for id, category in vitamui_defaults.portal_categories.iteritems() %}
{{ id }}:
title: "{{ category.title }}"
displayTitle: {{ category.displayTitle }}
order: {{ category.order }}
{% endfor %}
ui:
{% if vitamui_struct.base_url is defined %}
......
......@@ -196,7 +196,8 @@ db.groups.insert({
"system_secure",
"system_dsl",
"system_probative_value",
"system_logbook_operation_profile"
"system_logbook_operation",
"system_holding_filling_scheme_profile"
],
"readonly": false,
"level": "",
......
......@@ -268,7 +268,7 @@ db.profiles.insert({
});
db.profiles.insert({
"_id": "system_logbook_operation_profile",
"_id": "system_logbook_operation",
"identifier" : NumberInt(maxIdProfile++),
"name": "Journal des Opérations",
"description": "Logbook Operation Profile",
......@@ -285,6 +285,30 @@ db.profiles.insert({
]
});
db.profiles.insert({
"_id": "system_holding_filling_scheme_profile",
"identifier" : NumberInt(maxIdProfile++),
"name": "Arbres et Plans",
"description": "Arbres et Plans",
"tenantIdentifier": NumberInt({{ vitamui_platform_informations.proof_tenant }}),
"applicationName": "HOLDING_FILLING_SCHEME_APP",
"level": "",
"enabled": true,
"readonly": false,
"customerId": "system_customer",
"roles": [
{
"name": "ROLE_CREATE_HOLDING_FILLING_SCHEME"
},
{
"name": "ROLE_GET_HOLDING_FILLING_SCHEME"
},
{
"name": "ROLE_GET_ALL_HOLDING_FILLING_SCHEME"
}
]
});
db.sequences.updateOne({
"_id": "profile_identifier"
}, {
......@@ -312,7 +336,8 @@ db.groups.updateOne( {
"system_secure",
"system_dsl",
"system_probative_value",
"system_logbook_operation_profile"
"system_logbook_operation",
"system_holding_filling_scheme_profile"
]
}
}
......
......@@ -220,4 +220,21 @@ db.applications.insert({
"target": "_self"
});
db.applications.insert({
"identifier" : "HOLDING_FILLING_SCHEME_APP",
{% if vitamui.referential.base_url is defined %}
"url": "{{ vitamui.ingest.base_url }}/holding-filling-scheme",
{% else %}
"url": "{{ url_prefix }}/ingest/holding-filling-scheme",
{% endif %}
"icon" : "vitamui-icon vitamui-icon-filing",
"name" : "Arbres et Plans",
"category" : "referential",
"position" : NumberInt(16),
"hasCustomerList" : false,
"hasTenantList" : true,
"hasHighlight" : false,
"tooltip" : "Importer un arbre de positionnement ou un plan de classement",
"target" : "_self"
});
print("END 208_application_ref.js");
......@@ -9,12 +9,12 @@ db.contexts.insert({
"tenants" : [NumberInt({{ vitamui_platform_informations.proof_tenant }}), NumberInt({{ vitamui_platform_informations.cas_tenant }})],
"roleNames" : [
"ROLE_GET_CUSTOMERS",
"ROLE_GET_USERS",
"ROLE_GET_USERS",
"ROLE_GET_PROFILES",
"ROLE_GET_GROUPS",
"ROLE_GET_GROUPS",
"ROLE_GET_PROFILES_ALL_TENANTS",
"ROLE_GET_TENANTS",
"ROLE_GET_ALL_TENANTS",
"ROLE_GET_ALL_TENANTS",
"ROLE_GET_ACCESS_CONTRACTS", "ROLE_CREATE_ACCESS_CONTRACTS", "ROLE_UPDATE_ACCESS_CONTRACTS",
"ROLE_GET_INGEST_CONTRACTS", "ROLE_CREATE_INGEST_CONTRACTS", "ROLE_UPDATE_INGEST_CONTRACTS", "ROLE_GET_MANAGEMENT_CONTRACTS", "ROLE_GET_ARCHIVE_PROFILES",
"ROLE_GET_ONTOLOGIES", "ROLE_CREATE_ONTOLOGIES", "ROLE_DELETE_ONTOLOGIES",
......
......@@ -8,7 +8,9 @@ db.contexts.insert({
"fullAccess" : true,
"tenants" : [NumberInt({{ vitamui_platform_informations.proof_tenant }}), NumberInt({{ vitamui_platform_informations.cas_tenant }})],
"roleNames" : [
"ROLE_CREATE_INGEST", "ROLE_GET_INGEST", "ROLE_GET_ALL_INGEST"
"ROLE_CREATE_INGEST", "ROLE_GET_INGEST", "ROLE_GET_ALL_INGEST",
"ROLE_CREATE_HOLDING_FILLING_SCHEME", "ROLE_GET_HOLDING_FILLING_SCHEME", "ROLE_GET_ALL_HOLDING_FILLING_SCHEME"
]
});
......
......@@ -43,43 +43,6 @@ db.sequences.updateOne({
}
});
// ------------------------------------------- REFERENTIAL TENANT 2 --------------------------------
db.profiles.insert({
"_id" : "auto_system_rules",
"identifier" : NumberInt(maxIdProfile++),
"name" : "Auto Rules Profile",
"description" : "Auto Rules Profile",
"tenantIdentifier": NumberInt(2),
"applicationName" : "RULES_APP",
"enabled" : true,
"readonly" : true,
"level" : "",
"customerId" : "system_customer",
"roles" : [
{
"name": "ROLE_GET_RULES"
},
{
"name": "ROLE_CREATE_RULES"
},
{
"name": "ROLE_UPDATE_RULES"
},
{
"name": "ROLE_DELETE_RULES"
}
]
});
db.sequences.updateOne({
"_id": "profile_identifier"
}, {
$set: {
"sequence": NumberInt(maxIdProfile)
}
});
// ========================================= GROUPS =========================================
// ----------------------------------------- LEVEL "0" -----------------------------------------
......@@ -89,8 +52,7 @@ db.groups.updateOne( {
$addToSet: {
"profileIds": {
$each: [
"system_rules",
"auto_system_rules"
"system_rules"
]
}
}
......
db = db.getSiblingDB('iam')
print("START 307_iam_ref_fix.js");
db.profiles.remove( {"_id": "auto_system_rules"}, true);
// ----------------------------------------- LEVEL "0" -----------------------------------------
db.groups.updateOne( {
"_id": "admin_group"
}, {
$pull: {
"profileIds": "auto_system_rules"
}
} );
......@@ -53,30 +53,6 @@ db.profiles.update(
]}
});
db.profiles.update(
{"_id" : "auto_agencies"},
{$set: {"roles" : [
{
"name": "ROLE_GET_AGENCIES"
},
{
"name": "ROLE_CREATE_AGENCIES"
},
{
"name": "ROLE_UPDATE_AGENCIES"
},
{
"name": "ROLE_DELETE_AGENCIES"
},
{
"name": "ROLE_EXPORT_AGENCIES"
},
{
"name": "ROLE_IMPORT_AGENCIES"
}
]}
});
db.profiles.update(
{"_id" : "system_file_format"},
{$set: {"roles" : [
......
......@@ -40,6 +40,7 @@ import io.cucumber.java.en.When;
import fr.gouv.vitamui.commons.api.domain.CriterionOperator;
import fr.gouv.vitamui.commons.api.domain.QueryDto;
import fr.gouv.vitamui.cucumber.common.CommonSteps;
import fr.gouv.vitamui.referential.common.dto.ContextDto;
import fr.gouv.vitamui.utils.TestConstants;
/**
......@@ -52,8 +53,9 @@ public class ApiReferentialExternalContextCheckSteps extends CommonSteps {
@When("^un utilisateur vérifie l'existence d'un contexte par son identifiant$")
public void un_utilisateur_vérifie_l_existence_d_un_contexte_par_son_identifiant() {
try {
final QueryDto criteria = QueryDto.criteria("id", TestConstants.CONTEXT_NAME, CriterionOperator.EQUALS);
testContext.bResponse = getContextRestClient().checkExist(getSystemTenantUserAdminContext(), TestConstants.CONTEXT_IDENTIFIER);
ContextDto dto = new ContextDto();
dto.setIdentifier(TestConstants.CONTEXT_IDENTIFIER);
testContext.bResponse = getContextRestClient().check(getSystemTenantUserAdminContext(), dto);
}
catch (final RuntimeException e) {
testContext.exception = e;
......@@ -63,10 +65,10 @@ public class ApiReferentialExternalContextCheckSteps extends CommonSteps {
@When("^un utilisateur vérifie l'existence d'un contexte par son code et son nom$")
public void un_utilisateur_vérifie_l_existence_d_un_contexte_par_son_code_et_son_nom() {
try {
final QueryDto criteria = QueryDto.criteria(
"id", TestConstants.CONTEXT_IDENTIFIER, CriterionOperator.EQUALS).addCriterion(
"name",TestConstants.CONTEXT_NAME, CriterionOperator.EQUALS);
testContext.bResponse = getContextRestClient().checkExist(getSystemTenantUserAdminContext(), criteria.toJson());
ContextDto dto = new ContextDto();
dto.setIdentifier(TestConstants.CONTEXT_IDENTIFIER);
dto.setName(TestConstants.CONTEXT_NAME);
testContext.bResponse = getContextRestClient().check(getSystemTenantUserAdminContext(), dto);
}
catch (final RuntimeException e) {
testContext.exception = e;
......
......@@ -79,22 +79,11 @@ public class ApiReferentialExternalContextCreationSteps extends CommonSteps {
final ContextDto dto = FactoryDto.buildDto(ContextDto.class);
testContext.savedContextDto = getContextRestClient().create(getSystemTenantUserAdminContext(), dto);
}
@Then("^le serveur retourne le contexte créé$")
public void le_status_de_la_réponse_doit_etre() {
assertThat(testContext.savedContextDto).overridingErrorMessage("la réponse retournée est null").isNotNull();
}
@Then("^(.*) permissions sont créés dans le contexte$")
public void des_permissions_sont_créés_dans_le_contexte(final Integer profilesNumber) {
assertThat(testContext.savedContextDto.getPermissions()).isNotNull().isNotEmpty();
assertThat(testContext.savedContextDto.getPermissions().size()).isEqualTo(2);
assertThat(testContext.savedContextDto.getPermissions().stream().anyMatch(permission ->
(permission.getTenant().equals("tenant_1") || permission.getTenant().equals("tenant_2"))
)).isTrue();
}
@Then("^une trace de création d'un contexte est présente dans vitam$")
public void une_trace_de_création_d_un_contexte_est_présente_dans_vitam() throws InterruptedException {
super.testTrace(TestConstants.CONTEXT_ID, testContext.contextDto.getIdentifier(), "contexts", "EXT_VITAMUI_CREATE_CONTEXT");
......
......@@ -86,14 +86,12 @@ public class ApiReferentialExternalContextGetSteps extends CommonSteps {
private List<ContextDto> contextDtos;
private ContextDto contextDto;
private JsonNode contextHistory;
@When("^un utilisateur avec le rôle ROLE_GET_CONTEXTS récupère tous les contextes applicatifs en utilisant un certificat full access avec le rôle ROLE_GET_CONTEXTS$")
public void un_utilisateur_avec_le_rôle_ROLE_GET_CONTEXTS_récupère_tous_les_contextes_en_utilisant_un_certificat_full_access_avec_le_rôle_ROLE_GET_CONTEXTS() {
contextDtos = getContextRestClient().getAll(getSystemTenantUserAdminContext());
}
@Then("^le serveur retourne tous les contextes$")
public void le_serveur_retourne_tous_les_contextes() {
assertThat(contextDtos).isNotNull();
......@@ -101,7 +99,6 @@ public class ApiReferentialExternalContextGetSteps extends CommonSteps {
final int size = contextDtos.size();
assertThat(size).isGreaterThanOrEqualTo(1);
}
@When("^un utilisateur avec le rôle ROLE_GET_CONTEXTS récupère un contexte par son identifiant en utilisant un certificat full access avec le rôle ROLE_GET_CONTEXTS$")
public void un_utilisateur_avec_le_rôle_ROLE_GET_CONTEXTS_récupère_un_contexte_par_son_identifiant_en_utilisant_un_certificat_full_access_avec_le_rôle_ROLE_GET_CONTEXTS() {
contextDto = getContextRestClient().getOne(getSystemTenantUserAdminContext(), TestConstants.CONTEXT_IDENTIFIER, Optional.empty());
......@@ -113,7 +110,6 @@ public class ApiReferentialExternalContextGetSteps extends CommonSteps {
assertThat(contextDto.getIdentifier()).isEqualTo(TestConstants.CONTEXT_IDENTIFIER);
assertThat(contextDto.getName()).isEqualTo(TestConstants.CONTEXT_NAME);
}
@When("^un utilisateur avec le rôle ROLE_GET_CONTEXTS récupère tous les contextes par code et nom en utilisant un certificat full access avec le rôle ROLE_GET_CONTEXTS$")
public void un_utilisateur_avec_le_rôle_ROLE_GET_CUSTOMERS_récupère_tous_les_contextes_par_code_et_nom_en_utilisant_un_certificat_full_access_avec_le_rôle_ROLE_GET_CONTEXTS() {
QueryDto criteria = QueryDto.criteria(
......@@ -158,15 +154,12 @@ public class ApiReferentialExternalContextGetSteps extends CommonSteps {
public void le_serveur_retourne_les_clients_paginés() {
le_serveur_retourne_les_contextes_par_code_ou_nom();
}
@When("^un utilisateur avec le rôle ROLE_GET_CONTEXTS récupère l'historique d'un contexte à partir de son son identifiant en utilisant un certificat full access avec le rôle ROLE_GET_CONTEXTS$")
public void un_utilisateur_avec_le_rôle_ROLE_GET_CONTEXTS_récupère_l_historique_d_un_contexte_à_partir_de_son_identifiant_en_utilisant_un_certificat_full_access_avec_le_rôle_ROLE_GET_CONTEXTS() {
contextHistory = getContextRestClient().findHistoryById(getSystemTenantUserAdminContext(), TestConstants.CONTEXT_IDENTIFIER);
}
@Then("^le serveur retourne l'historique du contexte$")
public void le_serveur_retourne_l_historique_du_contexte() {
assertThat(contextHistory).isNotNull();
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment