Commit 7b1dcbff authored by Framboise Orange's avatar Framboise Orange
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request !3
parents b5b29fe5 cca246d6
Pipeline #250316 passed with stage
in 2 minutes and 16 seconds
HELP.md
**/bin/**
target/
**/bin/**
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
### logs ###
*.log
/.metadata/
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
default:
cache:
paths:
- .m2/repository/
tags:
- qlf-ci.inria.fr
stages:
- build
build:
image: maven:3.6.3-adoptopenjdk-11
stage: build
script:
- mvn -B -ntp deploy
artifacts:
paths:
- target/analytics-server*.jar
reports:
junit:
- target/surefire-reports/TEST-*.xml
-Xmx128m -Xms128m -Djava.awt.headless=true
--settings .mvn/settings-ci.xml
<settings>
<servers>
<server>
<id>gitlab-maven</id>
<configuration>
<httpHeaders>
<property>
<name>Job-Token</name>
<value>${env.CI_JOB_TOKEN}</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
......@@ -13,7 +13,7 @@ effectué le dernier status, la liste des erreurs rencontrées...)
Dans une première itération de cette application, la base de données mongo n'est pas utilisée.
L'application repose sur une application springboot en frontal. Celle-ci traite la requête provenant du terminal de
L'application repose sur une application springboot en frontal. Celle-ci traite les requêtes provenant du terminal de
l'utilisateur final. Les principaux traitements effectués par cette application sont :
- validation du token JWT fourni par l'application robert, à noter qu'un token ne peut être utilisé qu'une unique fois
......@@ -25,6 +25,10 @@ l'utilisateur final. Les principaux traitements effectués par cette application
Par la suite, le topic kafka est consommé par logstash qui repousse les analytics dans un elasticsearch. Les analytics
sont ensuite analysés grâce à un kibana.
2 principales fonctionnalités sont implémentées :
- la création d'analytics
- la suppression sur demande de l'utilisateur de l'application mobile des analytiques afin de respecter la RGPD.
note : le fichier source du diagramme est fourni [ici](analytics.drawio)
## contrat d'interface
......@@ -69,9 +73,9 @@ auront été stockés dans l'elasticsearch
Ces différents services sont disponibles dans un environnement docker lançable par :
docker-compose -f ../environment-setup/dev/compose/docker-compose-analytics-server.yaml up -d
docker-compose -f docker-compose.yaml up -d
Les services dockerisés ne sont utilisés que pour pouvoir lancer l'application par elle-même. Les tests untaires
Les services dockerisés ne sont utilisés que pour pouvoir lancer l'application par elle-même. Les tests unitaires
utilisent des services embarqués (embedded mongodb et kafka).
## Appel rest
......
<mxfile host="app.diagrams.net" modified="2021-03-23T10:31:31.463Z" agent="5.0 (X11)" etag="14338BJJV65bln0yTPUD" version="14.4.6" type="device"><diagram name="Page-1" id="822b0af5-4adb-64df-f703-e8dfc1f81529">7Vtbc6M4Fv41foQSCHF5TCfxTO3MVnVNeqdn+iUlQMZaY0QLfEn/+jnCgAHhxJ3YsaernaoYDpKQzuU7F8kTfLvc/iJpPv+viFk6sVG8neC7iW3byLXhS1GedhQrIO6Okkge17Q94YF/YzUR1dQVj1nRa1gKkZY87xMjkWUsKns0KqXY9JvNRNp/a04TphEeIprq1M88Luc11UJo/+BXxpN5/Wqf1A9CGi0SKVZZ/b6JjWfVZ/d4SZux6vbFnMZi0yHh+wm+lUKUu6vl9palirkN23b9pgeetvOWLCuP6fAFGdFmTR6//JGuv9KP/ufH+N7A9TBrmq5Ys45qtuVTw6FqjUyNgib4w2bOS/aQ00g93YBSAG1eLlO4s+CyKKVYsFuRCln1xm71gSczkZUd+u6j6DxNO/T7O/UH9HpiTJZse3DJVstI0FAmlqyUT9Ck6YAbKdbaabhOTdh0ZN1IaN4Rs205tY7V+pW0o+95DBc1m8dZ7sUBxiEK4sAjhEWRYQUvsxuGAN1nL7O6L5dWvdRNJJY8ah5UEml026olMaVLniqu/MlkTDPaMlzj7ogMDjLc9XCf38S3dX67vkl0jlsNlLyF46NKruv4HyKENQHt84NiPpOwRE0QatkcgOJ3GrL0oyh4yUUGj0JRlmIJDKNFvkOkGd8qOXSF03S+SXmiOpUi16wjExnbSS5Xr1xuE4WxZsRLybdmKTZMPtZzO1raz8r2bcaE3IFwXawbkzsiWZ+cSbD2y9aUC56V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Aw==</diagram></mxfile>
\ No newline at end of file
<mxfile host="Electron" modified="2021-05-10T07:11:14.549Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/13.7.9 Chrome/85.0.4183.121 Electron/10.1.3 Safari/537.36" etag="-4TOR4_THu-_K0abl6cd" version="13.7.9" type="device"><diagram name="Page-1" id="822b0af5-4adb-64df-f703-e8dfc1f81529">7Vtbc6M4Fv41rtp5gBIIcXlMJ3HvTs9W9Ux6Jjv9khIgY60xogW+pH/9HGGwAeHESezYM9VOVQwHcUDn8p2L5BG+nq8/SppP/ytilo5sFK9H+GZk2xbyXfhSlMea4pKakkge17Qd4Y5/Z82tNXXBY1Z0BpZCpCXPu8RIZBmLyg6NSilW3WETkXafmtOEaYS7iKY69Z7H5bSmWgjtLvyb8WRaP9on9YWQRrNEikVWP29k40n12Vye04ZXPb6Y0lisWiR8O8LXUohyczRfX7NUCbcR2+a+8Z6r2/eWLCsPueErMqLVkjx8/S1dfqOf/fuH+NbANZslTResmUf1tuVjI6FqjkxxQSP8YTXlJbvLaaSursAogDYt5ymcWXBYlFLM2LVIhazuxm71gSsTkZUt+uaj6DxNW/TbG/UHdH1+zbsyWbJ1i1TP9yMTc1bKRxjSXMWNFmvrNFynJqxaum40NG2p2bac2sZq+0q23HcyhoNazMMi9+IA4xAFceARwqLIsILnxQ0swPbZ86Lu6mVrXuokEnMeNRcqjTS2bdWaGNM5T5VU/mAyphk9jsBdD3flTXxbl7frm0SXuOXab5f4oJHrNv6bCGFOQLu/U8JnEqaoKUJNmwNQ/EJDln4WBS+5yOBSKMpSzEFgtMg3iDTha6WHtnKam69SnqibSpFr3pGJjG00l6tHzteJwlgz4qXka7MUKyYf6nc7WNun062F3J5yXaw7kzugWZ+cSLH2896UC56VTN4uYeJFg1Ft4cW0mG7FuhfIalX1sIog9Qf0tGciEVMPbZnBXhsathOxKFOewdObmKceQushW+Z9wxGTCY+YGbMlfBVmBBJ8yKfw5g80i6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b0eThwvfg0ao60Z4021m2B0iftODt5O0rW2/V74t9l2ogLu9ifHm+G7H3bj278A</diagram></mxfile>
\ No newline at end of file
analytics.png

73.1 KB | W: | H:

analytics.png

93.5 KB | W: | H:

analytics.png
analytics.png
analytics.png
analytics.png
  • 2-up
  • Swipe
  • Onion skin
# This docker compose file allow to deploy all mandatory components that are not easy to launch from your IDE of your
# development laptop.
version: '3.5'
services:
es:
image: docker.elastic.co/elasticsearch/elasticsearch:7.12.1
environment:
- node.name=es
- discovery.type=single-node
- cluster.name=elasticsearch
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- es:/usr/share/elasticsearch/data/analytics
ports:
- 9200:9200
networks:
- network_analytics
kibana:
image: docker.elastic.co/kibana/kibana:7.12.1
ports:
- 5601:5601
environment:
ELASTICSEARCH_URL: http://es:9200
ELASTICSEARCH_HOSTS: '["http://es:9200"]'
networks:
- network_analytics
depends_on:
- es
logstash:
image: docker.elastic.co/logstash/logstash:7.12.1
volumes:
- type: bind
source: ./docker-compose/logstash/config/logstash.yml
target: /usr/share/logstash/config/logstash.yml
read_only: true
- type: bind
source: ./docker-compose/logstash/pipeline
target: /usr/share/logstash/pipeline
read_only: true
environment:
LS_JAVA_OPTS: "-Xmx512m -Xms512m"
networks:
- network_analytics
depends_on:
- es
- kafka
zookeeper:
image: wurstmeister/zookeeper:3.4.6
ports:
- "2181:2181"
networks:
- network_analytics
kafka:
image: wurstmeister/kafka:2.13-2.7.0
ports:
- "19092:19092"
environment:
HOSTNAME_COMMAND: "docker info | grep ^Name: | cut -d' ' -f 2"
KAFKA_LISTENERS: INSIDE://:9092,OUTSIDE://:19092
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9092,OUTSIDE://_{HOSTNAME_COMMAND}:19092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- network_analytics
kafdrop:
image: obsidiandynamics/kafdrop:3.27.0
ports:
- "9000:9000"
environment:
KAFKA_BROKERCONNECT: "kafka:19092"
JVM_OPTS: "-Xms128M -Xmx512M -Xss512K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify"
networks:
- network_analytics
depends_on:
- kafka
volumes:
es:
driver: local
networks:
network_analytics:
driver: bridge
---
## Default Logstash configuration from Logstash base image.
## https://github.com/elastic/logstash/blob/master/docker/data/logstash/config/logstash-full.yml
#
http.host: "0.0.0.0"
xpack.monitoring.enabled: "false"
log.level: info
input {
kafka {
bootstrap_servers => ["kafka:9092"]
topics => "dev.analytics.cmd.create"
codec => json
decorate_events => "true"
}
}
## Add your filters / logstash plugins configuration here
output {
stdout { }
elasticsearch {
hosts => "http://es:9200"
index => "analytics"
}
}
mvnw 100644 → 100755
......@@ -8,7 +8,7 @@
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
......
......@@ -13,7 +13,7 @@
<groupId>fr.gouv.tac</groupId>
<artifactId>analytics-server</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.1.0</version>
<packaging>jar</packaging>
......@@ -23,8 +23,11 @@
<commons-lang3.version>3.11</commons-lang3.version>
<javax.inject.version>1</javax.inject.version>
<mapstruct.version>1.4.2.Final</mapstruct.version>
<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
<spring-cloud.version>2020.0.1</spring-cloud.version>
<spring-kafka.version>2.6.6</spring-kafka.version>
<swagger-core-version>1.6.2</swagger-core-version>
</properties>
......@@ -103,6 +106,21 @@
<optional>true</optional>
</dependency>
<!-- Added to allow the building from intellij see https://youtrack.jetbrains.com/issue/IDEA-150621 -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-mapstruct-binding</artifactId>
<version>${lombok-mapstruct-binding.version}</version>
<scope>provided</scope>
</dependency>
<!-- Added to allow the building from intellij see https://youtrack.jetbrains.com/issue/IDEA-150621 -->
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
......@@ -137,10 +155,53 @@
<version>${spring-kafka.version}</version>
</dependency>
<!--Dependencies required for openapi generated sources -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-core-version}</version>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.1</version>
</dependency>
<!-- openapi-generator-maven-plugin 5.1.0 is not compatible with more recent versions
see : https://github.com/springfox/springfox/issues/3760 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.1.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>
${project.basedir}/src/main/doc/openapi-analytics-v1.yaml
</inputSpec>
<generatorName>spring</generatorName>
<apiPackage>fr.gouv.tac.analytics.server.api</apiPackage>
<modelPackage>fr.gouv.tac.analytics.server.api.model</modelPackage>
<configOptions>
<interfaceOnly>true</interfaceOnly>
<useTags>true</useTags>
<additionalModelTypeAnnotations>@lombok.Builder@lombok.AllArgsConstructor@lombok.NoArgsConstructor</additionalModelTypeAnnotations>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
......@@ -158,15 +219,20 @@
<version>${maven-compiler-plugin.version}</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-mapstruct-binding</artifactId>
<version>${lombok-mapstruct-binding.version}</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
......@@ -205,29 +271,19 @@
</build>
<repositories>
<repository>
<id>gitlab-maven</id>
<url>${env.CI_SERVER_URL}/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitlab-maven</id>
<url>${env.CI_SERVER_URL}/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
<url>https://gitlab.inria.fr/api/v4/projects/29882/packages/maven</url>
</repository>
<snapshotRepository>
<id>gitlab-maven</id>
<url>${env.CI_SERVER_URL}/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
<url>https://gitlab.inria.fr/api/v4/projects/29882/packages/maven</url>
</snapshotRepository>
</distributionManagement>
<scm>
<connection>scm:git:${gitRepositoryUrl}</connection>
<developerConnection>scm:git:${gitRepositoryUrl}</developerConnection>
<url>${gitRepositoryUrl}</url>
<tag>HEAD</tag>
<url>https://gitlab.inria.fr/stopcovid19/analytics-server</url>
</scm>
</project>
openapi: 3.0.0
info:
description: "#TOUS-ANTI-COVID, analytics Client API"
version: 1.0.0
title: "#TOUS-ANTI-COVID, analytics"
termsOfService: https://gitlab.inria.fr/stemcovid19/wp3-robert-server/analytics-server
version: 1.1.0
title: "tac analytics"
termsOfService: https://gitlab.inria.fr/stopcovid19/wp3-robert-server/analytics-server
contact:
email: stopcovid@inria.fr
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
tags: [ ]
tags: []
paths:
/analytics:
post:
......@@ -54,7 +54,38 @@ paths:
$ref: "#/components/schemas/ErrorResponse"
security:
- bearerAuth: [ ]
delete:
tags: [ "analytics" ]
summary: delete analytics
description: |-
Request the deletion of analytics based on the application uuid supplied.
operationId: deleteAnalytics
parameters:
- name: installationUuid
in: query
description: the installation unique identifier. This identifier is generated by the mobile application during its installation.
required: true
schema:
type: string
minLength: 1
maxLength: 64
responses:
"204":
description: successful operation
"401":
description: Unauthorized request, bad, missing or invalid token
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"500":
description: An unexpected error occurs
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
security:
- bearerAuth: [ ]
components:
securitySchemes:
bearerAuth:
......@@ -75,6 +106,7 @@ components:
properties:
installationUuid:
type: string
minLength: 1
maxLength: 64
description: the installation unique identifier. This identifier is generated by the mobile application during its installation.
infos:
......@@ -99,26 +131,22 @@ components:
Information:
type: object
maxProperties: 20
additionalProperties:
type: string
maxLength: 512
type: object
TimestampedEvent:
type: object
properties:
name:
type: string
maxLength: 64