JS layer for sentry-cli should allow passing multiple headers
At the moment, JS layer above sentry-cli allow passing at most one header, as follow
import Sentry from '@sentry/cli'
const cli = new Sentry(undefined, {
// Note the singular for custom header. there is only one
customHeader: 'Authorization: Bearer deadbeef',
})
console.log(await cli.info('my-release'))
The above configuration makes sentry-cli use the custom header by setting CUSTOM_HEADER environment variable when invoking sentry-cli.
sentry-cli supports passing multiple headers via --header key:value. There are situation for which setting multiple headers is good, and limiting sentry-cli JS layer makes it less useful.
At the moment, I understand passing multiple headers has to be done as follow
import Sentry from '@sentry/cli'
const cli = new Sentry(undefined, {
// Nothing here
})
console.log(await cli.execute('--header', 'key1:value1', '--header', 'key2:value2', 'info', 'my-release'))
I suggest JS layer to define the below interface
import Sentry from '@sentry/cli'
const cli = new Sentry(undefined, {
// headers is a Record<string, string>
headers: {
'Authorization': 'Bearer deadbeef',
},
})
console.log(await cli.info('my-release'))
This relates to #1142 which is about adding support for multiple headers to the CLI tool.
Thanks @kamilogorek for the review and the merge.
Are there information about the release process available? I'd be interested to know when this change would land in the upstream npm package.
Will update it early next week, as there are a few things remaining to tackle before that. Will keep you posted.
@thibmeu 2.8.0 is out.
Thanks @kamilogorek. That's was super fast!