monstache
monstache copied to clipboard
Elastic APIKey authentication
Hi, I have a team that would like to connect to Elastic using Monstache. As the administrator I do not have PKI enabled on the cluster and we use API Keys instead. Is there a reason that Monstache does not support API Key authentication?
My team would be willing to help add the option if it sounds like a good idea.
Hi @dwalker-va if your team could submit a PR I'd be happy to review and merge it.
I think it would just be a matter of a new config option with support for env var to pass in the key. And then if that is set, wrap the transport to set the Authorization
header.
👍 API key support would be great, I know internally we've been talking about moving in that direction.
Hi! First of all, thanks for creating this software. I'm trying to connect using the latest version of monstache built from 905547a and my API key but monstache fails, reporting
Unable to create Elasticsearch client: elastic: Error 401 (Unauthorized)
The -verbose
option does not give further details.
I tested my API key using
curl -X GET -H "Authorization: ApiKey xxxxxxxxxxxxxxxxxxxxxxxx" https://MY_ELASTIC_SEARCH_URL
which correctly reports
{
"name" : "node-2",
"cluster_name" : "MY_CLUSTER_NAME",
[...]
"tagline" : "You Know, for Search"
}
Can I help resolving this issue? I have never used Go but I'd like to help.
Yeah, any help would be really appreciated. Let me know if you need any help getting started.
After installing go you should just be able to run monstache with go run monstache.go -f myconfig.toml
.
@andreadistefano I did notice and correct one issue with reading the api key from the toml config file. Please let me know if that helps.
Sorry for not getting back to you over the weekend, I can confirm that on commit 936590a the authentication works correctly for me.
Thank you so much!