Skip to content

Commit 4a7aeb2

Browse files
laurentC35nsenavedependabot[bot]renovate[bot]
authored
Refactor: passage à SpringBoot3 et suppression de vieilles dépendances (#274)
* build: update dependencies (#232) * build(deps): bump org.springdoc:springdoc-openapi-ui from 1.7.0 to 1.8.0 (#231) Bumps org.springdoc:springdoc-openapi-ui from 1.7.0 to 1.8.0. --- updated-dependencies: - dependency-name: org.springdoc:springdoc-openapi-ui dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump org.sonarsource.scanner.maven:sonar-maven-plugin (#230) Bumps [org.sonarsource.scanner.maven:sonar-maven-plugin](https://github.com/SonarSource/sonar-scanner-maven) from 3.10.0.2594 to 3.11.0.3922. - [Release notes](https://github.com/SonarSource/sonar-scanner-maven/releases) - [Commits](SonarSource/sonar-scanner-maven@3.10.0.2594...3.11.0.3922) --- updated-dependencies: - dependency-name: org.sonarsource.scanner.maven:sonar-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: bump version * chore(deps): bumb to spring 3.2.4 * ref: move config package to configuration * chore: ref swagger for open-api * chore: ref security (spring 3) * chore: delete old classes * Delete ClientConfig.java * build: update dependencies (#251) * chore(deps): update dependency org.jacoco:jacoco-maven-plugin to v0.8.12 (#247) * build(deps): bump commons-io:commons-io from 2.15.1 to 2.16.0 (#246) * build(deps): bump softprops/action-gh-release from 1 to 2 (#245) Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](softprops/action-gh-release@v1...v2) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat(pogues model): dynamic table line controls (#252) * build: bump pogues-model version Include a new property for dynamic table controls. * build: add maven snapshot repository in pom * chore: webclient for Eno * log: remove rolling file * chore: delete useless annotations * chore: fix import of classes * deps: restore deps * build: clean deps * chore: add stamp to oidcProperties * build: add lombok config * chore: manage execption handling * chore: change to JSON from jackson * chore: change to slf4j * chore: remove useless class * build: change properties convention name * build: remove RollingFile from log * chore: change to webClient for EnoClient * fix: pdf generation * chore: change impl, remove file from generation -> InputStream * fix: eno calling according to String input * chore: remove useless classes * test: adapt tests to new implementation * chire: organize import * deps: bump jacoco.version & remove commons-io * chore: improve variables service * chore: clean import * chore: use Pogues-Model methods to serialize and Deserialize Questionnaire * deps: clean useless deps and use latest version of pogues-model of snapshot * fix: healthcheck with auth * chore: properties, remove redondant props * bump: version to 4.5.0-SNAPSHOT * chore: remove org.json.simple dep, replace by jackson * ref: properties as yaml * chore: remove useless log * chore: organize end-points and depreacted some (ddias for ex.) * Update application.yaml * build: fix deps for snapshots * chore: add logging props * chore: remove log4j.xml conf * bump: version to 4.6.0-SNAPSHOT * chore: restore PR 265 (#277) See #265 * fix: composition in CATI mode (#276) * fix: #270 (#275) * fix: pdf generation with resources (img & fonts) inside jar (#278) * fix: pdf generation with resources (img & fonts) inside jar * chore: organize import * bump: version to 4.6.1-SNAPSHOT * deps: fix cve-2024-22262 * ref: change ModelMapper to IOStreamsUtils * fix: disable cache for font (#279) * bump: version to 4.6.2-SNAPSHOT * fix: uri call for existDB (#280) * ref: simplify error handling (#281) * bump: version to 4.6.3-SNAPSHOT * ref: improve handle of external request with token of user (#282) * bump to 4.6.4-SNAPSHOT * Fix: visu web dsfr (#284) * fix: visu for dsfr use string2InputStream method to avoid issue * bump to 4.6.5-SNAPSHOT * Fix: stamp restriction (#286) * fix: stamp restriction * bump to 4.6.6 * bump version to 4.6.6 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Nicolas Sénave <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nicolas Senave <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent 8ab04b6 commit 4a7aeb2

File tree

153 files changed

+2823
-3560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+2823
-3560
lines changed

.github/workflows/create-release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
path: target/
109109

110110
- name: Create GitHub release
111-
uses: softprops/action-gh-release@v1
111+
uses: softprops/action-gh-release@v2
112112
with:
113113
tag_name: ${{ needs.check-version.outputs.release-version }}
114114
target_commitish: ${{ github.head_ref || github.ref }}

docs/en/security/authentication.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ Connexion to the identity provider (an Open LDAP directory) is made in this clas
55

66
### SecurityContext.java
77

8-
[include](../../../src/main/java/fr/insee/pogues/config/SecurityContext.java)
8+
[include](../../../src/main/java/fr/insee/pogues/configuration/SecurityContext.java)
99

docs/fr/security/authentication.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ Les informations de configuration d'annuaire sont récupérée dans le fichier p
55

66
### Le fichier SecurityContext.java
77

8-
[include](../../../src/main/java/fr/insee/pogues/config/SecurityContext.java)
8+
[include](../../../src/main/java/fr/insee/pogues/configuration/SecurityContext.java)
99

pom.xml

+58-83
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,26 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>2.7.18</version>
8+
<version>3.2.5</version>
99
<relativePath/>
1010
<!-- lookup parent from repository -->
1111
</parent>
1212

1313
<groupId>fr.insee</groupId>
1414
<artifactId>Pogues-BO</artifactId>
1515
<packaging>jar</packaging>
16-
<version>4.4.3</version>
17-
<name>Pogues-BO</name>
16+
<version>4.6.6</version>
17+
<name>Pogues-Back-Office</name>
1818

1919
<properties>
2020
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2121
<java.version>21</java.version>
2222
<final.asset.name>pogues-bo</final.asset.name>
23-
24-
<json-simple.version>1.1.1</json-simple.version>
25-
<pogues-model.version>1.3.3</pogues-model.version>
23+
<pogues-model.version>1.3.7-SNAPSHOT</pogues-model.version>
2624
<fop.version>2.9</fop.version>
27-
<springdoc-openapi-ui.version>1.8.0</springdoc-openapi-ui.version>
28-
<jacoco.version>0.8.11</jacoco.version>
25+
<springdoc-openapi-ui.version>2.0.4</springdoc-openapi-ui.version>
26+
<jacoco.version>0.8.12</jacoco.version>
2927
<saxon.version>12.4</saxon.version>
30-
<commons.io.version>2.15.1</commons.io.version>
31-
<!-- Temp version due to security issues in version used in springdoc-openapi-ui: -->
32-
<snakeyaml.version>2.2</snakeyaml.version>
3328

3429
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
3530
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
@@ -38,38 +33,44 @@
3833
<argLine>-Xms256m -Xmx512m -ea -Dfile.encoding=UTF-8</argLine>
3934
</properties>
4035

41-
<dependencies>
36+
<repositories>
37+
<!-- Maven central snapshot repository -->
38+
<repository>
39+
<id>oss.sonatype.org-snapshot</id>
40+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
41+
<releases>
42+
<enabled>false</enabled>
43+
</releases>
44+
<snapshots>
45+
<enabled>true</enabled>
46+
</snapshots>
47+
</repository>
48+
</repositories>
4249

50+
<dependencies>
4351
<dependency>
4452
<groupId>org.springframework.boot</groupId>
4553
<artifactId>spring-boot-starter-web</artifactId>
46-
<exclusions>
47-
<exclusion>
48-
<groupId>org.springframework.boot</groupId>
49-
<artifactId>spring-boot-starter-logging</artifactId>
50-
</exclusion>
51-
</exclusions>
5254
</dependency>
53-
54-
5555
<dependency>
5656
<groupId>org.springframework.boot</groupId>
5757
<artifactId>spring-boot-starter-data-jdbc</artifactId>
5858
</dependency>
59-
6059
<dependency>
6160
<groupId>org.springframework.boot</groupId>
6261
<artifactId>spring-boot-starter-jersey</artifactId>
6362
</dependency>
6463

65-
64+
<!-- Web-Client-->
6665
<dependency>
67-
<groupId>com.fasterxml.jackson.jaxrs</groupId>
68-
<artifactId>jackson-jaxrs-base</artifactId>
66+
<groupId>org.springframework.boot</groupId>
67+
<artifactId>spring-boot-starter-webflux</artifactId>
6968
</dependency>
69+
70+
<!-- Actuator Metrics -->
7071
<dependency>
71-
<groupId>com.fasterxml.jackson.jaxrs</groupId>
72-
<artifactId>jackson-jaxrs-json-provider</artifactId>
72+
<groupId>org.springframework.boot</groupId>
73+
<artifactId>spring-boot-starter-actuator</artifactId>
7374
</dependency>
7475

7576
<dependency>
@@ -80,18 +81,7 @@
8081
<groupId>org.springframework.boot</groupId>
8182
<artifactId>spring-boot-starter-security</artifactId>
8283
</dependency>
83-
<!-- Add Log4j2 Dependency -->
84-
<dependency>
85-
<groupId>org.springframework.boot</groupId>
86-
<artifactId>spring-boot-starter-log4j2</artifactId>
87-
</dependency>
88-
8984

90-
<dependency>
91-
<groupId>commons-io</groupId>
92-
<artifactId>commons-io</artifactId>
93-
<version>${commons.io.version}</version>
94-
</dependency>
9585
<dependency>
9686
<groupId>org.postgresql</groupId>
9787
<artifactId>postgresql</artifactId>
@@ -111,21 +101,13 @@
111101
<groupId>org.apache.commons</groupId>
112102
<artifactId>commons-lang3</artifactId>
113103
</exclusion>
104+
<exclusion>
105+
<groupId>commons-logging</groupId>
106+
<artifactId>commons-logging</artifactId>
107+
</exclusion>
114108
</exclusions>
115109
</dependency>
116-
<dependency>
117-
<groupId>com.googlecode.json-simple</groupId>
118-
<artifactId>json-simple</artifactId>
119-
<version>${json-simple.version}</version>
120-
</dependency>
121-
<dependency>
122-
<groupId>org.apache.httpcomponents</groupId>
123-
<artifactId>httpclient</artifactId>
124-
</dependency>
125-
<dependency>
126-
<groupId>org.apache.httpcomponents</groupId>
127-
<artifactId>httpmime</artifactId>
128-
</dependency>
110+
<!-- For PDF generation using fop and saxon -->
129111
<dependency>
130112
<groupId>org.apache.xmlgraphics</groupId>
131113
<artifactId>fop</artifactId>
@@ -135,33 +117,26 @@
135117
<groupId>xml-apis</groupId>
136118
<artifactId>xml-apis</artifactId>
137119
</exclusion>
120+
<exclusion>
121+
<groupId>commons-logging</groupId>
122+
<artifactId>commons-logging</artifactId>
123+
</exclusion>
138124
</exclusions>
139125
</dependency>
140126
<dependency>
141127
<groupId>net.sf.saxon</groupId>
142128
<artifactId>Saxon-HE</artifactId>
143129
<version>${saxon.version}</version>
144130
</dependency>
145-
<dependency>
146-
<groupId>org.xmlunit</groupId>
147-
<artifactId>xmlunit-matchers</artifactId>
148-
<scope>test</scope>
149-
</dependency>
150-
<dependency>
151-
<groupId>jakarta.servlet</groupId>
152-
<artifactId>jakarta.servlet-api</artifactId>
153-
<scope>provided</scope>
154-
</dependency>
155-
156-
157131

158132
<!-- SWAGGER -->
159133
<dependency>
160134
<groupId>org.springdoc</groupId>
161-
<artifactId>springdoc-openapi-ui</artifactId>
135+
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
162136
<version>${springdoc-openapi-ui.version}</version>
163137
</dependency>
164138

139+
<!-- Tests -->
165140
<dependency>
166141
<groupId>org.springframework.boot</groupId>
167142
<artifactId>spring-boot-starter-test</artifactId>
@@ -173,33 +148,22 @@
173148
<scope>test</scope>
174149
</dependency>
175150
<dependency>
176-
<groupId>org.projectlombok</groupId>
177-
<artifactId>lombok</artifactId>
151+
<groupId>org.xmlunit</groupId>
152+
<artifactId>xmlunit-matchers</artifactId>
153+
<scope>test</scope>
178154
</dependency>
179155

180-
<!-- TODO: the following dependencies might be further updated when in java 17 -->
181-
<dependency>
182-
<groupId>org.eclipse.persistence</groupId>
183-
<artifactId>org.eclipse.persistence.moxy</artifactId>
184-
<version>2.7.14</version> <!-- 4.0.2 -->
185-
</dependency>
186-
<dependency>
187-
<groupId>javax.xml.bind</groupId> <!-- jakarta.xml.bind -->
188-
<artifactId>jaxb-api</artifactId> <!-- jakarta.xml.bind-api -->
189-
<version>2.3.1</version> <!-- 4.0.1 -->
190-
</dependency>
156+
<!-- compile, annotation like @Getter -->
191157
<dependency>
192-
<groupId>org.glassfish</groupId>
193-
<artifactId>javax.json</artifactId> <!-- jakarta.json -->
194-
<version>1.1.4</version> <!-- 2.0.1 -->
158+
<groupId>org.projectlombok</groupId>
159+
<artifactId>lombok</artifactId>
160+
<scope>provided</scope>
195161
</dependency>
196-
197162
</dependencies>
198163

199164
<build>
200165
<finalName>${final.asset.name}</finalName>
201166
<plugins>
202-
203167
<plugin>
204168
<groupId>org.jacoco</groupId>
205169
<artifactId>jacoco-maven-plugin</artifactId>
@@ -229,13 +193,24 @@
229193
<artifactId>sonar-maven-plugin</artifactId>
230194
<version>3.11.0.3922</version>
231195
</plugin>
232-
233196
<plugin>
234197
<groupId>org.springframework.boot</groupId>
235198
<artifactId>spring-boot-maven-plugin</artifactId>
199+
<executions>
200+
<execution>
201+
<id>build-info</id>
202+
<goals>
203+
<goal>build-info</goal>
204+
</goals>
205+
<configuration>
206+
<additionalProperties>
207+
<description>${project.description}</description>
208+
</additionalProperties>
209+
</configuration>
210+
</execution>
211+
</executions>
236212
</plugin>
237213
</plugins>
238-
239214
</build>
240215

241216
</project>

src/main/java/fr/insee/pogues/Pogues.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
import org.springframework.boot.builder.SpringApplicationBuilder;
66
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
77
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
8+
import org.springframework.transaction.annotation.EnableTransactionManagement;
89

9-
@SpringBootApplication
10+
@SpringBootApplication(scanBasePackages = "fr.insee.pogues")
11+
@EnableTransactionManagement
1012
@ConfigurationPropertiesScan
1113
public class Pogues extends SpringBootServletInitializer {
1214

@@ -18,5 +20,4 @@ protected SpringApplicationBuilder configure(SpringApplicationBuilder applicatio
1820
public static void main(String[] args) {
1921
SpringApplication.run(Pogues.class, args);
2022
}
21-
2223
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package fr.insee.pogues.api.remote.eno.transforms;
2+
3+
import org.springframework.core.io.ByteArrayResource;
4+
5+
public class ByteArrayResourceWithFileName extends ByteArrayResource {
6+
7+
private String fileName;
8+
9+
public ByteArrayResourceWithFileName(String fileName, byte[] byteArray) {
10+
super(byteArray);
11+
this.fileName = fileName;
12+
}
13+
public String getFilename() {
14+
return fileName;
15+
}
16+
}

src/main/java/fr/insee/pogues/api/remote/eno/transforms/EnoClient.java

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
11
package fr.insee.pogues.api.remote.eno.transforms;
22

3-
import java.io.File;
3+
import fr.insee.pogues.exception.EnoException;
4+
45
import java.io.IOException;
56
import java.net.URISyntaxException;
67
import java.util.Map;
78

8-
import fr.insee.pogues.exception.EnoException;
9-
import org.apache.http.client.ClientProtocolException;
10-
119
public interface EnoClient {
1210
/**
1311
*
1412
* Call the Eno API to convert ddi 3.2 data in ddi 3.3
1513
*
16-
* @param fileInput
14+
* @param inputAsString
1715
* @return String
1816
* @throws Exception
1917
*/
20-
String getDDI32ToDDI33 (File fileInput) throws Exception;
18+
String getDDI32ToDDI33 (String inputAsString) throws Exception;
2119

22-
String getDDIToODT (File fileInput) throws Exception;
20+
String getDDIToODT (String inputAsString) throws Exception;
2321

24-
String getXMLPoguesToDDI (File fileInput) throws Exception;
25-
26-
String getDDIToPDF (File fileInput) throws URISyntaxException, ClientProtocolException, IOException;
27-
28-
String getDDIToFO(File fileInput) throws URISyntaxException, ClientProtocolException, IOException, EnoException;
22+
String getXMLPoguesToDDI (String inputAsString) throws Exception;
23+
24+
String getDDIToFO(String inputAsString) throws URISyntaxException, IOException, EnoException;
2925

30-
String getDDITOLunaticXML(File fileInput) throws URISyntaxException, ClientProtocolException, IOException, EnoException;
26+
String getDDITOLunaticXML(String inputAsString) throws URISyntaxException, IOException, EnoException;
3127

32-
String getDDITOLunaticJSON(File fileInput, Map<String, Object> params) throws URISyntaxException, ClientProtocolException, IOException, EnoException;
28+
String getDDITOLunaticJSON(String inputAsString, Map<String, Object> params) throws URISyntaxException, IOException, EnoException;
3329

34-
String getDDITOXForms(File fileInput) throws URISyntaxException, ClientProtocolException, IOException, EnoException;
30+
String getDDITOXForms(String inputAsString) throws URISyntaxException, IOException, EnoException;
3531

3632
void getParameters () throws Exception;
3733

0 commit comments

Comments
 (0)