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

feat: add webhook env var decoder #1515

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

lfleischmann
Copy link
Member

@lfleischmann lfleischmann commented Jul 12, 2024

Description

The webhook.hooks config option is an array of objects. When using environment variables, specifying the hooks such that the envconfig package can correctly map the values into the config struct does not seem to be possible with the built-in capabilities.

Implementation

envconfig allows defining custom decoders, though. This PR introduces an implementation so that hooks can be defined via environment variables as follows:

WEBHOOKS_HOOKS={"callback":"http://app.com/usercb","events":["user"]};{"callback":"http://app.com/emailcb","events":["email.send"]}

@lfleischmann lfleischmann marked this pull request as ready for review July 12, 2024 12:05
Copy link
Contributor

@bjoern-m bjoern-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lfleischmann lfleischmann merged commit a0aaf53 into main Jul 12, 2024
12 checks passed
@lfleischmann lfleischmann deleted the feat-webhook-env-vars-decoder branch July 12, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants