diff --git a/bauhaus-back-changeLog.txt b/bauhaus-back-changeLog.txt
index 644282b71..3a44d0216 100644
--- a/bauhaus-back-changeLog.txt
+++ b/bauhaus-back-changeLog.txt
@@ -1,3 +1,6 @@
+3.0.17 : - Back : Passage à Java 11
+ - Front : mise à jour des dépendances
+ - Ajout de la publication d'une nomenclature
3.0.16 : - Front : Correction d'un problème de chargement lors de la modification d'un rapport qualité
3.0.15 : - Correctif de la boucle infinie à l'affichage des séries (opStat - front)
- Correctif sur les concepts (top concept)
diff --git a/pom.xml b/pom.xml
index 1097331ba..a7b5a234a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
fr.insee.rmes
Bauhaus-BO
war
- 3.0.16
+ 3.0.17
Bauhaus-Back-Office
Back-office services for Bauhaus
https://github.com/InseeFr/Bauhaus-Back-Office
@@ -45,6 +45,7 @@
5.3.14
5.6.1
2.17.1
+ 2.0.3
5.8.2
UTF-8
2.22.2
@@ -92,11 +93,23 @@
zt-zip
1.14
jar
+
org.glassfish.jersey.containers
jersey-container-servlet-core
${jersey.version}
+
org.glassfish.jersey.media
@@ -120,13 +133,44 @@
com.fasterxml.jackson.jaxrs
jackson-jaxrs-json-provider
+
-
+
jakarta.xml.bind
jakarta.xml.bind-api
- 4.0.0-RC2
+ 2.3.3
+
+
+ com.sun.xml.bind
+ jaxb-impl
+ 2.3.3
+ runtime
+
+
+
jakarta.servlet
jakarta.servlet-api
@@ -135,11 +179,7 @@
-
- org.glassfish.jaxb
- jaxb-runtime
- 2.3.3
-
+
org.glassfish.jersey.ext
jersey-spring5
@@ -251,6 +291,10 @@
org.apache.commons
commons-lang3
+
+ com.jayway.restassured
+ xml-path
+
@@ -299,12 +343,11 @@
org.apache.logging.log4j
- log4j-slf4j-impl
+ log4j-slf4j18-impl
${log4j2.version}
-
- javax.servlet
+ javax.servlet
javax.servlet-api
4.0.0
provided
@@ -322,6 +365,14 @@
org.glassfish.jersey.containers
+
@@ -335,17 +386,33 @@
org.eclipse.rdf4j
rdf4j-repository-http
${rdf4j.version}
+
org.eclipse.rdf4j
rdf4j-queryresultio-sparqljson
${rdf4j.version}
+
org.json
json
- 20160810
+ 20211205
@@ -362,16 +429,22 @@
- javax.jms
- jms
- 1.1
+ jakarta.jms
+ jakarta.jms-api
+ 2.0.3
net.sf.saxon
Saxon-HE
- 10.0
+ 11.1.1
+
+
+ xml-apis
+ xml-apis
+
+
@@ -384,56 +457,96 @@
fr.opensagres.xdocreport
fr.opensagres.xdocreport.document.odt
- 2.0.1
+ ${xdocreport.version}
fr.opensagres.xdocreport
fr.opensagres.xdocreport.template.freemarker
- 2.0.1
+ ${xdocreport.version}
fr.opensagres.xdocreport
fr.opensagres.xdocreport.converter.odt.odfdom
- 2.0.1
+ ${xdocreport.version}
+
+
+ xerces
+ xercesImpl
+
+
-
+
com.itextpdf
itextpdf
- 5.5.13
+ 5.5.13.2
-
+
+
+
+
org.jsoup
jsoup
- 1.14.2
+ 1.14.3
-
+
com.vladsch.flexmark
flexmark-all
- 0.50.42
+ 0.64.0
@@ -466,8 +579,8 @@
maven-compiler-plugin
3.8.1
-
- 1.8
+
+ 11
diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/structures/impl/StructureComponentImpl.java b/src/main/java/fr/insee/rmes/bauhaus_services/structures/impl/StructureComponentImpl.java
index 95a0d9efc..50e97cb2b 100644
--- a/src/main/java/fr/insee/rmes/bauhaus_services/structures/impl/StructureComponentImpl.java
+++ b/src/main/java/fr/insee/rmes/bauhaus_services/structures/impl/StructureComponentImpl.java
@@ -43,7 +43,7 @@ public JSONObject getComponentObject(String id) throws RmesException {
logger.info("Starting to get one mutualized component");
JSONObject response = repoGestion.getResponseAsObject(StructureQueries.getComponent(id));
if(response.keySet().isEmpty()){
- throw new NotFoundException("This component do not exist");
+ throw new NotFoundException("This component does not exist");
}
return structureComponentUtils.formatComponent(id, response);
}
@@ -67,7 +67,7 @@ public String createComponent( String body) throws RmesException {
public void deleteComponent(String id) throws RmesException {
JSONObject response = this.getComponentObject(id);
if(response.keySet().isEmpty()){
- throw new NotFoundException("This component do not exist");
+ throw new NotFoundException("This component does not exist");
}
String type = response.getString("type");
structureComponentUtils.deleteComponent(response, id, type);
diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/structures/utils/StructureComponentUtils.java b/src/main/java/fr/insee/rmes/bauhaus_services/structures/utils/StructureComponentUtils.java
index ad6330350..c8a3ed43f 100644
--- a/src/main/java/fr/insee/rmes/bauhaus_services/structures/utils/StructureComponentUtils.java
+++ b/src/main/java/fr/insee/rmes/bauhaus_services/structures/utils/StructureComponentUtils.java
@@ -203,7 +203,7 @@ private void createRDFForComponent(MutualizedComponent component, Resource resou
else if (component.getRange().equals(XSD.DATETIME.stringValue())) {
RdfUtils.addTripleString(componentURI, RdfUtils.createXSDIRI(PATTERN), component.getPattern(), Config.LG1, model, graph);
}
- else if (component.getRange().equals(XSD.INT.stringValue()) || component.getRange().equals(RdfUtils.toString(XSD.DOUBLE))) {
+ else if (component.getRange().equals(XSD.INT.stringValue()) || component.getRange().equals(XSD.DOUBLE.stringValue())) {
RdfUtils.addTripleString(componentURI, RdfUtils.createXSDIRI(MIN_LENGTH), component.getMinLength(), Config.LG1, model, graph);
RdfUtils.addTripleString(componentURI, RdfUtils.createXSDIRI(MAX_LENGTH), component.getMaxLength(), Config.LG1, model, graph);
RdfUtils.addTripleString(componentURI, RdfUtils.createXSDIRI("minInclusive"), component.getMinLength(), Config.LG1, model, graph);
diff --git a/src/main/java/fr/insee/rmes/config/ApplicationContext.java b/src/main/java/fr/insee/rmes/config/ApplicationContext.java
index 26fa2fec1..e02fdc7a8 100644
--- a/src/main/java/fr/insee/rmes/config/ApplicationContext.java
+++ b/src/main/java/fr/insee/rmes/config/ApplicationContext.java
@@ -45,12 +45,12 @@ public HttpClientBuilder httpClientBuilder()
return HttpClients.custom().setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE).setSSLSocketFactory(sslsf);
}
- @Bean
- public RestTemplate restTemplate() throws KeyManagementException, KeyStoreException, NoSuchAlgorithmException {
- CloseableHttpClient httpClient = httpClientBuilder().build();
- ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
- return new RestTemplate(requestFactory);
- }
+// @Bean
+// public RestTemplate restTemplate() throws KeyManagementException, KeyStoreException, NoSuchAlgorithmException {
+// CloseableHttpClient httpClient = httpClientBuilder().build();
+// ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
+// return new RestTemplate(requestFactory);
+// }
@PostConstruct
public void setUp() {
diff --git a/src/main/java/fr/insee/rmes/config/Config.java b/src/main/java/fr/insee/rmes/config/Config.java
index 33c53bf49..967f46021 100644
--- a/src/main/java/fr/insee/rmes/config/Config.java
+++ b/src/main/java/fr/insee/rmes/config/Config.java
@@ -105,6 +105,12 @@ public class Config {
public static String IGESA_APP_ID = "";
public static String IGESA_USER = "";
public static String IGESA_PASSWORD = "";
+
+ public static String SUGOI_URL = "";
+ public static String SUGOI_USER = "";
+ public static String SUGOI_PASSWORD = "";
+ public static String SUGOI_APP = "";
+ public static String SUGOI_REALM = "";
public static String SWAGGER_HOST = "";
public static String SWAGGER_BASEPATH = "";
@@ -184,6 +190,13 @@ public static void setConfig(Environment env) {
Config.IGESA_APP_ID = env.getProperty("fr.insee.rmes.bauhaus.igesa.id");
Config.IGESA_USER = env.getProperty("fr.insee.rmes.bauhaus.igesa.user");
Config.IGESA_PASSWORD = env.getProperty("fr.insee.rmes.bauhaus.igesa.password");
+
+ Config.SUGOI_URL = env.getProperty("fr.insee.rmes.bauhaus.sugoi.url");
+ Config.SUGOI_USER = env.getProperty("fr.insee.rmes.bauhaus.sugoi.id");
+ Config.SUGOI_PASSWORD = env.getProperty("fr.insee.rmes.bauhaus.sugoi.password");
+ Config.SUGOI_APP = env.getProperty("fr.insee.rmes.bauhaus.sugoi.application");
+ Config.SUGOI_REALM = env.getProperty("fr.insee.rmes.bauhaus.sugoi.realm");
+
Config.SWAGGER_HOST = env.getProperty("fr.insee.rmes.bauhaus.api.host");
Config.SWAGGER_BASEPATH = env.getProperty("fr.insee.rmes.bauhaus.api.basepath");
diff --git a/src/main/java/fr/insee/rmes/config/auth/roles/UserRolesManagerService.java b/src/main/java/fr/insee/rmes/config/auth/roles/UserRolesManagerService.java
index 2456c67cb..1140ff4d8 100644
--- a/src/main/java/fr/insee/rmes/config/auth/roles/UserRolesManagerService.java
+++ b/src/main/java/fr/insee/rmes/config/auth/roles/UserRolesManagerService.java
@@ -15,5 +15,7 @@ public interface UserRolesManagerService {
public void setAddRole(String role, String user);
public void setDeleteRole(String roles, String user);
+
+ public String checkSugoiConnexion() throws RmesException;
}
diff --git a/src/main/java/fr/insee/rmes/config/auth/security/keycloak/RmesAuthenticationEntryPoint.java b/src/main/java/fr/insee/rmes/config/auth/security/keycloak/RmesAuthenticationEntryPoint.java
new file mode 100644
index 000000000..99c9c3256
--- /dev/null
+++ b/src/main/java/fr/insee/rmes/config/auth/security/keycloak/RmesAuthenticationEntryPoint.java
@@ -0,0 +1,33 @@
+//package fr.insee.rmes.config.auth.security.keycloak;
+//
+//import java.io.IOException;
+//import java.io.PrintWriter;
+//
+//import javax.servlet.ServletException;
+//import javax.servlet.http.HttpServletRequest;
+//import javax.servlet.http.HttpServletResponse;
+//
+//import org.springframework.security.core.AuthenticationException;
+//import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
+//import org.springframework.stereotype.Component;
+//
+//
+//@Component
+// public class RmesAuthenticationEntryPoint extends BasicAuthenticationEntryPoint {
+//
+// @Override
+// public void commence(
+// HttpServletRequest request, HttpServletResponse response, AuthenticationException authEx) throws IOException {
+// response.addHeader("WWW-Authenticate", "Basic realm='' + getRealmName() + ''");
+// response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
+// PrintWriter writer = response.getWriter();
+// writer.println("HTTP Status 401 - " + authEx.getMessage());
+// }
+//
+// @Override
+// public void afterPropertiesSet() {
+//
+// setRealmName("agents-insee-interne");
+// super.afterPropertiesSet();
+// }
+// }
diff --git a/src/main/java/fr/insee/rmes/config/swagger/SwaggerConfig.java b/src/main/java/fr/insee/rmes/config/swagger/SwaggerConfig.java
index 109223c2b..7c72965b7 100644
--- a/src/main/java/fr/insee/rmes/config/swagger/SwaggerConfig.java
+++ b/src/main/java/fr/insee/rmes/config/swagger/SwaggerConfig.java
@@ -30,7 +30,7 @@ public SwaggerConfig(@Context ServletConfig servletConfig) {
super();
OpenAPI openApi = new OpenAPI();
- Info info = new Info().title("Bauhaus API").version("3.0.9").description("Rest Endpoints and services Integration used by Bauhaus");
+ Info info = new Info().title("Bauhaus API").version("3.0.17").description("Rest Endpoints and services Integration used by Bauhaus");
openApi.info(info);
Server server = new Server();
diff --git a/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/RmesUserRolesManagerImpl.java b/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/RmesUserRolesManagerImpl.java
index e41a2be21..0dd77e5c1 100644
--- a/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/RmesUserRolesManagerImpl.java
+++ b/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/RmesUserRolesManagerImpl.java
@@ -1,8 +1,8 @@
package fr.insee.rmes.external_services.authentication.user_roles_manager;
-import java.io.StringReader;
import java.text.MessageFormat;
-import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
import java.util.TreeSet;
import javax.naming.NamingEnumeration;
@@ -18,44 +18,53 @@
import org.apache.http.HttpStatus;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.input.SAXBuilder;
-import org.jdom.xpath.XPath;
+import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
import fr.insee.rmes.bauhaus_services.Constants;
import fr.insee.rmes.config.Config;
import fr.insee.rmes.config.auth.roles.UserRolesManagerService;
import fr.insee.rmes.exceptions.RmesException;
import fr.insee.rmes.external_services.authentication.LdapConnexion;
+import fr.insee.rmes.external_services.authentication.user_roles_manager.sugoiModel.Application;
+import fr.insee.rmes.external_services.authentication.user_roles_manager.sugoiModel.Group;
+import fr.insee.rmes.external_services.authentication.user_roles_manager.sugoiModel.UserSugoi;
+import fr.insee.rmes.external_services.authentication.user_roles_manager.sugoiModel.UsersSugoi;
import fr.insee.rmes.utils.JSONComparator;
@Service
public class RmesUserRolesManagerImpl implements UserRolesManagerService {
+ private static final int NB_USERS_EXPECTED = 20000;
+
@Autowired
LdapConnexion ldapConnexion;
static final Logger logger = LogManager.getLogger(RmesUserRolesManagerImpl.class);
private static final String IGESA_APP_SEARCH_PATH = "/recherche/application/";
+ private static final String SUGOI_REALM_SEARCH_PATH = "/realms/";
+ private static final String SUGOI_APP_SEARCH_PATH = "/applications/";
+ private static final String SUGOI_SEARCH_APP = Config.SUGOI_URL + SUGOI_REALM_SEARCH_PATH + Config.SUGOI_REALM + SUGOI_APP_SEARCH_PATH + Config.SUGOI_APP ;
+ private static final String SUGOI_SEARCH_USERS = Config.SUGOI_URL + SUGOI_REALM_SEARCH_PATH + Config.SUGOI_REALM + "/users" ;
+
private static final String IGESA_ADD_USER_PATH_FMT = Config.IGESA_URL + "/gestion/ajout/personne/application/"
+ Config.IGESA_APP_ID + "/groupe/{1}/utilisateur/{0}";
private static final String IGESA_DELETE_USER_PATH_FMT = Config.IGESA_URL
+ "/gestion/suppression/personne/application/" + Config.IGESA_APP_ID + "/groupe/{1}/utilisateur/{0}";
- private static final String ROLES_XPATH = "/applications/application/groupes/groupe";
private static final String ROLE_ID_XPATH = "cn";
- private static final String ROLE_LABEL_XPATH = "description";
- private static final String ROLE_PERSONS_XPATH = "personnes/personne";
- private static final String ROLE_PERSON_STAMP_XPATH = "ou";
private static final String ROLE_PERSON_IDEP_XPATH = "uid";
+ private Map mapUsers;
+
@Override
public String getAuth(String body) {
if (body.equals(Config.PASSWORD_GESTIONNAIRE)) {
@@ -68,33 +77,37 @@ public String getAuth(String body) {
}
@Override
- @SuppressWarnings("unchecked")
public String getRoles() throws RmesException {
+ if (mapUsers == null || mapUsers.isEmpty()) {getAgentsSugoi();}
+ logger.info("mapUsers size : {} / {} max", mapUsers.size(), NB_USERS_EXPECTED);
JSONArray roles = new JSONArray();
try {
- Client client = ClientBuilder.newClient();
-
- String xmlResponse = client.target(Config.IGESA_URL + IGESA_APP_SEARCH_PATH + Config.IGESA_APP_ID)
- .request(MediaType.APPLICATION_XML).get(String.class);
-
- Document doc = new SAXBuilder().build(new StringReader(xmlResponse));
- List l = (XPath.selectNodes(doc, ROLES_XPATH));
- for (Element e : l) {
- JSONObject jsonO = new JSONObject();
- jsonO.put(Constants.ID, XPath.newInstance(ROLE_ID_XPATH).valueOf(e));
- jsonO.put(Constants.LABEL, XPath.newInstance(ROLE_LABEL_XPATH).valueOf(e));
- List p = (XPath.selectNodes(e, ROLE_PERSONS_XPATH));
+ Client client = ClientBuilder.newClient().register(HttpAuthenticationFeature.basic(Config.SUGOI_USER, Config.SUGOI_PASSWORD));
+ String jsonResponse = client.target(SUGOI_SEARCH_APP).request(MediaType.APPLICATION_JSON).get(String.class);
+
+ ObjectMapper mapper = new ObjectMapper();
+ Application application = mapper.readValue(jsonResponse, Application.class);
+ for (Group g : application.getGroups()) {
+ JSONObject jsonGroup = new JSONObject();
+ jsonGroup.put(Constants.ID, g.getName());
+ jsonGroup.put(Constants.LABEL, g.getDescription());
JSONArray persons = new JSONArray();
- for (Element person : p) {
- JSONObject jsonOO = new JSONObject();
- jsonOO.put(Constants.ID, XPath.newInstance(ROLE_PERSON_IDEP_XPATH).valueOf(person));
- jsonOO.put(Constants.LABEL, XPath.newInstance(ROLE_ID_XPATH).valueOf(person));
- jsonOO.put("stamp", XPath.newInstance(ROLE_PERSON_STAMP_XPATH).valueOf(person));
- persons.put(jsonOO);
+ if (g.getUsers() != null) {
+ for (UserSugoi u : g.getUsers()) {
+ UserSugoi completeUser = mapUsers.get(u.getUsername().toLowerCase());
+ if (completeUser != null ) {
+ JSONObject jsonUser = new JSONObject();
+ jsonUser.put(Constants.ID, u.getUsername());
+ jsonUser.put(Constants.LABEL, completeUser.getCompleteName());
+ jsonUser.put(Constants.STAMP, completeUser.getAttributes().getInseeTimbre());
+ persons.put(jsonUser);
+ } else logger.warn("Unknown user : {}",u.getUsername());
+ }
}
- jsonO.put("persons", persons);
- roles.put(jsonO);
+ jsonGroup.put("persons", persons);
+ roles.put(jsonGroup);
}
+
} catch (Exception e) {
throw new RmesException(HttpStatus.SC_INTERNAL_SERVER_ERROR, e.getMessage(), "Fail to getRoles");
}
@@ -132,6 +145,38 @@ public String getAgents() throws RmesException {
}
return agents.toString();
}
+
+
+ public String getAgentsSugoi() throws RmesException {
+ mapUsers = new HashMap<>(NB_USERS_EXPECTED);
+ TreeSet agents = new TreeSet<>(new JSONComparator(Constants.LABEL));
+
+ Client client = ClientBuilder.newClient().register(HttpAuthenticationFeature.basic(Config.SUGOI_USER, Config.SUGOI_PASSWORD));
+ String jsonResponse = client.target(SUGOI_SEARCH_USERS)
+ .queryParam("size", NB_USERS_EXPECTED)
+ .request(MediaType.APPLICATION_JSON)
+ .get(String.class);
+
+ ObjectMapper mapper = new ObjectMapper();
+ UsersSugoi users;
+ try {
+ users = mapper.readValue(jsonResponse, UsersSugoi.class);
+ for (UserSugoi u : users.getResults()) {
+ JSONObject jsonUser = new JSONObject();
+ jsonUser.put(Constants.ID, u.getUsername());
+ jsonUser.put(Constants.LABEL, u.getCompleteName());
+ if (u.getAttributes() != null) {
+ jsonUser.put(Constants.STAMP, u.getAttributes().getInseeTimbre());
+ }
+ agents.add(jsonUser);
+ mapUsers.put(u.getUsername().toLowerCase(), u);
+ }
+ } catch (JsonProcessingException e) {
+ logger.error("Get agents via Sugoi failed : {}", e.getMessage());
+ throw new RmesException(HttpStatus.SC_INTERNAL_SERVER_ERROR, e.getMessage(), "Get agents via Sugoi failed");
+ }
+ return agents.toString();
+ }
@Override
public void setAddRole(String role, String user) {
@@ -159,5 +204,19 @@ public String checkLdapConnexion() throws RmesException {
}
return StringUtils.isEmpty(xmlResponse)? "KO" : "OK";
}
+
+ @Override
+ public String checkSugoiConnexion() throws RmesException {
+ String jsonResponse ="";
+ try {
+ Client client = ClientBuilder.newClient().register(HttpAuthenticationFeature.basic(Config.SUGOI_USER, Config.SUGOI_PASSWORD));
+
+ jsonResponse = client.target(Config.SUGOI_URL + "whoami")
+ .request(MediaType.APPLICATION_JSON).get(String.class);
+ } catch (Exception e) {
+ throw new RmesException(HttpStatus.SC_INTERNAL_SERVER_ERROR, e.getMessage(), "Fail to target SUGOI");
+ }
+ return StringUtils.isEmpty(jsonResponse)? "KO" : "OK";
+ }
}
diff --git a/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/Application.java b/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/Application.java
new file mode 100644
index 000000000..2e75e34ff
--- /dev/null
+++ b/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/Application.java
@@ -0,0 +1,96 @@
+package fr.insee.rmes.external_services.authentication.user_roles_manager.sugoiModel;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Generated;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "name",
+ "owner",
+ "groups"
+})
+@Generated("jsonschema2pojo")
+public class Application {
+
+ @JsonProperty("name")
+ private String name;
+ @JsonProperty("owner")
+ private String owner;
+ @JsonProperty("users")
+ private List groups = null;
+ @JsonIgnore
+ private Map additionalProperties = new HashMap();
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public Application() {
+ }
+
+ /**
+ *
+ * @param name
+ * @param owner
+ * @param groups
+ */
+ public Application(String name, String owner, List groups) {
+ super();
+ this.name = name;
+ this.owner = owner;
+ this.groups = groups;
+ }
+
+ @JsonProperty("name")
+ public String getName() {
+ return name;
+ }
+
+ @JsonProperty("name")
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @JsonProperty("owner")
+ public String getOwner() {
+ return owner;
+ }
+
+ @JsonProperty("owner")
+ public void setOwner(String owner) {
+ this.owner = owner;
+ }
+
+ @JsonProperty("groups")
+ public List getGroups() {
+ return groups;
+ }
+
+ @JsonProperty("groups")
+ public void setGroups(List groups) {
+ this.groups = groups;
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+
+
+
+}
diff --git a/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/Attributes.java b/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/Attributes.java
new file mode 100644
index 000000000..b7d81519a
--- /dev/null
+++ b/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/Attributes.java
@@ -0,0 +1,231 @@
+package fr.insee.rmes.external_services.authentication.user_roles_manager.sugoiModel;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Generated;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "phone_number",
+ "common_name",
+ "insee_timbre",
+ "personal_title",
+ "description",
+ "insee_organisme",
+ "insee_roles_applicatifs"
+})
+@Generated("jsonschema2pojo")
+public class Attributes {
+
+ @JsonProperty("phone_number")
+ private String phoneNumber;
+
+ @JsonProperty("common_name")
+ private String commonName;
+
+ @JsonProperty("insee_timbre")
+ private String inseeTimbre;
+
+ @JsonProperty("personal_title")
+ private String personalTitle;
+
+ @JsonProperty("description")
+ private String description;
+
+ @JsonProperty("insee_organisme")
+ private String inseeOrganisme;
+
+ @JsonProperty("insee_roles_applicatifs")
+ private List inseeRolesApplicatifs = null;
+
+ @JsonIgnore
+ private Map additionalProperties = new HashMap();
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public Attributes() {
+ }
+
+ /**
+ *
+ * @param commonName
+ * @param inseeRolesApplicatifs
+ * @param phoneNumber
+ * @param inseeOrganisme
+ * @param description
+ * @param inseeTimbre
+ * @param personalTitle
+ */
+ public Attributes(String phoneNumber, String commonName, String inseeTimbre, String personalTitle, String description, String inseeOrganisme, List inseeRolesApplicatifs) {
+ super();
+ this.phoneNumber = phoneNumber;
+ this.commonName = commonName;
+ this.inseeTimbre = inseeTimbre;
+ this.personalTitle = personalTitle;
+ this.description = description;
+ this.inseeOrganisme = inseeOrganisme;
+ this.inseeRolesApplicatifs = inseeRolesApplicatifs;
+ }
+
+ @JsonProperty("phone_number")
+ public String getPhoneNumber() {
+ return phoneNumber;
+ }
+
+ @JsonProperty("phone_number")
+ public void setPhoneNumber(String phoneNumber) {
+ this.phoneNumber = phoneNumber;
+ }
+
+ @JsonProperty("common_name")
+ public String getCommonName() {
+ return commonName;
+ }
+
+ @JsonProperty("common_name")
+ public void setCommonName(String commonName) {
+ this.commonName = commonName;
+ }
+
+ @JsonProperty("insee_timbre")
+ public String getInseeTimbre() {
+ return inseeTimbre;
+ }
+
+ @JsonProperty("insee_timbre")
+ public void setInseeTimbre(String inseeTimbre) {
+ this.inseeTimbre = inseeTimbre;
+ }
+
+ @JsonProperty("personal_title")
+ public String getPersonalTitle() {
+ return personalTitle;
+ }
+
+ @JsonProperty("personal_title")
+ public void setPersonalTitle(String personalTitle) {
+ this.personalTitle = personalTitle;
+ }
+
+ @JsonProperty("description")
+ public String getDescription() {
+ return description;
+ }
+
+ @JsonProperty("description")
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @JsonProperty("insee_organisme")
+ public String getInseeOrganisme() {
+ return inseeOrganisme;
+ }
+
+ @JsonProperty("insee_organisme")
+ public void setInseeOrganisme(String inseeOrganisme) {
+ this.inseeOrganisme = inseeOrganisme;
+ }
+
+ @JsonProperty("insee_roles_applicatifs")
+ public List getInseeRolesApplicatifs() {
+ return inseeRolesApplicatifs;
+ }
+
+ @JsonProperty("insee_roles_applicatifs")
+ public void setInseeRolesApplicatifs(List inseeRolesApplicatifs) {
+ this.inseeRolesApplicatifs = inseeRolesApplicatifs;
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(Attributes.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("phoneNumber");
+ sb.append('=');
+ sb.append(((this.phoneNumber == null)?"":this.phoneNumber));
+ sb.append(',');
+ sb.append("commonName");
+ sb.append('=');
+ sb.append(((this.commonName == null)?"":this.commonName));
+ sb.append(',');
+ sb.append("inseeTimbre");
+ sb.append('=');
+ sb.append(((this.inseeTimbre == null)?"":this.inseeTimbre));
+ sb.append(',');
+ sb.append("personalTitle");
+ sb.append('=');
+ sb.append(((this.personalTitle == null)?"":this.personalTitle));
+ sb.append(',');
+ sb.append("description");
+ sb.append('=');
+ sb.append(((this.description == null)?"":this.description));
+ sb.append(',');
+ sb.append("inseeOrganisme");
+ sb.append('=');
+ sb.append(((this.inseeOrganisme == null)?"":this.inseeOrganisme));
+ sb.append(',');
+ sb.append("inseeRolesApplicatifs");
+ sb.append('=');
+ sb.append(((this.inseeRolesApplicatifs == null)?"":this.inseeRolesApplicatifs));
+ sb.append(',');
+ sb.append("additionalProperties");
+ sb.append('=');
+ sb.append(((this.additionalProperties == null)?"":this.additionalProperties));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.commonName == null)? 0 :this.commonName.hashCode()));
+ result = ((result* 31)+((this.inseeRolesApplicatifs == null)? 0 :this.inseeRolesApplicatifs.hashCode()));
+ result = ((result* 31)+((this.phoneNumber == null)? 0 :this.phoneNumber.hashCode()));
+ result = ((result* 31)+((this.inseeOrganisme == null)? 0 :this.inseeOrganisme.hashCode()));
+ result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode()));
+ result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
+ result = ((result* 31)+((this.inseeTimbre == null)? 0 :this.inseeTimbre.hashCode()));
+ result = ((result* 31)+((this.personalTitle == null)? 0 :this.personalTitle.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof Attributes) == false) {
+ return false;
+ }
+ Attributes rhs = ((Attributes) other);
+ return (((((((((this.commonName == rhs.commonName)||((this.commonName!= null)&&this.commonName.equals(rhs.commonName)))&&((this.inseeRolesApplicatifs == rhs.inseeRolesApplicatifs)||((this.inseeRolesApplicatifs!= null)&&this.inseeRolesApplicatifs.equals(rhs.inseeRolesApplicatifs))))&&((this.phoneNumber == rhs.phoneNumber)||((this.phoneNumber!= null)&&this.phoneNumber.equals(rhs.phoneNumber))))&&((this.inseeOrganisme == rhs.inseeOrganisme)||((this.inseeOrganisme!= null)&&this.inseeOrganisme.equals(rhs.inseeOrganisme))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.inseeTimbre == rhs.inseeTimbre)||((this.inseeTimbre!= null)&&this.inseeTimbre.equals(rhs.inseeTimbre))))&&((this.personalTitle == rhs.personalTitle)||((this.personalTitle!= null)&&this.personalTitle.equals(rhs.personalTitle))));
+ }
+
+}
diff --git a/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/Group.java b/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/Group.java
new file mode 100644
index 000000000..275ffa64e
--- /dev/null
+++ b/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/Group.java
@@ -0,0 +1,163 @@
+package fr.insee.rmes.external_services.authentication.user_roles_manager.sugoiModel;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Generated;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "name",
+ "description",
+ "users",
+ "appName"
+})
+@Generated("jsonschema2pojo")
+public class Group {
+
+ @JsonProperty("name")
+ private String name;
+ @JsonProperty("description")
+ private String description;
+ @JsonProperty("users")
+ private List users = null;
+ private String appName;
+ @JsonIgnore
+ private Map additionalProperties = new HashMap();
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public Group() {
+ }
+
+ /**
+ *
+ * @param appName
+ * @param name
+ * @param description
+ * @param users
+ */
+ public Group(String name, String description, List users, String appName) {
+ super();
+ this.name = name;
+ this.description = description;
+ this.users = users;
+ this.appName = appName;
+ }
+
+ @JsonProperty("name")
+ public String getName() {
+ return name;
+ }
+
+ @JsonProperty("name")
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @JsonProperty("description")
+ public String getDescription() {
+ return description;
+ }
+
+ @JsonProperty("description")
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @JsonProperty("users")
+ public List getUsers() {
+ return users;
+ }
+
+ @JsonProperty("users")
+ public void setUsers(List users) {
+ this.users = users;
+ }
+
+ @JsonProperty("appName")
+ public String getAppName() {
+ return appName;
+ }
+
+ @JsonProperty("appName")
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(Group.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("name");
+ sb.append('=');
+ sb.append(((this.name == null)?"":this.name));
+ sb.append(',');
+ sb.append("description");
+ sb.append('=');
+ sb.append(((this.description == null)?"":this.description));
+ sb.append(',');
+ sb.append("users");
+ sb.append('=');
+ sb.append(((this.users == null)?"":this.users));
+ sb.append(',');
+ sb.append("appName");
+ sb.append('=');
+ sb.append(((this.appName == null)?"":this.appName));
+ sb.append(',');
+ sb.append("additionalProperties");
+ sb.append('=');
+ sb.append(((this.additionalProperties == null)?"":this.additionalProperties));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode()));
+ result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode()));
+ result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
+ result = ((result* 31)+((this.users == null)? 0 :this.users.hashCode()));
+ result = ((result* 31)+((this.appName == null)? 0 :this.appName.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof Group) == false) {
+ return false;
+ }
+ Group rhs = ((Group) other);
+ return ((((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.users == rhs.users)||((this.users!= null)&&this.users.equals(rhs.users))))&&((this.appName == rhs.appName)||((this.appName!= null)&&this.appName.equals(rhs.appName))));
+ }
+
+}
diff --git a/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/UserSugoi.java b/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/UserSugoi.java
new file mode 100644
index 000000000..e1b8ade63
--- /dev/null
+++ b/src/main/java/fr/insee/rmes/external_services/authentication/user_roles_manager/sugoiModel/UserSugoi.java
@@ -0,0 +1,231 @@
+package fr.insee.rmes.external_services.authentication.user_roles_manager.sugoiModel;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import javax.annotation.Generated;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "lastName",
+ "firstName",
+ "mail",
+ "username",
+ "groups",
+ "habilitations",
+ "address",
+ "metadatas",
+ "attributes"
+})
+@Generated("jsonschema2pojo")
+public class UserSugoi {
+
+ @JsonProperty("lastName")
+ private String lastName;
+ @JsonProperty("firstName")
+ private String firstName;
+ @JsonProperty("mail")
+ private String mail;
+ @JsonProperty("username")
+ private String username; //idep
+ @JsonProperty("groups")
+ private List groups = null;
+ @JsonProperty("habilitations")
+ private List