Skip to content

ConsulClient.agentServiceDeregister requires X-Consul-Token header #970

@wombleabroad

Description

@wombleabroad

In spring-cloud-consul-core 5.0.0, most ConsulClient methods mark the X-Consul-Token request header as not required. However, the agentServiceDeregister method does not:

@PutExchange("/v1/agent/service/deregister/{serviceId}")
	ResponseEntity<Void> agentServiceDeregister(@PathVariable String serviceId,
			@RequestHeader(name = ACL_TOKEN_HEADER) String aclToken);

This is not a problem in our server environments, where ACL tokens are always used to interact with the Consul HTTP API. However, it is an inconvenience when running locally without ACL tokens: deregistration of services fails with an exception.

Is there a reason this particular method requires the ACL Token? If not, could it be marked optional in a future release?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions