starlarky icon indicating copy to clipboard operation
starlarky copied to clipboard

Larky Third Party Applications

Open mjallday opened this issue 3 years ago • 1 comments

Proposing an interface for calling third party operations made available via the marketplace.

Assuming we provision an application that provides an operation for virus scanning we can invoke like this

Given an application defined like (see marketplace spec)

apiVersion: 1.0.0
kind: App
data:
  fqn: myCompany/virusScanner

and it has been provisioned onto a vault, it would become available to be invoked via larky like so:

# namespace/app-name/function-name
@loads('myCompany/virusScanner/scan')
def process(input, ctx):
    result = myCompany.virusScanner.scan(input, ctx)
    # do something with result
    if result.hasVirus:
       return abort(400, 'You have a virus')
    return input

Local development can be enabled by the app providing a basic mocked request/response that allows integrators to receive a static response without running a stand-alone server in their local environment.

We would need to publish a basic request/response somehow so that the api for the method call is available to the developer.

mjallday avatar Feb 19 '21 21:02 mjallday