Draft: initial scaffolding for SDK encryption #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Needs to be completed before done:
[X] - basic scaffolding for encryption (Lance)
[] - encryption implementation (Marshall/Jesse/Andrew/etc.)
[] - e2e / integration test examples (Lance/Marshall/Jesse/Andrew/etc.)
(I don't really care too much about unit tests, but you can unit test the encryption function itself if you want)
To add the capability endpoints for a Service (which, IIRC, is just the
get_public_keyfunction), add it toIntersectSdkCoreCapability(https://github.com/INTERSECT-SDK/python-sdk/blob/candidate-0.9.0/src/intersect_sdk/capability/universal_capability/universal_capability.py), it should be annotated with@intersect_message. If we need additional state in the capability, we can modify the constructor for this capability and potentially the service as well.Then you can call the capability with
intersect_sdk.<YOUR_FUNCTION_NAME_HERE>as the operation from clients.The actual encrypt/decrypt functions I would prefer to be separated out into utility functions in another file somewhere under the
_internaldirectory, because both the Service and the Client will use them and users also have no reason to ever use this function themselves. I have marked the areas which need the inserted functions with#TODO comments, there should be one of each inclient.pyand two of each inservice.py.