tcplugins/tcWebHooks

Support for more flexibility in Authorization headers

Snipx opened this issue · 5 comments

Snipx commented

Hi and thank you for your nice plugin!
I was trying to integrate it with Opsgenie (https://www.atlassian.com/software/opsgenie) but faced the following issue: Opsgenie requires Authorization header in a bit non-standard format: Authorization: GenieKey xxxxx-.....-yyyyyy. So it's almost same as Bearer token except that there is a different keyword. Would it be possible to provide a bit more flexibility in the configuration of the authenitcation so that I can specify a custom header and its value? Or at least full custom value of Authorization header.
P.S. Opsgenie API for reference: https://docs.opsgenie.com/docs/alert-api

Thanks!

Hi @Snipx

You should be able to do what you need by using a custom header. It currently requires you to modify the plugin-settings.xml. You can do that on the server disk and TeamCity will reload it, or you can modify the file in Administration -> Diagnostics -> Data Directory.

image

BTW, I am in the middle of huge refactor to support editing of filters, headers and properties from the UI. It's just taking longer than I hoped since Javascript is not my strong suite. :-)

Snipx commented

Thank you very much for the feedback @netwolfuk, I've been able to make it work using your suggestion.
While configuring it I also noticed that Opsgenie allowed Basic authentication with empty username (see https://docs.opsgenie.com/docs/authentication) and password equal to API key which is not possible in the current UI as well (username is mandatory and empty values are not accepted), so could be another use case to keep in mind.

Anyway, thanks for your help!

Hi @Snipx. I'm glad you got it working.

That's interesting about the use of Basic Auth without a username. Atlassian love to invent their own "standards".

It might be possible to use a variable that resolves to an empty string.

Eg. Create a webhook or TeamCity parameter called something like empty_username and then refer to ${empty_username} in the Basic Auth dialog when editing the webhook.

Snipx commented

Thanks a lot for the follow up!