Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Feature/verification #12

Open
wants to merge 19 commits into
base: feature/userupload
Choose a base branch
from
Open

Conversation

lmeinen
Copy link
Contributor

@lmeinen lmeinen commented May 12, 2021

Implemented an InsertManager which applies a stored list of filters to a received list of UploadVenueInfos and transforms any remaining UploadVenueInfo's into trace keys. The trace keys are then stored in the database. The InsertManager is called from the /userupload endpoint in NotifyMeControllerV3.

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.

@lmeinen lmeinen requested a review from martinalig May 12, 2021 14:10
@lmeinen lmeinen self-assigned this May 12, 2021
@martinalig
Copy link
Collaborator

Bitte packagename anpassen:
ch.ubique.notifyme.sdk.backend.ws.insert_manager -> ch.ubique.notifyme.sdk.backend.ws.insertmanager
ch.ubique.notifyme.sdk.backend.ws.insert_manager.insertion_filters -> ch.ubique.notifyme.sdk.backend.ws.insertmanager.insertionfilters

@lmeinen lmeinen requested a review from martinalig May 18, 2021 14:01
lmeinen and others added 18 commits May 21, 2021 06:56
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.
@martinalig martinalig force-pushed the feature/verification branch 3 times, most recently from d20578d to 37671b8 Compare May 21, 2021 05:13
* 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 {

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"})

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants