Consul: Go Api for Catalog does not support ACL tokens

Created on 30 Mar 2016  路  6Comments  路  Source: hashicorp/consul

The api/catalog.go Register function does not support acl tokens.
The CatalogRegistration struct should likely have a WriteRequest field.

typbug

All 6 comments

Hi @DDuTCH take a look at the WriteOptions parameter to Register() - you can use that to pass a token:

https://github.com/hashicorp/consul/blob/master/api/api.go#L63-L65

I did. But that doesn't work for the catalog. The rest Api documentation only mentions passing a write request object in there body, no parameter.

The write options object in Go gets translated to a URL parameter instead of Body.

There is either a bug in the Go api, or in the rest api endpoint.

Ah sorry about that. I'm thinking it is probably cleaner to teach the REST endpoint about the ?token= parameter to make it more inline with others than to add support for the WriteRequest on the API side.

This has been fixed in the register endpoint - https://github.com/hashicorp/consul/issues/1738.

Was this page helpful?
0 / 5 - 0 ratings