Today, credentials that need a transformation must be prepared and saved before running a request:
AUTH="Basic $(printf '%s' "$API_USERNAME:$API_PASSWORD" | base64)"
hit ephenv set AUTHORIZATION "$AUTH"
hit run users list
This adds a setup step and can leave stale credentials behind when the shell environment changes.
Could hit include process environment variables in the Handlebars context and provide a few safe built-in helpers?
{
"headers": {
"Authorization": "{{{basicAuth API_USERNAME API_PASSWORD}}}",
"X-Api-Key": "{{{API_KEY}}}"
}
}
Other useful helpers might include:
{{{base64 VALUE}}}
{{{urlEncode VALUE}}}
I think this should be limited to explicit helpers rather than allowing arbitrary shell execution. Helper output should also be unescaped so valid header characters are preserved.
Today, credentials that need a transformation must be prepared and saved before running a request:
This adds a setup step and can leave stale credentials behind when the shell environment changes.
Could hit include process environment variables in the Handlebars context and provide a few safe built-in helpers?
{ "headers": { "Authorization": "{{{basicAuth API_USERNAME API_PASSWORD}}}", "X-Api-Key": "{{{API_KEY}}}" } }Other useful helpers might include:
I think this should be limited to explicit helpers rather than allowing arbitrary shell execution. Helper output should also be unescaped so valid header characters are preserved.