Commit 1587b9c3 authored by descamps's avatar descamps
Browse files

KDE - 19/11/2021 - Ajout Ui-Referential Ensemble fonctionnel test Postman -...

KDE - 19/11/2021 - Ajout Ui-Referential Ensemble fonctionnel test Postman - Keystore Trustore valide 65 - Change BDD sandbox78
parent a7e8b3c3
......@@ -15,7 +15,7 @@ spring:
register: false
data:
mongodb:
uri: mongodb://mongod_dbuser_iam:mongod_dbpwd_iam@10.6.10.23:27018/iam?connectTimeoutMS=2000
uri: mongodb://mongod_dbuser_iam:mongod_dbpwd_iam@10.6.10.78:27018/iam?connectTimeoutMS=2000
server-identity:
identityName: vitamui-dev
......
# TECHNICAL PROPERTIES / DON'T put environment properties
# This property can be override by a config file give at run time with spring.config.location
spring:
application:
name: ${server-identity.identityRole}
......@@ -10,16 +11,17 @@ spring:
version: v1
mvc:
favicon:
enabled: false
enabled=false
jackson:
serialization:
write-dates-as-timestamps: false
jmx:
unique-names: true
management:
endpoints:
jmx:
domain: ${server-identity.identityRole}
unique-names: true
web.exposure.include: '*'
endpoint:
health:
......
......@@ -268,11 +268,6 @@
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
</dependencies>
<build>
......
......@@ -3,8 +3,8 @@ serverPort: 8444
secure: true
sslConfiguration :
keystore :
- keyPath: keystore_access-external.jks
keyPassword: azerty2
- keyPath: keystore_access-external.p12
keyPassword: azerty4
truststore :
- keyPath: truststore_access-external.jks
keyPassword: azerty10
......
serverHost: 10.6.10.65
serverPort: 8443
secure: true
sslConfiguration :
sslConfiguration:
keystore :
- keyPath: keystore_access-external.jks
keyPassword: azerty2
- keyPath: keystore_access-external.p12
keyPassword: azerty4
truststore :
- keyPath: truststore_access-external.jks
keyPassword: azerty10
......
......@@ -30,7 +30,6 @@ import fr.gouv.vitamui.referential.common.dto.ArchivalProfileUnitDto;
import fr.gouv.vitamui.referential.common.dto.ArchivalProfileUnitResponseDto;
import fr.gouv.vitamui.referential.common.service.VitamArchivalProfileUnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.MongoTransactionManager;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
......@@ -51,8 +50,6 @@ public class ArchivalProfileUnitInternalService {
private VitamArchivalProfileUnitService vitamArchivalProfileUnitService;
private MongoTransactionManager mongoTransactionManager;
private InternalSecurityService internalSecurityService;
@Autowired
......
......@@ -65,7 +65,6 @@ import fr.gouv.vitamui.referential.common.dto.ProfileDto;
import fr.gouv.vitamui.referential.common.dto.ProfileResponseDto;
import fr.gouv.vitamui.referential.common.service.VitamProfileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.MongoTransactionManager;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
......@@ -88,8 +87,6 @@ public class ProfileInternalService {
private VitamProfileService vitamProfileService;
private MongoTransactionManager mongoTransactionManager;
private InternalSecurityService internalSecurityService;
......
serverHost: 10.6.10.34
serverPort: 8444
secure: true
sslConfiguration :
keystore :
- keyPath: keystore_ihm-demo.p12
keyPassword: azerty4
truststore :
- keyPath: truststore_ihm-demo.jks
keyPassword: azerty10
hostnameVerification: true
serverHost: ingest-external.service.consul
serverPort: 8443
secure: true
sslConfiguration :
keystore :
- keyPath: keystore_ihm-demo.p12
keyPassword: azerty4
truststore :
- keyPath: truststore_ihm-demo.jks
keyPassword: azerty10
hostnameVerification: true
......@@ -9,7 +9,7 @@ spring:
register: false
data:
mongodb:
uri: mongodb://mongod_dbuser_security:mongod_dbpwd_security@10.6.10.23:27018/security?connectTimeoutMS=2000
uri: mongodb://mongod_dbuser_security:mongod_dbpwd_security@10.6.10.78:27018/security?connectTimeoutMS=2000
server-identity:
identityName: vitamui-dev
......
#!/bin/bash
#mvn clean package -DskipTests
java -Dspring.config.additional-location=src/main/config/cas-server-application-dev.yml -jar -Xms128m -Xmx512m target/cas-server.war
$JAVA_HOME/bin/java -Dspring.config.additional-location=src/main/config/cas-server-application-dev.yml -jar -Xms128m -Xmx512m target/cas-server.war
......@@ -61,7 +61,7 @@ cas.authn.pm.reset.crypto.enabled: true
cas.server.prefix: https://dev.vitamui.com:8080/cas
login.url: ${cas.server.prefix}/login
cas.serviceRegistry.mongo.clientUri: mongodb://mongod_dbuser_cas:mongod_dbpwd_cas@10.6.10.23:27018/cas
cas.serviceRegistry.mongo.clientUri: mongodb://mongod_dbuser_cas:mongod_dbpwd_cas@10.6.10.78:27018/cas
#cas.serviceRegistry.mongo.port: 27018
#cas.serviceRegistry.mongo.databaseName: cas
......
/*
Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020)
Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020)
[dad@cines.fr]
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
profiles based on the french SEDA stardard
(https://redirect.francearchives.fr/seda/).
This software is governed by the CeCILL-C license under French law and
abiding by the rules of distribution of free software. You can use,
abiding by the rules of distribution of free software. You can use,
modify and/ or redistribute the software under the terms of the CeCILL-C
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
"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.
liability.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
......@@ -28,9 +28,9 @@ 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.
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-C license and that you accept its terms.
......@@ -38,7 +38,7 @@ knowledge of the CeCILL-C license and that you accept its terms.
import { HttpClient } from '@angular/common/http';
import { Inject, Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { BaseHttpClient, BASE_URL } from 'ui-frontend-common';
import { BASE_URL } from 'ui-frontend-common';
import { environment } from '../../../environments/environment';
@Injectable({
......@@ -56,7 +56,7 @@ export class PastisApiService{
getBaseUrl() {
return this.baseUrl;
}
// Generic GET Method
get<T = any>(path: string, options?: {}): Observable<T> {
console.error("================================ " + this.baseUrl)
......
......@@ -44,27 +44,7 @@ import fr.gouv.vitamui.iam.external.client.ExternalParametersExternalRestClient;
import fr.gouv.vitamui.iam.external.client.IamExternalRestClientFactory;
import fr.gouv.vitamui.iam.external.client.IamExternalWebClientFactory;
import fr.gouv.vitamui.iam.external.client.TenantExternalRestClient;
import fr.gouv.vitamui.referential.external.client.AccessContractExternalRestClient;
import fr.gouv.vitamui.referential.external.client.AccessionRegisterDetailExternalRestClient;
import fr.gouv.vitamui.referential.external.client.AccessionRegisterSummaryExternalRestClient;
import fr.gouv.vitamui.referential.external.client.AgencyExternalRestClient;
import fr.gouv.vitamui.referential.external.client.AgencyExternalWebClient;
import fr.gouv.vitamui.referential.external.client.ContextExternalRestClient;
import fr.gouv.vitamui.referential.external.client.FileFormatExternalRestClient;
import fr.gouv.vitamui.referential.external.client.FileFormatExternalWebClient;
import fr.gouv.vitamui.referential.external.client.IngestContractExternalRestClient;
import fr.gouv.vitamui.referential.external.client.LogbookManagementOperationExternalRestClient;
import fr.gouv.vitamui.referential.external.client.ManagementContractExternalRestClient;
import fr.gouv.vitamui.referential.external.client.OntologyExternalRestClient;
import fr.gouv.vitamui.referential.external.client.OntologyExternalWebClient;
import fr.gouv.vitamui.referential.external.client.OperationExternalRestClient;
import fr.gouv.vitamui.referential.external.client.ProfileExternalRestClient;
import fr.gouv.vitamui.referential.external.client.ReferentialExternalRestClientFactory;
import fr.gouv.vitamui.referential.external.client.ReferentialExternalWebClientFactory;
import fr.gouv.vitamui.referential.external.client.RuleExternalRestClient;
import fr.gouv.vitamui.referential.external.client.RuleExternalWebClient;
import fr.gouv.vitamui.referential.external.client.SecurityProfileExternalRestClient;
import fr.gouv.vitamui.referential.external.client.UnitExternalRestClient;
import fr.gouv.vitamui.referential.external.client.*;
import fr.gouv.vitamui.ui.commons.property.UIProperties;
import fr.gouv.vitamui.ui.commons.security.SecurityConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
......@@ -122,6 +102,11 @@ public class ReferentialContextConfiguration extends AbstractContextConfiguratio
return referentialExternalRestClientFactory.getFileFormatExternalRestClient();
}
@Bean
public ArchivalProfileUnitExternalRestClient archivalProfileCrudRestClient(final ReferentialExternalRestClientFactory referentialExternalRestClientFactory) {
return referentialExternalRestClientFactory.getArchivalProfileExternalRestClient();
}
@Bean
public ContextExternalRestClient contextCrudRestClient(final ReferentialExternalRestClientFactory referentialExternalRestClientFactory) {
return referentialExternalRestClientFactory.getContextExternalRestClient();
......@@ -187,6 +172,16 @@ public class ReferentialContextConfiguration extends AbstractContextConfiguratio
return referentialExternalWebClientFactory.getFileFormatExternalWebClient();
}
@Bean
public ArchivalProfileUnitExternalWebClient archivalProfileWebRestClient(final ReferentialExternalWebClientFactory referentialExternalWebClientFactory) {
return referentialExternalWebClientFactory.getArchivalProfileExternalWebClient();
}
@Bean
public ProfileExternalWebClient profileExternalWebClient(final ReferentialExternalWebClientFactory referentialExternalWebClientFactory) {
return referentialExternalWebClientFactory.getProfileExternalWebClient();
}
@Bean
public OntologyExternalWebClient ontologyWebRestClient(final ReferentialExternalWebClientFactory referentialExternalWebClientFactory) {
return referentialExternalWebClientFactory.getOntologyExternalWebClient();
......
package fr.gouv.vitamui.referential.rest;
import com.fasterxml.jackson.databind.JsonNode;
import fr.gouv.vitamui.commons.api.CommonConstants;
import fr.gouv.vitamui.commons.api.ParameterChecker;
import fr.gouv.vitamui.commons.api.domain.DirectionDto;
import fr.gouv.vitamui.commons.api.domain.PaginatedValuesDto;
import fr.gouv.vitamui.commons.api.logger.VitamUILogger;
import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory;
import fr.gouv.vitamui.commons.rest.AbstractUiRestController;
import fr.gouv.vitamui.commons.rest.util.RestUtils;
import fr.gouv.vitamui.referential.common.dto.ArchivalProfileUnitDto;
import fr.gouv.vitamui.referential.common.rest.RestApi;
import fr.gouv.vitamui.referential.service.ArchivalProfileUnitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.Optional;
@Api(tags = "archival-profile")
@RestController
@RequestMapping("referential-api/archival-profile")
@Consumes("application/json")
@Produces("application/json")
public class ArchivalProfileUnitController extends AbstractUiRestController {
protected final ArchivalProfileUnitService service;
private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(ArchivalProfileUnitController.class);
@Autowired
public ArchivalProfileUnitController(final ArchivalProfileUnitService service) {
this.service = service;
}
/**
* Get all Archival Unit Profiles
* @param criteria
* @return
*/
@ApiOperation(value = "Get entity")
@GetMapping
@ResponseStatus(HttpStatus.OK)
public Collection<ArchivalProfileUnitDto> getAll(final Optional<String> criteria) {
LOGGER.debug("Get all with criteria={}", criteria);
RestUtils.checkCriteria(criteria);
return service.getAll(buildUiHttpContext(), criteria);
}
/**
* Get All Archival Unit Profiles Paginated
* @param page
* @param size
* @param criteria
* @param orderBy
* @param direction
* @return
*/
@ApiOperation(value = "Get entities paginated")
@GetMapping(params = {"page", "size"})
@ResponseStatus(HttpStatus.OK)
public PaginatedValuesDto<ArchivalProfileUnitDto> getAllPaginated(@RequestParam final Integer page, @RequestParam final Integer size,
@RequestParam final Optional<String> criteria, @RequestParam final Optional<String> orderBy, @RequestParam final Optional<DirectionDto> direction) {
LOGGER.debug("getAllPaginated page={}, size={}, criteria={}, orderBy={}, ascendant={}", page, size, criteria, orderBy, direction);
return service.getAllPaginated(page, size, criteria, orderBy, direction, buildUiHttpContext());
}
/**
* Get Archival Unit Profile by Identifier
* @param identifier
* @return
* @throws UnsupportedEncodingException
*/
@ApiOperation(value = "Get profile by ID")
@GetMapping(path = RestApi.PATH_REFERENTIAL_ID)
@ResponseStatus(HttpStatus.OK)
public ArchivalProfileUnitDto getById(final @PathVariable("identifier") String identifier) throws UnsupportedEncodingException {
LOGGER.debug("getById {} / {}", identifier, URLEncoder.encode(identifier, StandardCharsets.UTF_8.toString()));
ParameterChecker.checkParameter("The Identifier is a mandatory parameter: ", identifier);
return service.getOne(buildUiHttpContext(), URLEncoder.encode(identifier, StandardCharsets.UTF_8.toString()));
}
/**
* Modify Archival Unit Profile by Identifier
*
* @param archivalProfileUnitDto
* @return
*/
@ApiOperation(value = "Update entity")
@PutMapping(CommonConstants.PATH_ID)
@ResponseStatus(HttpStatus.OK)
public ArchivalProfileUnitDto update(@RequestBody final ArchivalProfileUnitDto archivalProfileUnitDto) {
LOGGER.debug("update profile {}", archivalProfileUnitDto.getId());
return service.update(buildUiHttpContext(), archivalProfileUnitDto);
}
/**
* Create Archival Unit Profile
*
* @param archivalProfileUnitDto
* @return
*/
@ApiOperation(value = "Create Archival Unit Profile")
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
public ArchivalProfileUnitDto create(@Valid @RequestBody ArchivalProfileUnitDto archivalProfileUnitDto) {
LOGGER.debug("create archival unit profile={}", archivalProfileUnitDto);
return service.create(buildUiHttpContext(), archivalProfileUnitDto);
}
/**
* Import Archival Unit Profile from json file
* @param request HTTP request
* @param file the file to import
* @return the Vitam response
*/
@ApiOperation(value = "import Archival Unit Profile")
@PostMapping(CommonConstants.PATH_IMPORT)
public JsonNode importProfiles(@Context HttpServletRequest request, MultipartFile file) {
LOGGER.debug("Import Archival Unit Profile from a file {}", file != null ? file.getOriginalFilename() : null);
return service.importArchivalUnitProfiles(buildUiHttpContext(), file);
}
/**
* Check access
*
* @param archivalProfileUnitDto
* @return
*/
@ApiOperation(value = "Check ability to create ontology")
@PostMapping(path = CommonConstants.PATH_CHECK)
public ResponseEntity<Void> check(@RequestBody ArchivalProfileUnitDto archivalProfileUnitDto) {
LOGGER.debug("check ability to create profile={}", archivalProfileUnitDto);
final boolean exist = service.check(buildUiHttpContext(), archivalProfileUnitDto);
LOGGER.debug("response value={}" + exist);
return RestUtils.buildBooleanResponse(exist);
}
}
/**
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2020)
* and the signatories of the "VITAM - Accord du Contributeur" agreement.
*
* <p>
* contact@programmevitam.fr
*
* <p>
* This software is a computer program whose purpose is to implement
* implement a digital archiving front-office system for the secure and
* efficient high volumetry VITAM solution.
*
* <p>
* This software is governed by the CeCILL-C 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-C
* license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info".
*
* <p>
* 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.
*
* <p>
* 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,
......@@ -30,37 +30,49 @@
* 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.
*
* <p>
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*/
package fr.gouv.vitamui.referential.rest;
import java.util.Collection;
import java.util.Optional;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.databind.JsonNode;
import fr.gouv.vitamui.commons.api.CommonConstants;
import fr.gouv.vitamui.commons.api.ParameterChecker;
import fr.gouv.vitamui.commons.api.domain.DirectionDto;
import fr.gouv.vitamui.commons.api.domain.PaginatedValuesDto;
import fr.gouv.vitamui.commons.api.logger.VitamUILogger;
import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory;
import fr.gouv.vitamui.commons.rest.AbstractUiRestController;
import fr.gouv.vitamui.commons.rest.util.RestUtils;
import fr.gouv.vitamui.referential.common.dto.ProfileDto;
import fr.gouv.vitamui.referential.common.rest.RestApi;
import fr.gouv.vitamui.referential.service.ProfileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.Optional;
@Api(tags = "profile")
@RestController
@RequestMapping("${ui-referential.prefix}/profile")
@RequestMapping("referential-api/profile")
@Consumes("application/json")
@Produces("application/json")
public class ProfileController extends AbstractUiRestController {
......@@ -74,6 +86,11 @@ public class ProfileController extends AbstractUiRestController {
this.service = service;
}
/**