Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade access control classes #408

Merged
merged 42 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
512162b
feat(default stamp when unkown) first dev : red tests :-( #390
Aug 31, 2023
264435b
feat(default stamp when unkown) test log and tests are green #390
Sep 1, 2023
542fad9
feat(default stamp when unkown) test log and tests are green and good…
Sep 6, 2023
7403de3
Merge pull request #392 from InseeFr/390-utiliser-un-timbre-anonymein…
Sep 15, 2023
fe58b51
Merge(stash) merge local work to improve auth config web class
Sep 18, 2023
9a48242
git (merge local changes) merge stash changed for #391 with PR 392
Sep 18, 2023
3986b2a
refactor (authent) upgrade pom and decprecated lib and deprectaed spr…
Sep 26, 2023
4cec5ca
refactor (log properties) Improve log properties when starting
Sep 28, 2023
9a5c292
refactor (/user/stamp) use stamp record to generate expected json
Sep 28, 2023
79ebcd8
refactor (test dans config) Tests green and size down Config class
Sep 28, 2023
c97d2b0
fix(Bauhaus) param swagger scheme + improve @Conditional for DefaultS…
Oct 2, 2023
e216fdf
pom(increment version) 3.6.1
Oct 2, 2023
a07c4a3
fix(openapi) url for swagger
Oct 2, 2023
0ae6717
pom(increase version)
Oct 2, 2023
9c49c8c
feat(module in prop) define active modules in fr.insee.rmes.bauhaus.a…
Oct 2, 2023
ed5a746
feat(improve queries log) better log sparql queries when exception
Oct 2, 2023
4ed1e15
fix(escape < for sparql queries) also refactor to decouplate ObjectTy…
Oct 4, 2023
6f86f5c
feat(default stamp when unkown) first dev : red tests :-( #390
Aug 31, 2023
cab62f4
feat(default stamp when unkown) test log and tests are green #390
Sep 1, 2023
47ff070
feat(default stamp when unkown) test log and tests are green and good…
Sep 6, 2023
ce50ece
Merge(stash) merge local work to improve auth config web class
Sep 18, 2023
e8bfcb8
Rebase from main
Oct 9, 2023
4cc41ae
refactor (authent) upgrade pom and decprecated lib and deprectaed spr…
Sep 26, 2023
8168dbc
refactor (log properties) Improve log properties when starting
Sep 28, 2023
d07f126
refactor (/user/stamp) use stamp record to generate expected json
Sep 28, 2023
16c4d64
refactor (test dans config) Tests green and size down Config class
Sep 28, 2023
9031bbb
fix(Bauhaus) param swagger scheme + improve @Conditional for DefaultS…
Oct 2, 2023
240f9bd
pom(increment version) 3.6.1
Oct 2, 2023
383715d
fix(openapi) url for swagger
Oct 2, 2023
20afddd
pom(increase version)
Oct 2, 2023
4d2a3a4
feat(module in prop) define active modules in fr.insee.rmes.bauhaus.a…
Oct 2, 2023
1ecf31c
feat(improve queries log) better log sparql queries when exception
Oct 2, 2023
99e1705
fix(escape < for sparql queries) also refactor to decouplate ObjectTy…
Oct 4, 2023
58c11e1
Merge branch '391-upgrade-access-control-classes' of https://github.c…
Oct 9, 2023
0555b39
fix(app starting) fix inexisting constructor to inject values for Pub…
Oct 9, 2023
48079d9
fix(put series) bug when check access to series
Oct 10, 2023
df75ecd
feat(log) log sparql queries and ownership checks
Oct 10, 2023
4f4fae0
test(check ownership) check ownership for operation series
Oct 10, 2023
d419ccc
test(all) fix errors after refactor
Oct 10, 2023
4a95cc0
test(update series) test "check ownership" for series from real data
Oct 11, 2023
d2752fb
fix(update series) correct key to find stamp
Oct 11, 2023
2c8aaf4
Merge branch 'main' into 391-upgrade-access-control-classes
Nov 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 55 additions & 45 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.8</version>
<version>2.7.16</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>


<groupId>fr.insee.rmes</groupId>
<artifactId>Bauhaus-BO</artifactId>
<packaging>war</packaging>
<version>3.6.0</version>
<version>3.6.4</version>
<name>Bauhaus-Back-Office</name>
<description>Back-office services for Bauhaus</description>
<url>https://github.com/InseeFr/Bauhaus-Back-Office</url>
Expand All @@ -28,18 +28,6 @@
<url>http://www.insee.fr</url>
</organization>
<developers>
<developer>
<name>Alice Lambois</name>
<email>[email protected]</email>
</developer>
<developer>
<name>Nicolas Laval</name>
<email>[email protected]</email>
</developer>
<developer>
<name>Olivier Pucher</name>
<email>[email protected]</email>
</developer>
<developer>
<name>Jérôme Bourgeois</name>
<email>[email protected]</email>
Expand All @@ -49,19 +37,26 @@

<properties>
<final.war.name>bauhaus</final.war.name>
<java.version>11</java.version>
<java.version>17</java.version>

<springdoc-openapi-ui.version>1.6.6</springdoc-openapi-ui.version>
<springdoc-openapi-ui.version>1.7.0</springdoc-openapi-ui.version>
<jackson.version>2.13.1</jackson.version>
<rdf4j.version>3.7.7</rdf4j.version>
<rdf4j.version>4.3.6</rdf4j.version>
<swagger.core.version>2.1.12</swagger.core.version>
<log4j2.version>2.17.1</log4j2.version>
<xdocreport.version>2.0.3</xdocreport.version>
<xdocreport.version>2.0.4</xdocreport.version>
<junit.version>5.8.2</junit.version>
<jacoco.version>0.8.5</jacoco.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<java-jwt.version>3.4.1</java-jwt.version>
<json.version>20230618</json.version>
<flexmark.version>0.64.8</flexmark.version>
<jaxb.version>4.0.3</jaxb.version>
<zt.version>1.16</zt.version>
<saxon.version>12.3</saxon.version>
<!--<slf4j.version>2.0.9</slf4j.version>
<logback.version>1.4.11</logback.version>-->


<!-- SONAR -->
<sonar.exclusions>src/main/java/fr/insee/rmes/queries/**/*,
Expand All @@ -85,25 +80,36 @@
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
<dependency>
<groupId>org.zeroturnaround</groupId>
<artifactId>zt-zip</artifactId>
<version>1.14</version>
<version>${zt.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.3</version>
<version>${jaxb.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -133,15 +139,21 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>

<!-- SLF4J / LOG4J -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>


<!-- SWAGGER -->
<dependency>
<groupId>org.springdoc</groupId>
Expand All @@ -154,6 +166,12 @@
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-repository-http</artifactId>
<version>${rdf4j.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
Expand All @@ -170,10 +188,9 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20211205</version>
<version>${json.version}</version>
</dependency>


<!-- INSEE for JMS -->
<dependency>
<groupId>org.apache.activemq</groupId>
Expand All @@ -186,15 +203,15 @@
</exclusions>
</dependency>
<dependency>
<groupId>jakarta.jms</groupId>
<artifactId>jakarta.jms-api</artifactId>
<groupId>jakarta.jms</groupId>
<artifactId>jakarta.jms-api</artifactId>
</dependency>

<!-- SAXON FOR XSLT -->
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>11.1.1</version>
<version>${saxon.version}</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
Expand All @@ -218,23 +235,13 @@
<artifactId>fr.opensagres.xdocreport.template.freemarker</artifactId>
<version>${xdocreport.version}</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.converter.odt.odfdom</artifactId>
<version>${xdocreport.version}</version>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>


<!-- XHTML to Markdown parser -->
<dependency>
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-all</artifactId>
<version>0.64.0</version>
<artifactId>flexmark-html2md-converter</artifactId>
<version>0.64.8</version>
</dependency>
</dependencies>

Expand All @@ -245,6 +252,9 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludeGroupIds>org.apache.tomcat.embed</excludeGroupIds>
</configuration>
</plugin>

<!-- Plugin tests -->
Expand Down
26 changes: 15 additions & 11 deletions src/main/java/fr/insee/rmes/Bauhaus.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
package fr.insee.rmes;

import fr.insee.rmes.config.keycloak.KeycloakServerZoneConfiguration;
import org.springframework.boot.SpringApplication;
import fr.insee.rmes.config.PropertiesLogger;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

@SpringBootApplication
@ConfigurationPropertiesScan
public class Bauhaus extends SpringBootServletInitializer {


@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Bauhaus.class);
}

public static void main(String[] args) {
SpringApplication.run(Bauhaus.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) {
return configureApplicationBuilder(applicationBuilder);
}

public static void main(String[] args) {
configureApplicationBuilder(new SpringApplicationBuilder()).build().run(args);
}

public static SpringApplicationBuilder configureApplicationBuilder(SpringApplicationBuilder springApplicationBuilder) {
return springApplicationBuilder.sources(Bauhaus.class)
.listeners(new PropertiesLogger());
}

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package fr.insee.rmes.bauhaus_services;

import fr.insee.rmes.exceptions.RmesNotFoundException;
import org.springframework.web.multipart.MultipartFile;

import fr.insee.rmes.exceptions.RmesException;
import org.springframework.web.multipart.MultipartFile;

public interface ClassificationsService {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package fr.insee.rmes.bauhaus_services;

import fr.insee.rmes.exceptions.RmesException;
import fr.insee.rmes.webservice.ConceptsResources;
import org.springframework.http.ResponseEntity;

import javax.servlet.http.HttpServletResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package fr.insee.rmes.bauhaus_services;

import fr.insee.rmes.exceptions.RmesException;
import org.eclipse.rdf4j.model.IRI;
import org.json.JSONObject;

import fr.insee.rmes.exceptions.RmesException;

public interface GeographyService {

/******************************************************************************************
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package fr.insee.rmes.bauhaus_services;

import java.io.IOException;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

import fr.insee.rmes.exceptions.RmesException;
import fr.insee.rmes.model.operations.documentations.Documentation;
import fr.insee.rmes.model.operations.documentations.MSD;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

import java.io.IOException;

public interface OperationsDocumentationsService {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package fr.insee.rmes.bauhaus_services;

import java.util.List;

import fr.insee.rmes.config.swagger.model.IdLabelTwoLangs;
import fr.insee.rmes.exceptions.RmesException;
import fr.insee.rmes.model.organizations.Organization;

import java.util.List;

public interface OrganizationsService {

IdLabelTwoLangs getOrganization(String organizationIdentifier) throws RmesException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package fr.insee.rmes.bauhaus_services.classifications;

import fr.insee.rmes.bauhaus_services.Constants;
import fr.insee.rmes.bauhaus_services.rdf_utils.PublicationUtils;
import fr.insee.rmes.bauhaus_services.rdf_utils.RdfService;
import fr.insee.rmes.bauhaus_services.rdf_utils.RdfUtils;
import fr.insee.rmes.exceptions.ErrorCodes;
import fr.insee.rmes.exceptions.RmesException;
import fr.insee.rmes.exceptions.RmesNotFoundException;
import org.apache.http.HttpStatus;
import org.eclipse.rdf4j.model.Model;
import org.eclipse.rdf4j.model.Resource;
Expand All @@ -10,15 +17,6 @@
import org.eclipse.rdf4j.repository.RepositoryResult;
import org.springframework.stereotype.Component;

import fr.insee.rmes.bauhaus_services.Constants;
import fr.insee.rmes.bauhaus_services.rdf_utils.PublicationUtils;
import fr.insee.rmes.bauhaus_services.rdf_utils.RdfService;
import fr.insee.rmes.bauhaus_services.rdf_utils.RdfUtils;
import fr.insee.rmes.bauhaus_services.rdf_utils.RepositoryPublication;
import fr.insee.rmes.exceptions.ErrorCodes;
import fr.insee.rmes.exceptions.RmesException;
import fr.insee.rmes.exceptions.RmesNotFoundException;


@Component
public class ClassificationPublication extends RdfService{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
import fr.insee.rmes.persistance.ontologies.INSEE;
import fr.insee.rmes.persistance.sparql_queries.classifications.*;
import fr.insee.rmes.utils.XhtmlToMarkdownUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Model;
import org.eclipse.rdf4j.model.Resource;
import org.eclipse.rdf4j.model.impl.LinkedHashModel;
import org.eclipse.rdf4j.model.impl.SimpleIRI;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
Expand All @@ -39,7 +39,7 @@ public class ClassificationsImpl extends RdfService implements Classifications
@Autowired
private ClassificationPublication classificationPublication;

static final Logger logger = LogManager.getLogger(ClassificationsImpl.class);
static final Logger logger = LoggerFactory.getLogger(ClassificationsImpl.class);

@Override
public String getFamilies() throws RmesException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import fr.insee.rmes.persistance.sparql_queries.classifications.ClassificationsQueries;
import fr.insee.rmes.persistance.sparql_queries.classifications.ItemsQueries;
import fr.insee.rmes.utils.XhtmlToMarkdownUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

Expand All @@ -27,7 +27,7 @@ public class ClassificationItemServiceImpl extends RdfService implements Classif
ClassificationItemUtils classificationItemUtils;


static final Logger logger = LogManager.getLogger(ClassificationItemServiceImpl.class);
static final Logger logger = LoggerFactory.getLogger(ClassificationItemServiceImpl.class);

@Override
public String getClassificationItems(String id) throws RmesException{
Expand Down
Loading