Skip to content

Create a "Default INTERSECT Capability" which handles universal INTERSECT functions (i.e. encryption/decryption) #29

@Lance-Drane

Description

@Lance-Drane

Use case

There has been talk of adding an encryption/decryption solution baked in to INTERSECT to allow for data to be encrypted or decrypted as it goes over the wire. We would like the Services to handle this encryption/decryption automatically (without any real knowledge from the SDK Capability writer). We also want to allow for Clients to be able to call these endpoints as necessary.

A universal Capability is the best approach to handle this specifically, and is also flexible enough to accommodate other use cases.

General principle

The universal Capability can also of course send out generic events as well; it is not restricted to @intersect_message endpoints.

Proposed implementation

We can have a class which looks something like this:

class GlobalIntersectCapability(IntersectBaseCapability):
  intersect_sdk_capability_name = 'intersect_sdk'
  
  # parameters can be injected through the Service
  def __init__(self, some_parameter: str):
    super().__init__()
    self.some_parameter = some_parameter  # if needed

  @intersect_message()
  def get_public_key() -> str:
    # .., implementation

Then, when we build the schema, we inject the GlobalIntersectCapability BEFORE we inject the user's capabilities. This is important! We want the global capability to consistently have the address space of intersect_sdk so clients can always say destination='intersect_sdk.<YOUR_FUNCTION_NAME_HERE>'.

Other notes

The Service can have some specialized logic which is able to feed in specific arguments to THIS capability as necessary.

Metadata

Metadata

Assignees

Labels

ready_for_releaseIssue has been completed, but the resolution has not been pushed out to a release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions