-
Notifications
You must be signed in to change notification settings - Fork 490
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 headers to the POST notifications #117
Comments
Something like this:
This creates a new problem in that you probably don't want to expose the auth in plain text in the TICKscript. As a result we probably need a method for grabbing values from the config or environment: Maybe?
with corresponding config:
Or env based without config:
Follow up question: Would being able to set header as static strings (independent of whether they are directly in the TICKscript, or come from config/env) be enough flexibility to do what you need? Or would you need to be able to specify the header value as a function of the data? |
I personally prefer the ENV option since it's allow me to work closely with Vault, and grab the secrets from there directly to the ENV var of the system. |
Is this already implemented? |
@fcastello nope |
Lets support both the env and config options. |
After discussion, the option that we've decided on going with the following
Which requires the configuration [[post]]
endpoint = "example"
url = "http://example.com"
headers = { Authorization = "...", others = "..." } This way values may be set through the configuration file, environment variables (via the config), and the API. |
@panda87 @fcastello We just recently implemented this feature. It would be great if you could give it a try. We've added a section to the configuration file like so
Then to use it in a tickscript you simply
You can also set headers that are not the authorization header directly in tickscript
|
It would be great if we will be able to add headers to the POST alert handler call, since we can add auth and other tokens to the request and make it more generic for many 3rd party services.
Thanks
D.
The text was updated successfully, but these errors were encountered: