-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/verification #12
base: feature/userupload
Are you sure you want to change the base?
Conversation
Bitte packagename anpassen: |
...ubique/notifyme/sdk/backend/ws/insert_manager/insertion_filters/IntervalThresholdFilter.java
Outdated
Show resolved
Hide resolved
...kend-ws/src/test/java/ch/ubique/notifyme/sdk/backend/ws/insertmanager/InsertManagerTest.java
Show resolved
Hide resolved
...kend-ws/src/test/java/ch/ubique/notifyme/sdk/backend/ws/insertmanager/InsertManagerTest.java
Show resolved
Hide resolved
We can now apply arbitrary filters to a given list of UploadVenueInfo objects. All objects that aren't removed from the list by one of the filters are transformed into TraceKeys and inserted into the database. The InsertManager's main use will be validating /userupload requests
Filters an uploadVenueInfo object when endTime - startTime is outside of ]0,24] (in hours)
UploadVenueInfo objects whose endTimeStamp is (strictly) before the onset date are now dropped.
UploadVenueInfo objects whose intervals overlap are removed. NOTE: Currently no considerations are made w.r.t. rounding of visiting times, i.e. overlap as a result of rounding will result in the visit being filtered.
… 1h & added comments
d20578d
to
37671b8
Compare
37671b8
to
5e555bb
Compare
...nd-data/src/main/java/ch/ubique/notifyme/sdk/backend/data/JdbcNotifyMeDataServiceV3Impl.java
Show resolved
Hide resolved
...nd-data/src/main/java/ch/ubique/notifyme/sdk/backend/data/JdbcNotifyMeDataServiceV3Impl.java
Show resolved
Hide resolved
...h/ubique/notifyme/sdk/backend/ws/insertmanager/insertfilters/OverlappingIntervalsFilter.java
Show resolved
Hide resolved
...ava/ch/ubique/notifyme/sdk/backend/ws/insertmanager/insertfilters/FakeRequestFilterTest.java
Show resolved
Hide resolved
...-backend-ws/src/main/java/ch/ubique/notifyme/sdk/backend/ws/insertmanager/InsertManager.java
Show resolved
Hide resolved
...-backend-ws/src/main/java/ch/ubique/notifyme/sdk/backend/ws/insertmanager/InsertManager.java
Show resolved
Hide resolved
...h/ubique/notifyme/sdk/backend/ws/insertmanager/insertfilters/OverlappingIntervalsFilter.java
Show resolved
Hide resolved
* A person can't be in two places at the same time. UploadVenueInfo objects whose time windows | ||
* overlap are both removed. | ||
*/ | ||
public class OverlappingIntervalsFilter implements UploadInsertionFilter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wouterl is the idea to filter out overlapping events or reject the full request as soon as we have one overlap in there? I would say the second one, because the app should make sure it never sends overlaps, so a request will be malicious if there is an overlap in there and we should reject all of that request.
@@ -226,21 +226,30 @@ private ProblematicEvent mapTraceKeyToProblematicEvent(TraceKey t) { | |||
consumes = {"application/x-protobuf", "application/protobuf"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/notifyme-app/notifyme-sdk-backend/pull/12/files#diff-3831def3db4a6233be7fc0827a926221afb47b5e530e79a84b859067c8caa942R191 this request must be protected or removed for now, otherwise any traceKeys can be uploaded.
Implemented an
InsertManager
which applies a stored list of filters to a received list ofUploadVenueInfo
s and transforms any remainingUploadVenueInfo
's into trace keys. The trace keys are then stored in the database. TheInsertManager
is called from the /userupload endpoint inNotifyMeControllerV3
.The following filters have been implemented, tested, and added to the
InsertManager
:FakeRequestFilter
: To prevent the possibility of traffic analysis, fake requests are sent at semi-regular intervals. Fake uploads don't actually need to be inserted into the database and can therefore be dropped.IntervalThresholdFilter
: The app uploads VenueInfo objects that span at most 1 hour.UploadVenueInfo
objects that break the interval threshold of (0,1) are dropped.BeforeOnsetFilter
: When a person tests positive, the "onset" date since when they are infectious is estimated. Visits that occurred before the onset are dropped.OverlappingIntervalsFilter
: A person can't be in two places at the same time.UploadVenueInfo
objects whose time windows overlap are both removed.Finally, note that JWT validation of scope and audience in the /userupload endpoint has been re-enabled.