Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for calculating configs from ENV and defaulting values #488

Open
4 tasks
aiwilliams opened this issue Jun 17, 2021 · 1 comment
Open
4 tasks
Labels
enhancement New feature or request

Comments

@aiwilliams
Copy link
Contributor

aiwilliams commented Jun 17, 2021

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
Copy link
Contributor Author

Consider these type names:

  • IntegrationConfig to reflect the fields that users provide
  • RuntimeIntegrationConfig to reflect the result of generating/calculating values

Consider these callback names:

  • buildRuntimeConfig
  • calculateRuntimeConfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant