canvas-medical / canvas-plugins

1 stars 0 forks source link

Load plugin secrets if present #39

Closed aduane closed 4 months ago

aduane commented 5 months ago

https://canvasmedical.atlassian.net/browse/KOALA-1333

Looks for a SECRETS.json in a plugin's root directory and loads it if present. Protocols will be initialized with the secrets dict, so they can be accessed in protocol code. Example:

class MyCoolProtocol(BaseProtocol):
    def compute(event: Event):
        http.post(self.secrets['BASE_URL'])
        return [Effect(...)]

Oh and I also deleted all the plugins in custom-plugins/. We don't want those to accidentally end up installed somewhere.

beaugunderson commented 5 months ago

can you move one of the custom plugins to a different directory? super useful for testing the installation stuff, and would be useful for unit tests

aduane commented 4 months ago

@beaugunderson done