sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Add support for calculating configs from ENV and defaulting values

Open aiwilliams opened this issue 3 years ago • 1 comments

The integration instance.config contains properties with values loaded from the ENV when executed locally. In JupiterOne, the user configures the integration in a UI and the values are saved in a DB. In both cases, a property may not be provided, have formatting problems, or be otherwise invalid. In some cases, there should be default values for a property, and in other cases, the integration needs to calculate configuration values for the steps.

  • [ ] Provide a callback to calculate the configuration that will be provided to steps. It's an anti-pattern to have the validateInvocation code mutate the config.
  • [ ] Update the integration-template to wire in the callback, and show how types can be defined to distinguish between what properties are loaded from ENV/known to the J1 UI (the config fields), and what are the calculated config provided to the steps.
  • [ ] Add helper functions for coercing ENV values and otherwise calculating properties.
  • [ ] Consider how to extend the config fields capability to auto-coerce known fields.

Check out the Qualys calculateConfig.ts code for examples/inspiration.

aiwilliams avatar Jun 17 '21 20:06 aiwilliams