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

Add Configuration for S2S to exclude fields from sharing [3] #6875

Closed
Tracked by #10739
markusmann-vg opened this issue Oct 4, 2021 · 4 comments · Fixed by #6937
Closed
Tracked by #10739

Add Configuration for S2S to exclude fields from sharing [3] #6875

markusmann-vg opened this issue Oct 4, 2021 · 4 comments · Fixed by #6937
Assignees
Labels
backend Affects the web backend feature A new feature to be developed (ticket type) qa-verified Issue has been tested and verified by QA s2s Issues related to the SORMAS2SORMAS functionality

Comments

@markusmann-vg
Copy link

markusmann-vg commented Oct 4, 2021

Situation Description

With the current implementation Sormas 2 Sormas is also sending the External Token, the Internal ID, the general comment and the ExternalID. In corner cases this may result in either data protection issues or issues with the reporting system.

Feature Description

By default the sending (and receiving that values) of ExternalToken, ExternalID, generalComment, InternalID should be prevented.
With the config in sormas.properties (a config property for each mentioned field in all entities) you can decide which of the mentioned fields should be sent when using S2S and which won't.

Example with expected behavior:

  • A case is sent from SORMAS A with ownership to SORMAS B
  • SORMAS B accepts the case
  • SORMAS B edits the case
  • SORMAS B sends the case back to SORMAS A with ownership
  • SORMAS A should have the details from the case AND the old externalID, ExternalToken, InternalToken AND the generalComment from the past
  • SORMAS A does not get or see the externalID, ExternalToken, InternalToken NOR the generalComment from SORMAS B

Possible Alternatives

Additional Information

The fields should be excluded for all entities

@markusmann-vg markusmann-vg added the feature A new feature to be developed (ticket type) label Oct 4, 2021
@markusmann-vg markusmann-vg added this to the Sprint 108 - 1.64.1 milestone Oct 4, 2021
@markusmann-vg markusmann-vg added the s2s Issues related to the SORMAS2SORMAS functionality label Oct 4, 2021
@markusmann-vg markusmann-vg changed the title Add Configuration for S2S to exclude fields from sending Add Configuration for S2S to exclude fields from sharing Oct 5, 2021
@StefanKock StefanKock added backend Affects the web backend hotfix needs-refinement Refinement or further specification required labels Oct 6, 2021
@JonasCir
Copy link
Contributor

JonasCir commented Oct 6, 2021

Leaving the ongoing discussion aside, on a technical level we could use JSON patch to do this.

Json patch is an easy way to programmatically rewrite JSON objects.

So the query { "op": "remove", "path": "/c/b/c" } would drop the element if applied to a Json object.

We could simply provide a file with all the operations we want to see on outgoing entities. Find a java library here and the RFC

@StefanKock StefanKock changed the title Add Configuration for S2S to exclude fields from sharing Add Configuration for S2S to exclude fields from sharing [3] Oct 6, 2021
@vidi42 vidi42 removed the needs-refinement Refinement or further specification required label Oct 7, 2021
@vidi42 vidi42 self-assigned this Oct 7, 2021
vidi42 added a commit that referenced this issue Oct 11, 2021
@vidi42 vidi42 linked a pull request Oct 11, 2021 that will close this issue
vidi42 added a commit that referenced this issue Oct 11, 2021
vidi42 added a commit that referenced this issue Oct 13, 2021
vidi42 added a commit that referenced this issue Oct 13, 2021
* #6875 initial mechanism for ignoring properties when sending

* #6875 improve ignored field clearing before sharing for a case

* #6875 apply the S2SIgnoreProperty annotation more widely
+ code cleanup

* #6875 unit tests for handling ignored properties

* #6875 fix missing handling for associated contacts and event

* #6875 revert to https

* #6875 fix merge conflicts and apply change to immunizations

* #6875 revert to https
@vidi42 vidi42 closed this as completed Oct 13, 2021
@vidi42
Copy link
Contributor

vidi42 commented Oct 14, 2021

4 new properties were introduced in sormas.properties

# Control which values are ignored when shared / overwritten trough S2S
# This are applied to all entities shared trough S2S
# Default: true
# Possible Values: true, false
#sormas2sormas.ignoreProperty.additionalDetails=true
#sormas2sormas.ignoreProperty.externalId=true
#sormas2sormas.ignoreProperty.externalToken=true
#sormas2sormas.ignoreProperty.internalToken=true

By default they are commented and are internally set to true, so the externalId, externalToken, internalToken and additionalDetails fields are not transmitted for any of the following entities: Case, Contact, Event, EventParticipant, Immunization and Person). By uncommenting them and setting them to false it's the only way to allow the system to transmit/receive them.

LabMessage and Sample do not contain this fields.

If a system has the properties set to true or missing, this means that the system doesn't send the fields value when sharing and also does not accept them if they come from systems which are sharing those values and it retains the already existing values.

@roxanamlendea roxanamlendea self-assigned this Oct 19, 2021
@roxanamlendea
Copy link

Verified ticket on local environment using the latest version of Sormas 1.65.0-SNAPSHOT from the development branch and on the ignore_fields branch.

@roxanamlendea roxanamlendea added the qa-verified Issue has been tested and verified by QA label Oct 25, 2021
@vidi42
Copy link
Contributor

vidi42 commented Nov 3, 2021

More explanation about corner cases when configuring how external data is handled for different sormas instances can be found here #7014 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Affects the web backend feature A new feature to be developed (ticket type) qa-verified Issue has been tested and verified by QA s2s Issues related to the SORMAS2SORMAS functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants