Skip to content
Snippets Groups Projects
Unverified Commit d3ea578b authored by Makhtar DIAGNE's avatar Makhtar DIAGNE Committed by GitHub
Browse files

Java11 (#41)


* [TECH] Nginx add referential apps

* [TECH] Fix theme default logo

* [TECH] Fixes from PR review

* [TECH] Strange fixes for ui-referential (why was it working)

* Update ui/ui-frontend/projects/identity/src/locale/messages.xlf

Co-authored-by: default avatarCouzinieAtCines <62284459+CouzinieAtCines@users.noreply.github.com>

* [TECH] Merge fixes

* compilation works

* it runs

* fix login/pwd authentication

* handle provided username

* some refactoring

* login/pwd + authn delegation works (with or without service)

* surrogation works

* change password is triggered when the user is already authenticated using the doChangePassword parameter

* password management

* final tests on surrogation

* WIP MFA

* MFA works

* [TECH]  Update project from JAVA8 to JAVA11 with dependencies

* [TECH] Remove unused jks files in integration data

* fix back links

* don't lost surrogation when bad password

* [TECH] CAS set metrics dependency for prometheus

* clean Spring config and open management endpoints

* fix surrogation lost on bad password

* [TECH] Configure Prometheus for SpringBoot services

* [TECH] Use smtp4dev in our dev environment

* [TECH] RPM update jdk from 1.8 to 11

* [DEVOPS] Fix unknown variable vitamui_services.x.dir.assets

* [DEVOPS] Update scripts for deployment

* [DLAB-3453] Update operation in order to extend it

* [DLAB-3453] Remove priority on OperationStatus

* [US DLAB-3806] Add pdf generation with images[US DLAB-3806] Add TU on PDF generation

* ⅜TECH] Fix merge deployment task

* fix session hard timeout instead of idle timeout

* upgrade to CAS v6.1.6 and pac4j v4.0.0

* [TECH] CAS Security : add hostnameverifier optional property, activated by default

* [devops] add validation of java 11

* [DEVOPS] Fix vitam-ui dpeloyment

* [WIP] Upgrade logstash config according to Java 11

* [TECH] Update deployment

* [TECH] Security / Authentification : Fix  token increment

* [TECH] Fix deployment maven build

* RABB-519: corrige l'erreur en cas de ticket expiré

* [TECH] Remove compiler overloading in cas server pom

* [DEVOPS] Improve mongo deployment

* [TECH] Update nginx conf in order to view objects

* [devops] add tags for service installation

* [DEVOPS] Add vitamui uninstallation

* [devops] put consul as vitam service

* [TECH] Frontend : Some cleaning & optimization

optimisation

* [TECH] FIx ui frontend plugin & configuration

* [TECH] Fix recette configuration

* [TECH] CAS : Set default data for twilio account

* [TECH] Fix deployment uninstall when file is absent

* [TECH] Cas : fix war build with tomcat dependencies

* [TECH] Fix ui frontend plugin and configuration (bis)

* [TECH] CAS 6.1.6 : update static templates, js & add theming variables

* [FIX RABB-579] Fix error sending mail from iam-internal

* [TECH] Frontend use assets from ui-frontend-common & update branding

* [FIX RABB-539] Handle redirections for CAS Authentication failure

* [TECH] Frontend : add gzip compression

* [TECH] Uninstall remove assets

* [FIX RABB-555] Fix cas deployment config and password init for a new user

* [TECH] Fix merge

* [TECH] Fix merges

* Update Jenkinsfile

Changed label from "contrib" to "java11" for building purpose

* Update Jenkinsfile

* fix cas-server dependencies, styles ui-ref, deployment archive

* fix test iam-internal

* redo tar.gz

* zip deployment

* add prod profile for frontend

* fix maven-assembly-plugin version and webpack profile

* Try generating zip package archive

Co-authored-by: default avatarMakhtar DIAGNE <makhtar.diagne@teamdlab.com>
Co-authored-by: default avatarCouzinieAtCines <62284459+CouzinieAtCines@users.noreply.github.com>
Co-authored-by: default avatarJérôme LELEU <jerome.leleu@teamdlab.com>
Co-authored-by: default avatarMathieu Leguay <mathieu.leguay@teamdlab.com>
Co-authored-by: default avatarFranck Bebel <franck.bebel@ouidou.fr>
Co-authored-by: default avatardeviller <burma@free.fr>
Co-authored-by: default avatarThierry Devillechabrolle <60743409+TDevillechabrolle@users.noreply.github.com>
Co-authored-by: default avatarapp-jenkins <romain.gordolo@xelians.fr>
Co-authored-by: default avatarGaëlle FOURNIER <gaelle.fournier.work@gmail.com>
parent 8aca1e4d
No related branches found
No related tags found
No related merge requests found
Showing
with 85 additions and 79 deletions
......@@ -149,6 +149,7 @@ maven-eclipse.xml
*.*~
*~
.merge_file*
.java-version
######################
# Gradle Wrapper
......
......@@ -209,16 +209,23 @@ Autre possibilité, Ansible version 2.7.0 doit être installé pour lancer le sc
├── tools
│ ├── docker
│ │ ├── mongo: './restart_dev.sh'
### 2 - Démarrage du docker smpt4dev
```
├── tools
│ ├── docker
│ │ ├── mail: './start.sh'
```
### 2 - Lancement de l'application SpringBoot Security-Internal
### 3 - Lancement de l'application SpringBoot Security-Internal
```
│ ├── api-security
│ │ ├── security-internal: 'mvn clean spring-boot:run' ou './run.sh'
```
### 3 - Lancement de l'application SpringBoot IAM-Internal
### 4 - Lancement de l'application SpringBoot IAM-Internal
```
├── api
......@@ -226,7 +233,7 @@ Autre possibilité, Ansible version 2.7.0 doit être installé pour lancer le sc
│ │ ├── iam-internal: 'mvn clean spring-boot:run' ou './run.sh'
```
### 4 - Lancement de l'application SpringBoot IAM-External
### 5 - Lancement de l'application SpringBoot IAM-External
```
├── api
......@@ -235,7 +242,7 @@ Autre possibilité, Ansible version 2.7.0 doit être installé pour lancer le sc
ou './run.sh'
```
### 5 - Lancement de l'application CAS Server. La surcharge faite sur CAS nous empêche de lancer avec le plugin spring-boot
### 6 - Lancement de l'application CAS Server. La surcharge faite sur CAS nous empêche de lancer avec le plugin spring-boot
**CAS-Server dépend de security-internal, iam-internal & iam-external**
......@@ -246,28 +253,28 @@ Autre possibilité, Ansible version 2.7.0 doit être installé pour lancer le sc
## Scénario 1 : utilisation en dev
### 6a - Lancement de l'application SpringBoot correspondant au back de UI-Portal
### 7a - Lancement de l'application SpringBoot correspondant au back de UI-Portal
```
└── ui
└── ui-portal: 'mvn clean spring-boot:run'
```
### 6b - Lancement de l'application Angular UI-Portal
### 7b - Lancement de l'application Angular UI-Portal
```
└── ui
├── ui-frontend: 'npm run start:portal'
```
### 7a - Lancement de l'application SpringBoot correspondant au back de UI-Identity
### 8a - Lancement de l'application SpringBoot correspondant au back de UI-Identity
```
└── ui
└── ui-identity: 'mvn clean spring-boot:run'
```
### 7b - Lancement de l'application Angular UI-Identity
### 8b - Lancement de l'application Angular UI-Identity
```
└── ui
......@@ -278,21 +285,21 @@ Autre possibilité, Ansible version 2.7.0 doit être installé pour lancer le sc
**Attention les JAR doivent contenir les pages et scripts de la partie UI Frontend généré avec ng build.**
### 6 - Lancement de l'application SpringBoot correspondant au back de UI-Portal
### 7 - Lancement de l'application SpringBoot correspondant au back de UI-Portal
```
└── ui
└── ui-portal: './run.sh'
```
### 7 - Lancement de l'application SpringBoot correspondant au back de UI-Identity
### 8 - Lancement de l'application SpringBoot correspondant au back de UI-Identity
```
└── ui
└── ui-identity : './run.sh'
```
### 8. Les certificats sont auso-signés, il faut accepter les certificats dans le navigateur pour :
### 9. Les certificats sont auso-signés, il faut accepter les certificats dans le navigateur pour :
**Attention : sans cette étape, le logout sur toutes les applications par CAS ne fonctionne pas**
......@@ -308,5 +315,8 @@ Ui-Back
* https://dev.vitamui.com:9001/
### 9. Se connecter sur le portail via
### 10. Se connecter sur le portail via
* https://dev.vitamui.com:4200
### 11. Se connecter sur la page de réception des mails smpt4dev via
* http://localhost:3000/
......@@ -27,17 +27,16 @@
<artifactId>spring-boot-starter-json</artifactId>
<scope>provided</scope>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<scope>provided</scope>
</dependency>
<!-- PAC4J -->
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-saml</artifactId>
<artifactId>pac4j-saml-opensamlv3</artifactId>
<scope>provided</scope>
</dependency>
......
......@@ -39,10 +39,8 @@ package fr.gouv.vitamui.iam.common.utils;
import java.util.Base64;
import java.util.Optional;
import javax.validation.constraints.NotNull;
import org.apache.commons.lang3.StringUtils;
import org.pac4j.core.context.Pac4jConstants;
import org.pac4j.core.util.Pac4jConstants;
import org.pac4j.core.exception.TechnicalException;
import org.pac4j.core.util.CommonHelper;
import org.pac4j.saml.client.SAML2Client;
......@@ -50,6 +48,8 @@ import org.pac4j.saml.config.SAML2Configuration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ByteArrayResource;
import javax.validation.constraints.NotNull;
import fr.gouv.vitamui.commons.api.exception.InvalidFormatException;
import fr.gouv.vitamui.commons.rest.ErrorsConstants;
import fr.gouv.vitamui.iam.common.dto.IdentityProviderDto;
......@@ -82,7 +82,7 @@ public class Saml2ClientBuilder {
final byte[] keystore = Base64.getDecoder().decode(keystoreBase64);
String entityIdUrl = casLoginUrl + "/" + technicalName;
final String entityIdUrl = casLoginUrl + "/" + technicalName;
final SAML2Configuration saml2Config = new SAML2Configuration(
new ByteArrayResource(keystore),
keystorePassword,
......
......@@ -68,6 +68,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
......@@ -92,23 +96,19 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<!-- Metrics -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- PAC4J -->
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-saml</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
<!-- Hibernate -->
<!-- PAC4J -->
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-saml-opensamlv3</artifactId>
</dependency>
<!-- UTIL -->
......
......@@ -20,7 +20,7 @@ management:
jmx:
domain: ${server-identity.identityRole}
unique-names: true
web.exposure.include: info,health,prometheus
web.exposure.include: '*'
endpoint:
health:
show-details: always
......
......@@ -4,7 +4,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
......
......@@ -7,7 +7,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Optional;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
......
......@@ -6,7 +6,7 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
......
......@@ -80,6 +80,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
......@@ -110,23 +114,15 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<!-- Metrics -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- PAC4J -->
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-saml</artifactId>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<artifactId>pac4j-saml-opensamlv3</artifactId>
</dependency>
<!-- UTIL -->
......@@ -167,6 +163,10 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>fr.gouv.vitam</groupId>
<artifactId>common-private</artifactId>
</dependency>
<!-- Documentation -->
<dependency>
......
......@@ -46,7 +46,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.NotImplementedException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -410,7 +409,7 @@ public class CustomerInternalService extends VitamUICrudService<CustomerDto, Cus
}
private void checkEmailDomains(final List<String> emailDomains, final String message) {
Assert.isTrue(CollectionUtils.isNotEmpty(emailDomains), message + ": a customer must have emails domains.");
Assert.isTrue(emailDomains != null && emailDomains.size() > 0, message + ": a customer must have emails domains.");
for (final String domain : emailDomains) {
Assert.isTrue(StringUtils.isNoneBlank(domain), message + ": an email domain is empty");
......@@ -420,7 +419,7 @@ public class CustomerInternalService extends VitamUICrudService<CustomerDto, Cus
}
private void checkEmailDomains(final List<String> emailDomains, final String customerId, final String message) {
Assert.isTrue(CollectionUtils.isNotEmpty(emailDomains), message + ": a customer must have emails domains.");
Assert.isTrue(emailDomains != null && emailDomains.size() > 0, message + ": a customer must have emails domains.");
for (final String domain : emailDomains) {
Assert.isTrue(StringUtils.isNoneBlank(domain), message + ": an email domain is empty");
......@@ -432,7 +431,7 @@ public class CustomerInternalService extends VitamUICrudService<CustomerDto, Cus
}
private void checkOwners(final List<OwnerDto> owners, final String message) {
Assert.isTrue(CollectionUtils.isNotEmpty(owners), message + ": a customer must have owners.");
Assert.isTrue(owners != null && owners.size() > 0, message + ": a customer must have owners.");
}
public JsonNode findHistoryById(final String id) throws VitamClientException {
......
......@@ -40,7 +40,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import fr.gouv.vitamui.commons.api.converter.Converter;
......
......@@ -45,7 +45,7 @@ import java.util.Map.Entry;
import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
......@@ -373,7 +373,7 @@ public class IdentityProviderInternalService extends VitamUICrudService<Identity
final Customer customer = customerRepository.findById(customerId)
.orElseThrow(() -> new IllegalArgumentException("no customer found for " + customerId));
List<String> availablesDomains = customer.getEmailDomains();
if (CollectionUtils.isNotEmpty(customer.getEmailDomains())) {
if (CollectionUtils.isNotEmpty(idp)) {
availablesDomains = availablesDomains.stream().filter(s -> !filterDomains.contains(s)).collect(Collectors.toList());
}
return availablesDomains;
......
......@@ -50,7 +50,7 @@ import fr.gouv.vitamui.commons.api.utils.ApiUtils;
import fr.gouv.vitamui.commons.logbook.util.LogbookUtils;
import fr.gouv.vitamui.commons.utils.VitamUIUtils;
import fr.gouv.vitamui.iam.internal.server.profile.domain.Profile;
import io.micrometer.core.instrument.util.StringUtils;
import org.apache.commons.lang3.StringUtils;
public class ProfileConverter implements Converter<ProfileDto, Profile> {
......
......@@ -106,7 +106,7 @@ public class IamAuthentificationService {
// Save token to extend its lifetime but the very old tokens used in development
final LocalDate date = convertToLocalDate(token.getUpdatedDate());
if (date.isAfter(LocalDate.of(2018, 10, 1))) {
token.setUpdatedDate(DateUtils.addMinutes(new Date(), tokenAdditionalTtl));
token.setUpdatedDate(DateUtils.addMinutes(token.getUpdatedDate(), tokenAdditionalTtl));
tokenRepository.save(token);
}
}
......
......@@ -20,7 +20,7 @@ management:
jmx:
domain: ${server-identity.identityRole}
unique-names: true
web.exposure.include: info,health,prometheus
web.exposure.include: '*'
endpoint:
health:
show-details: always
......
......@@ -11,13 +11,15 @@ import org.mockito.MockitoAnnotations;
import fr.gouv.vitamui.commons.api.domain.OwnerDto;
import fr.gouv.vitamui.iam.internal.server.owner.service.OwnerInternalService;
import fr.gouv.vitamui.iam.internal.server.utils.IamServerUtilsTest;
import fr.gouv.vitamui.commons.test.utils.AbstractServerIdentityBuilder;
/**
* Tests the {@link OwnerInternalController}.
*
*
*/
public final class OwnerInternalControllerTest {
public final class OwnerInternalControllerTest extends AbstractServerIdentityBuilder {
@InjectMocks
private OwnerInternalController controller;
......
......@@ -48,16 +48,10 @@
<artifactId>common-public</artifactId>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<!-- PAC4J -->
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-saml</artifactId>
<artifactId>pac4j-saml-opensamlv3</artifactId>
<scope>provided</scope>
</dependency>
......@@ -72,6 +66,11 @@
<artifactId>spring-boot-starter-json</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<scope>provided</scope>
</dependency>
<!-- Documentation -->
<dependency>
......
......@@ -27,17 +27,15 @@
<artifactId>spring-boot-starter-json</artifactId>
<scope>provided</scope>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- PAC4J -->
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-saml</artifactId>
<artifactId>pac4j-saml-opensamlv3</artifactId>
<scope>provided</scope>
</dependency>
......
......@@ -96,6 +96,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- Metrics -->
<dependency>
......@@ -106,13 +110,7 @@
<!-- PAC4J -->
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-saml</artifactId>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<artifactId>pac4j-saml-opensamlv3</artifactId>
</dependency>
<!-- UTIL -->
......
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