Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
ROBERT Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
24
Issues
24
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TousAntiCovid sources
ROBERT Server
Commits
e9119c35
Commit
e9119c35
authored
Jun 22, 2020
by
Redford StopCovid
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/v1.1.0' into 'develop'
Merge back Release/v1.1.0 See merge request
!61
parents
4a62ce28
20109f41
Changes
158
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
158 changed files
with
21167 additions
and
448 deletions
+21167
-448
pom.xml
pom.xml
+1
-1
robert-crypto-grpc-server-messaging/pom.xml
robert-crypto-grpc-server-messaging/pom.xml
+1
-1
robert-crypto-grpc-server-storage/pom.xml
robert-crypto-grpc-server-storage/pom.xml
+1
-1
robert-crypto-grpc-server/pom.xml
robert-crypto-grpc-server/pom.xml
+1
-1
robert-crypto-grpc-server/src/main/java/fr/gouv/stopc/robert/crypto/grpc/server/service/ICryptoServerConfigurationService.java
...rpc/server/service/ICryptoServerConfigurationService.java
+1
-0
robert-crypto-grpc-server/src/main/java/fr/gouv/stopc/robert/crypto/grpc/server/service/impl/CryptoGrpcServiceBaseImpl.java
...o/grpc/server/service/impl/CryptoGrpcServiceBaseImpl.java
+15
-11
robert-crypto-grpc-server/src/main/java/fr/gouv/stopc/robert/crypto/grpc/server/service/impl/CryptoServerConfigurationServiceImpl.java
...er/service/impl/CryptoServerConfigurationServiceImpl.java
+1
-0
robert-crypto-grpc-server/src/test/java/test/fr/gouv/stopc/robert/crypto/grpc/server/CryptoServiceGrpcServerTest.java
...obert/crypto/grpc/server/CryptoServiceGrpcServerTest.java
+16
-9
robert-server-batch/pom.xml
robert-server-batch/pom.xml
+18
-25
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/configuration/ScoringAlgorithmConfiguration.java
...er/batch/configuration/ScoringAlgorithmConfiguration.java
+35
-0
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/model/ScoringResult.java
...r/gouv/stopc/robert/server/batch/model/ScoringResult.java
+16
-0
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/processor/ContactProcessor.java
...stopc/robert/server/batch/processor/ContactProcessor.java
+29
-16
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/service/ScoringStrategyService.java
...c/robert/server/batch/service/ScoringStrategyService.java
+11
-1
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/service/impl/ScoringStrategyServiceImpl.java
...server/batch/service/impl/ScoringStrategyServiceImpl.java
+21
-2
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/service/impl/ScoringStrategyV2ServiceImpl.java
...rver/batch/service/impl/ScoringStrategyV2ServiceImpl.java
+191
-0
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/utils/PropertyLoader.java
.../gouv/stopc/robert/server/batch/utils/PropertyLoader.java
+4
-1
robert-server-batch/src/main/resources/application.properties
...rt-server-batch/src/main/resources/application.properties
+9
-3
robert-server-batch/src/main/resources/logback.xml
robert-server-batch/src/main/resources/logback.xml
+2
-2
robert-server-batch/src/test/java/test/fr/gouv/stopc/robertserver/batch/processor/ContactProcessorTest.java
...pc/robertserver/batch/processor/ContactProcessorTest.java
+1
-1
robert-server-batch/src/test/java/test/fr/gouv/stopc/robertserver/batch/processor/TimeArithmeticTest.java
...topc/robertserver/batch/processor/TimeArithmeticTest.java
+62
-0
robert-server-batch/src/test/java/test/fr/gouv/stopc/robertserver/batch/scoring/RSSICalibratedScoringStrategyTest.java
...rver/batch/scoring/RSSICalibratedScoringStrategyTest.java
+285
-358
robert-server-batch/src/test/java/test/fr/gouv/stopc/robertserver/batch/scoring/ScoringAlgorithmV2Test.java
...pc/robertserver/batch/scoring/ScoringAlgorithmV2Test.java
+253
-0
robert-server-batch/src/test/resources/application.properties
...rt-server-batch/src/test/resources/application.properties
+11
-4
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A00.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A00.csv
+496
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A01.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A01.csv
+273
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A02.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A02.csv
+516
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A03.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A03.csv
+286
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A04.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A04.csv
+98
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A05.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A05.csv
+281
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A06.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A06.csv
+519
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A07.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A07.csv
+38
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A08.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A08.csv
+110
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A09.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A09.csv
+248
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A10.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A10.csv
+190
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A11.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A11.csv
+272
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A12.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A12.csv
+267
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A13.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A13.csv
+267
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A14.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A14.csv
+495
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A15.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A15.csv
+505
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A16.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A16.csv
+518
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A17.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A17.csv
+264
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A18.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A18.csv
+509
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A19.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A19.csv
+361
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A20.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A20.csv
+142
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A21.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A21.csv
+259
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A22.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A22.csv
+273
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A23.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A23.csv
+504
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A24.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A24.csv
+512
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A25.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A25.csv
+243
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A26.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A26.csv
+458
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A27.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A27.csv
+425
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A28.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A28.csv
+205
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A29.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A29.csv
+210
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A30.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A30.csv
+449
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A31.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A31.csv
+237
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A32.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A32.csv
+280
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A33.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A33.csv
+245
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A34.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A34.csv
+421
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A35.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A35.csv
+456
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A36.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A36.csv
+503
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A37.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A37.csv
+237
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A38.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A38.csv
+490
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A39.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A39.csv
+154
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A40.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A40.csv
+11
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A41.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A41.csv
+494
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A42.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A42.csv
+416
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A43.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A43.csv
+268
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A44.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A44.csv
+87
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A45.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A45.csv
+511
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A46.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A46.csv
+248
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A47.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A47.csv
+497
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A48.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A48.csv
+269
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A49.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A49.csv
+250
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A50.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A50.csv
+464
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A51.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A51.csv
+148
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A52.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A52.csv
+105
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A53.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A53.csv
+143
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A54.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A54.csv
+99
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A55.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A55.csv
+39
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A56.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A56.csv
+260
-0
robert-server-batch/src/test/resources/input_v2/C4_20_A/C4_20_A57.csv
...r-batch/src/test/resources/input_v2/C4_20_A/C4_20_A57.csv
+501
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA00.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA00.csv
+30
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA01.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA01.csv
+83
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA02.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA02.csv
+92
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA03.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA03.csv
+27
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA04.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA04.csv
+90
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA05.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA05.csv
+32
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA06.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA06.csv
+94
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA07.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA07.csv
+28
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA08.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA08.csv
+26
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA09.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA09.csv
+71
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA10.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA10.csv
+42
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA11.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA11.csv
+15
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA12.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA12.csv
+35
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA13.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA13.csv
+94
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA14.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA14.csv
+97
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA15.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA15.csv
+31
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA16.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA16.csv
+82
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA17.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA17.csv
+12
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA18.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA18.csv
+56
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA19.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA19.csv
+24
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA20.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA20.csv
+99
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA21.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA21.csv
+25
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA22.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA22.csv
+82
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA23.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA23.csv
+22
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA24.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA24.csv
+91
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA25.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA25.csv
+26
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA26.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA26.csv
+14
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA27.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA27.csv
+84
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA28.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA28.csv
+22
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA29.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA29.csv
+44
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA30.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA30.csv
+35
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA31.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA31.csv
+4
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA32.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA32.csv
+7
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA33.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA33.csv
+11
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA34.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA34.csv
+21
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA35.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA35.csv
+6
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA36.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA36.csv
+71
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA37.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA37.csv
+21
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA38.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA38.csv
+15
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA39.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA39.csv
+6
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA40.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA40.csv
+16
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA41.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA41.csv
+49
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA42.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA42.csv
+35
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA43.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA43.csv
+73
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA44.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA44.csv
+34
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA45.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA45.csv
+13
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA46.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA46.csv
+4
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA47.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA47.csv
+3
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA48.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA48.csv
+20
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA49.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA49.csv
+9
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA50.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA50.csv
+3
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA51.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA51.csv
+6
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA52.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA52.csv
+15
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA53.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA53.csv
+6
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA54.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA54.csv
+2
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA55.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA55.csv
+2
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA56.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA56.csv
+3
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA57.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA57.csv
+5
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA58.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA58.csv
+2
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA59.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA59.csv
+2
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA60.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA60.csv
+2
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA61.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA61.csv
+2
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA62.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA62.csv
+2
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA63.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA63.csv
+2
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA64.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA64.csv
+2
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA65.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA65.csv
+2
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA66.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA66.csv
+2
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA67.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA67.csv
+7
-0
robert-server-batch/src/test/resources/input_v2/R1_AA/R1_AA68.csv
...erver-batch/src/test/resources/input_v2/R1_AA/R1_AA68.csv
+4
-0
robert-server-common/pom.xml
robert-server-common/pom.xml
+1
-1
robert-server-common/src/main/java/fr/gouv/stopc/robert/server/common/service/IServerConfigurationService.java
...rt/server/common/service/IServerConfigurationService.java
+1
-0
robert-server-common/src/main/java/fr/gouv/stopc/robert/server/common/service/impl/ServerConfigurationServiceImpl.java
...r/common/service/impl/ServerConfigurationServiceImpl.java
+1
-0
robert-server-common/src/main/java/fr/gouv/stopc/robert/server/common/utils/TimeUtils.java
...a/fr/gouv/stopc/robert/server/common/utils/TimeUtils.java
+40
-0
robert-server-crypto/pom.xml
robert-server-crypto/pom.xml
+1
-1
robert-server-database/pom.xml
robert-server-database/pom.xml
+1
-1
robert-server-ws-rest/pom.xml
robert-server-ws-rest/pom.xml
+1
-1
robert-server-ws-rest/src/main/java/fr/gouv/stopc/robertserver/ws/service/impl/AuthRequestValidationServiceImpl.java
...ver/ws/service/impl/AuthRequestValidationServiceImpl.java
+16
-7
No files found.
pom.xml
View file @
e9119c35
...
...
@@ -19,7 +19,7 @@
<groupId>
fr.gouv.stopc
</groupId>
<artifactId>
robert-server
</artifactId>
<version>
1.
0
.1-SNAPSHOT
</version>
<version>
1.
1
.1-SNAPSHOT
</version>
<name>
robert-server
</name>
<packaging>
pom
</packaging>
<description>
Projet principal
</description>
...
...
robert-crypto-grpc-server-messaging/pom.xml
View file @
e9119c35
...
...
@@ -13,7 +13,7 @@
<parent>
<groupId>
fr.gouv.stopc
</groupId>
<artifactId>
robert-server
</artifactId>
<version>
1.
0
.1-SNAPSHOT
</version>
<version>
1.
1
.1-SNAPSHOT
</version>
</parent>
<artifactId>
robert-crypto-grpc-server-messaging
</artifactId>
...
...
robert-crypto-grpc-server-storage/pom.xml
View file @
e9119c35
...
...
@@ -13,7 +13,7 @@
<parent>
<groupId>
fr.gouv.stopc
</groupId>
<artifactId>
robert-server
</artifactId>
<version>
1.
0
.1-SNAPSHOT
</version>
<version>
1.
1
.1-SNAPSHOT
</version>
</parent>
...
...
robert-crypto-grpc-server/pom.xml
View file @
e9119c35
...
...
@@ -13,7 +13,7 @@
<parent>
<groupId>
fr.gouv.stopc
</groupId>
<artifactId>
robert-server
</artifactId>
<version>
1.
0
.1-SNAPSHOT
</version>
<version>
1.
1
.1-SNAPSHOT
</version>
</parent>
<artifactId>
robert-crypto-grpc-server
</artifactId>
...
...
robert-crypto-grpc-server/src/main/java/fr/gouv/stopc/robert/crypto/grpc/server/service/ICryptoServerConfigurationService.java
View file @
e9119c35
...
...
@@ -2,6 +2,7 @@ package fr.gouv.stopc.robert.crypto.grpc.server.service;
public
interface
ICryptoServerConfigurationService
{
/**
* TpStart in NTP seconds
*
...
...
robert-crypto-grpc-server/src/main/java/fr/gouv/stopc/robert/crypto/grpc/server/service/impl/CryptoGrpcServiceBaseImpl.java
View file @
e9119c35
...
...
@@ -4,11 +4,7 @@ import java.security.Key;
import
java.time.Instant
;
import
java.time.ZoneOffset
;
import
java.time.ZonedDateTime
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Comparator
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
javax.inject.Inject
;
...
...
@@ -378,6 +374,7 @@ public class CryptoGrpcServiceBaseImpl extends CryptoGrpcServiceImplImplBase {
* Decrypt the provided ebid and check the authRequestEpoch it contains the provided one or the next/previous
* @param ebid
* @param authRequestEpoch
* @param enableEpochOverlapping authorize the epoch overlapping (ie too close epochs => (Math.abs(epoch1 - epoch2) == 1))
* @param adjacentEpochMatchEnum
* @return
* @throws RobertServerCryptoException
...
...
@@ -386,6 +383,7 @@ public class CryptoGrpcServiceBaseImpl extends CryptoGrpcServiceImplImplBase {
int
authRequestEpoch
,
boolean
mustCheckWithPreviousDayKey
,
boolean
ksAdjustment
,
boolean
enableEpochOverlapping
,
AdjacentEpochMatchEnum
adjacentEpochMatchEnum
)
throws
RobertServerCryptoException
{
...
...
@@ -406,13 +404,17 @@ public class CryptoGrpcServiceBaseImpl extends CryptoGrpcServiceImplImplBase {
if
(
authRequestEpoch
!=
ebidEpochId
)
{
log
.
warn
(
"Epoch from EBID and accompanying authRequestEpoch do not match: ebid epoch = {} vs auth request epoch = {}"
,
ebidEpochId
,
authRequestEpoch
);
if
(
ksAdjustment
&&
!
mustCheckWithPreviousDayKey
)
{
if
(
enableEpochOverlapping
&&
(
Math
.
abs
(
authRequestEpoch
-
ebidEpochId
)
==
1
))
{
return
EbidContent
.
builder
().
epochId
(
ebidEpochId
).
idA
(
idA
).
build
();
}
else
if
(
ksAdjustment
&&
!
mustCheckWithPreviousDayKey
)
{
return
decryptEBIDAndCheckEpoch
(
ebid
,
authRequestEpoch
,
true
,
false
,
adjacentEpochMatchEnum
);
enableEpochOverlapping
,
adjacentEpochMatchEnum
);
}
else
{
return
manageEBIDDecryptRetry
(
ebid
,
authRequestEpoch
,
...
...
@@ -442,7 +444,7 @@ public class CryptoGrpcServiceBaseImpl extends CryptoGrpcServiceImplImplBase {
epoch
,
false
,
isEBIDWithinRange
(
epoch
),
AdjacentEpochMatchEnum
.
NONE
);
false
,
AdjacentEpochMatchEnum
.
NONE
);
}
private
EbidContent
manageEBIDDecryptRetry
(
byte
[]
ebid
,
int
authRequestEpoch
,
AdjacentEpochMatchEnum
adjacentEpochMatchEnum
)
...
...
@@ -450,10 +452,11 @@ public class CryptoGrpcServiceBaseImpl extends CryptoGrpcServiceImplImplBase {
switch
(
adjacentEpochMatchEnum
)
{
case
PREVIOUS:
log
.
warn
(
"Retrying ebid decrypt with previous epoch"
);
return
decryptEBIDAndCheckEpoch
(
ebid
,
authRequestEpoch
-
1
,
false
,
false
,
AdjacentEpochMatchEnum
.
NONE
);
return
decryptEBIDAndCheckEpoch
(
ebid
,
authRequestEpoch
-
1
,
false
,
false
,
false
,
AdjacentEpochMatchEnum
.
NONE
);
case
NEXT:
log
.
warn
(
"Retrying ebid decrypt with next epoch"
);
return
decryptEBIDAndCheckEpoch
(
ebid
,
authRequestEpoch
+
1
,
false
,
false
,
AdjacentEpochMatchEnum
.
NONE
);
return
decryptEBIDAndCheckEpoch
(
ebid
,
authRequestEpoch
+
1
,
false
,
false
,
false
,
AdjacentEpochMatchEnum
.
NONE
);
case
NONE:
default
:
return
null
;
...
...
@@ -471,7 +474,7 @@ public class CryptoGrpcServiceBaseImpl extends CryptoGrpcServiceImplImplBase {
epoch
,
false
,
isEBIDWithinRange
(
epoch
),
atStartOrEndOfDay
(
timeReceived
));
true
,
atStartOrEndOfDay
(
timeReceived
));
// AdjacentEpochMatchEnum adjacentEpochMatch = AdjacentEpochMatchEnum.NONE;
// // TODO: replace local EPOCH_DURATION with common epoch duration constant
...
...
@@ -487,6 +490,7 @@ public class CryptoGrpcServiceBaseImpl extends CryptoGrpcServiceImplImplBase {
ZonedDateTime
zonedDateTime
=
Instant
.
ofEpochMilli
(
TimeUtils
.
convertNTPSecondsToUnixMillis
(
timeReceived
))
.
atZone
(
ZoneOffset
.
UTC
);
int
tolerance
=
this
.
propertyLoader
.
getHelloMessageTimeStampTolerance
();
if
(
zonedDateTime
.
getHour
()
==
0
...
...
robert-crypto-grpc-server/src/main/java/fr/gouv/stopc/robert/crypto/grpc/server/service/impl/CryptoServerConfigurationServiceImpl.java
View file @
e9119c35
...
...
@@ -19,6 +19,7 @@ import fr.gouv.stopc.robert.server.common.utils.TimeUtils;
@Service
public
class
CryptoServerConfigurationServiceImpl
implements
ICryptoServerConfigurationService
{
private
long
timeStartNtp
;
private
final
PropertyLoader
propertyLoader
;
...
...
robert-crypto-grpc-server/src/test/java/test/fr/gouv/stopc/robert/crypto/grpc/server/CryptoServiceGrpcServerTest.java
View file @
e9119c35
package
test.fr.gouv.stopc.robert.crypto.grpc.server
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertNull
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertNotNull
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertNull
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertTrue
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
fail
;
import
static
org
.
mockito
.
Mockito
.
doReturn
;
...
...
@@ -36,7 +36,6 @@ import org.junit.jupiter.api.Test;
import
org.junit.jupiter.api.extension.ExtendWith
;
import
org.mockito.InjectMocks
;
import
org.mockito.Mock
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.test.context.junit.jupiter.SpringExtension
;
import
com.fasterxml.jackson.core.type.TypeReference
;
...
...
@@ -44,9 +43,19 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.google.protobuf.ByteString
;
import
fr.gouv.stopc.robert.crypto.grpc.server.CryptoServiceGrpcServer
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.*
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.CreateRegistrationRequest
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.CreateRegistrationResponse
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.CryptoGrpcServiceImplGrpc
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.CryptoGrpcServiceImplGrpc.CryptoGrpcServiceImplImplBase
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.CryptoGrpcServiceImplGrpc.CryptoGrpcServiceImplStub
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.DeleteIdRequest
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.DeleteIdResponse
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.GetIdFromAuthRequest
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.GetIdFromAuthResponse
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.GetIdFromStatusRequest
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.GetIdFromStatusResponse
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.GetInfoFromHelloMessageRequest
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.GetInfoFromHelloMessageResponse
;
import
fr.gouv.stopc.robert.crypto.grpc.server.service.ICryptoServerConfigurationService
;
import
fr.gouv.stopc.robert.crypto.grpc.server.service.impl.CryptoGrpcServiceBaseImpl
;
import
fr.gouv.stopc.robert.crypto.grpc.server.service.impl.ECDHKeyServiceImpl
;
...
...
@@ -410,11 +419,10 @@ class CryptoServiceGrpcServerTest {
}
private
AuthRequestBundle
generateAuthRequestBundleWithTimeDeltaAndOtherKS
(
byte
[]
id
,
byte
[]
keyForMac
,
DigestSaltEnum
digestSalt
,
long
timeDelta
,
OtherKSEnum
otherKs
)
{
byte
[]
keyForMac
,
DigestSaltEnum
digestSalt
,
long
timeDelta
,
OtherKSEnum
otherKs
)
{
long
time
=
getCurrentTimeNTPSeconds
();
int
epochId
=
TimeUtils
.
getNumberOfEpochsBetween
(
this
.
serverConfigurationService
.
getServiceTimeStart
(),
...
...
@@ -423,7 +431,6 @@ class CryptoServiceGrpcServerTest {
// Mock K_S
byte
[]
ks
=
new
byte
[
24
];
new
SecureRandom
().
nextBytes
(
ks
);
byte
[]
ksPrevious
=
new
byte
[
24
];
new
SecureRandom
().
nextBytes
(
ksPrevious
);
byte
[]
ksNext
=
new
byte
[
24
];
...
...
robert-server-batch/pom.xml
View file @
e9119c35
...
...
@@ -13,7 +13,7 @@
<parent>
<groupId>
fr.gouv.stopc
</groupId>
<artifactId>
robert-server
</artifactId>
<version>
1.
0
.1-SNAPSHOT
</version>
<version>
1.
1
.1-SNAPSHOT
</version>
</parent>
<artifactId>
robert-server-batch
</artifactId>
...
...
@@ -80,6 +80,13 @@
<artifactId>
javax.inject
</artifactId>
</dependency>
<dependency>
<groupId>
com.opencsv
</groupId>
<artifactId>
opencsv
</artifactId>
<version>
5.2
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
de.flapdoodle.embed
</groupId>
<artifactId>
de.flapdoodle.embed.mongo
</artifactId>
...
...
@@ -98,6 +105,11 @@
<artifactId>
micrometer-registry-prometheus
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<optional>
true
</optional>
</dependency>
</dependencies>
<build>
...
...
@@ -107,30 +119,11 @@
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<!-- Disabled because fails when not executed from each module's directory -->
<!--
<plugin>
<groupId>org.complykit</groupId>
<artifactId>license-check-maven-plugin</artifactId>
<version>0.5.3</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>os-check</goal>
</goals>
</execution>
</executions>
<configuration>
<blacklist>
<param>agpl-3.0</param>
<param>gpl-2.0</param>
<param>gpl-3.0</param>
</blacklist>
<excludes>
</excludes>
</configuration>
</plugin>
-->
<!-- <plugin> <groupId>org.complykit</groupId> <artifactId>license-check-maven-plugin</artifactId>
<version>0.5.3</version> <executions> <execution> <phase>verify</phase> <goals>
<goal>os-check</goal> </goals> </execution> </executions> <configuration>
<blacklist> <param>agpl-3.0</param> <param>gpl-2.0</param> <param>gpl-3.0</param>
</blacklist> <excludes> </excludes> </configuration> </plugin> -->
</plugins>
</build>
...
...
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/configuration/ScoringAlgorithmConfiguration.java
0 → 100644
View file @
e9119c35
package
fr.gouv.stopc.robert.server.batch.configuration
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
* Configuration class of the scoring algorithm
*
*
*/
@Getter
@Setter
@Component
@ConfigurationProperties
(
prefix
=
"robert.scoring"
)
public
class
ScoringAlgorithmConfiguration
{
// Max Rssi cutting peak
private
int
rssiMax
;
// Weighting vector for the # of packets received per window values
private
double
[]
deltas
;
// limit power in Db below which the collected value is assumed to be zero
private
double
p0
;
// Constant for RSSI averaging = 10 log(10)
private
double
softMaxA
;
// Constant for risk averaging
private
double
softMaxB
;
}
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/model/ScoringResult.java
0 → 100644
View file @
e9119c35
package
fr.gouv.stopc.robert.server.batch.model
;
import
lombok.Builder
;
import
lombok.Data
;
@Data
@Builder
public
class
ScoringResult
{
private
Integer
duration
;
private
Integer
nbContacts
;
private
Double
rssiScore
;
}
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/processor/ContactProcessor.java
View file @
e9119c35
...
...
@@ -8,6 +8,7 @@ import java.util.Optional;
import
java.util.stream.Collectors
;
import
fr.gouv.stopc.robert.crypto.grpc.server.messaging.*
;
import
fr.gouv.stopc.robert.server.batch.service.impl.ScoringStrategyV2ServiceImpl
;
import
org.springframework.batch.item.ItemProcessor
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -17,6 +18,7 @@ import fr.gouv.stopc.robert.crypto.grpc.server.client.service.ICryptoServerGrpcC
import
fr.gouv.stopc.robert.server.batch.exception.RobertScoringException
;
import
fr.gouv.stopc.robert.server.batch.service.ScoringStrategyService
;
import
fr.gouv.stopc.robert.server.batch.utils.PropertyLoader
;
import
fr.gouv.stopc.robert.server.batch.model.ScoringResult
;
import
fr.gouv.stopc.robert.server.common.service.IServerConfigurationService
;
import
fr.gouv.stopc.robert.server.common.utils.TimeUtils
;
import
fr.gouv.stopc.robert.server.crypto.exception.RobertServerCryptoException
;
...
...
@@ -137,12 +139,21 @@ public class ContactProcessor implements ItemProcessor<Contact, Contact> {
.
filter
(
ep
->
ep
.
getEpochId
()
>
latestRiskEpoch
)
.
collect
(
Collectors
.
toList
());
Double
totalRisk
=
scoresSinceLastNotif
.
stream
()
.
map
(
EpochExposition:
:
getExpositionScores
)
.
map
(
item
->
item
.
stream
().
mapToDouble
(
Double:
:
doubleValue
).
sum
())
.
reduce
(
0.0
,
(
a
,
b
)
->
a
+
b
);
// TODO: delay to end of batch for all registrations and epochs that have been affected
// If at risk detection is delayed to end of batch, no aggregate scoring here
// If not, scoring must be done here. If at risk trigger on single exposed epoch,
// then remove loop and get epochExposition[epoch] and launch aggregate but protect setAtRisk if set to true
int
numberOfAtRiskExposedEpochs
=
0
;
for
(
EpochExposition
epochExposition
:
scoresSinceLastNotif
)
{
double
finalRiskForEpoch
=
this
.
scoringStrategy
.
aggregate
(
epochExposition
.
getExpositionScores
());
if
(
finalRiskForEpoch
>
this
.
propertyLoader
.
getRiskThreshold
())
{
log
.
info
(
"Risk detected. Scored aggregate risk for epoch {}: {}"
,
epochExposition
.
getEpochId
(),
finalRiskForEpoch
);
numberOfAtRiskExposedEpochs
++;
break
;
}
}
registration
.
setAtRisk
(
totalRisk
>
this
.
propertyLoader
.
ge
tRiskThreshold
());
registration
.
setAtRisk
(
numberOfAtRiskExposedEpochs
>=
this
.
scoringStrategy
.
getNbEpochsScoredA
tRiskThreshold
());
this
.
registrationService
.
saveRegistration
(
registration
);
this
.
contactService
.
delete
(
contact
);
...
...
@@ -159,17 +170,19 @@ public class ContactProcessor implements ItemProcessor<Contact, Contact> {
final
long
timeFromDeviceAs16bits
=
castLong
(
helloMessageDetail
.
getTimeCollectedOnDevice
(),
2
);
final
int
timeDiffTolerance
=
this
.
propertyLoader
.
getHelloMessageTimeStampTolerance
();
// TODO: fix this as overflow of 16bits may cause rejection of valid messages
if
(
Math
.
abs
(
timeFromHelloNTPsecAs16bits
-
timeFromDeviceAs16bits
)
>
timeDiffTolerance
)
{
log
.
warn
(
"Time tolerance was exceeded: |{} (HELLO) vs {} (receiving device)| > {}; discarding HELLO message"
,
timeFromHelloNTPsecAs16bits
,
timeFromDeviceAs16bits
,
timeDiffTolerance
);
return
false
;
if
(
TimeUtils
.
toleranceCheckWithWrap
(
timeFromHelloNTPsecAs16bits
,
timeFromDeviceAs16bits
,
timeDiffTolerance
))
{
return
true
;
}
return
true
;
log
.
warn
(
"Time tolerance was exceeded: |{} (HELLO) vs {} (receiving device)| > {}; discarding HELLO message"
,
timeFromHelloNTPsecAs16bits
,
timeFromDeviceAs16bits
,
timeDiffTolerance
);
return
false
;
}
/**
* Robert Spec Step #6
*/
...
...
@@ -203,13 +216,13 @@ public class ContactProcessor implements ItemProcessor<Contact, Contact> {
.
filter
(
item
->
item
.
getEpochId
()
==
epochIdFromEBID
)
.
findFirst
();
Double
scoredRisk
=
this
.
scoringStrategy
.
execute
(
contact
);
ScoringResult
scoredRisk
=
this
.
scoringStrategy
.
execute
(
contact
);
if
(
epochToAddTo
.
isPresent
())
{
List
<
Double
>
epochScores
=
epochToAddTo
.
get
().
getExpositionScores
();
epochScores
.
add
(
scoredRisk
);
epochScores
.
add
(
scoredRisk
.
getRssiScore
()
);
}
else
{
exposedEpochs
.
add
(
EpochExposition
.
builder
()
.
expositionScores
(
Arrays
.
asList
(
scoredRisk
))
.
expositionScores
(
Arrays
.
asList
(
scoredRisk
.
getRssiScore
()
))
.
epochId
(
epochIdFromEBID
)
.
build
());
}
...
...
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/service/ScoringStrategyService.java
View file @
e9119c35
package
fr.gouv.stopc.robert.server.batch.service
;
import
fr.gouv.stopc.robert.server.batch.exception.RobertScoringException
;
import
fr.gouv.stopc.robert.server.batch.model.ScoringResult
;
import
fr.gouv.stopc.robertserver.database.model.Contact
;
import
java.util.List
;
public
interface
ScoringStrategyService
{
/**
* Compute a risk score based on the nature of the contact
*
* @param contact
*/
Double
execute
(
Contact
contact
)
throws
RobertScoringException
;
ScoringResult
execute
(
Contact
contact
)
throws
RobertScoringException
;
int
getScoringStrategyVersion
();
double
aggregate
(
List
<
Double
>
scores
);
int
getNbEpochsScoredAtRiskThreshold
();
}
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/service/impl/ScoringStrategyServiceImpl.java
View file @
e9119c35
...
...
@@ -4,11 +4,13 @@ import java.util.List;
import
javax.inject.Inject
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.stereotype.Service
;
import
fr.gouv.stopc.robert.server.batch.exception.RobertScoringException
;
import
fr.gouv.stopc.robert.server.batch.service.ScoringStrategyService
;
import
fr.gouv.stopc.robert.server.batch.utils.PropertyLoader
;
import
fr.gouv.stopc.robert.server.batch.model.ScoringResult
;
import
fr.gouv.stopc.robert.server.common.service.IServerConfigurationService
;
import
fr.gouv.stopc.robertserver.database.model.Contact
;
import
fr.gouv.stopc.robertserver.database.model.HelloMessageDetail
;
...
...
@@ -22,6 +24,7 @@ import lombok.extern.slf4j.Slf4j;
*/
@Service
@Slf4j
@ConditionalOnProperty
(
name
=
"robert.scoring.algo-version"
,
havingValue
=
"0"
)
public
class
ScoringStrategyServiceImpl
implements
ScoringStrategyService
{
private
final
IServerConfigurationService
serverConfigurationService
;
...
...
@@ -36,7 +39,23 @@ public class ScoringStrategyServiceImpl implements ScoringStrategyService {
}
@Override
public
Double
execute
(
Contact
contact
)
throws
RobertScoringException
{
public
int
getScoringStrategyVersion
()
{
return
1
;
}
@Override
public
double
aggregate
(
List
<
Double
>
scores
)
{
return
scores
.
stream
().
mapToDouble
(
Double:
:
doubleValue
).
sum
();
}
@Override
public
int
getNbEpochsScoredAtRiskThreshold
()
{
return
1
;
}
@Override
public
ScoringResult
execute
(
Contact
contact
)
throws
RobertScoringException
{
List
<
HelloMessageDetail
>
messageDetails
=
contact
.
getMessageDetails
();
final
int
alpha
=
initAlpha
();
...
...
@@ -66,7 +85,7 @@ public class ScoringStrategyServiceImpl implements ScoringStrategyService {
throw
new
RobertScoringException
(
errorMessage
);
}
return
0
-
acc
;
return
ScoringResult
.
builder
().
rssiScore
(
0
-
acc
).
build
()
;
}
private
int
initAlpha
()
{
...
...
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/service/impl/ScoringStrategyV2ServiceImpl.java
0 → 100644
View file @
e9119c35
package
fr.gouv.stopc.robert.server.batch.service.impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
fr.gouv.stopc.robert.server.batch.utils.PropertyLoader
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.stereotype.Service
;
import
fr.gouv.stopc.robert.server.batch.configuration.ScoringAlgorithmConfiguration
;
import
fr.gouv.stopc.robert.server.batch.exception.RobertScoringException
;