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

Allow passing an object of parameters to the JS enrichment #871

Closed
stanch opened this issue Feb 9, 2024 · 0 comments
Closed

Allow passing an object of parameters to the JS enrichment #871

stanch opened this issue Feb 9, 2024 · 0 comments

Comments

@stanch
Copy link
Contributor

stanch commented Feb 9, 2024

In #868, we add support for multiple JavaScript enrichments. This allows to implement new enrichments in JavaScript and easily add them to Enrich. However, most enrichments take parameters. So as it stands, people using these new JavaScript enrichments would need to modify the script itself every time they need to change parameters. This is very inconvenient, and prevents us from (in the future) hosting the script separately. The solution is to allow passing these parameters in the enrichment configuration, so instead of

{
  ...
  "script": "....." // base64-encoded
  ...
}

we would have:

{
  ...
  "script": ".....", // base64-encoded
  "config": {
    // arbitrary JSON that the enrichment code can consume
  }
  ...
}

This will also help in case we need to deal with secrets inside JavaScript code. (Currently, secrets can’t be substituted because the script code is in base64.)

@spenes spenes closed this as completed in ac87750 Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant