Go consul client - does a client needs to be recreated when there's a new ACL token?


We are using the Go Consul client along with an ACL protected Consul (cluster).

Our token scheme is based on expirable ACL tokens, after a few hours we will get a new ACL token for our integrating systems.
Also, I should probably note that the (Go) client does not reside on the same machine as the consul agent.

It seems that many of the client functionalities are allowing passing a token with the api.QueryOptions struct, e.g.: when using the Health().Service() API (/v1/health/service/).

However, in the case of the Agent() API, it is missing for some endpoints, in particular we are interested in passing a token to the ForceLeave with Prune endpoint.

Does it make sense to open a PR/add support for this specific endpoints?

I have found a relatively recent (Mar 19, 2021) PR that adds a similar thing to another endpoint.