Skip to content

Commit b8756b5

Browse files
authored
Fixes #970 (#972)
The `agentServiceDeregister` and `agentServiceSetMaintenance` operations within `ConsulClient` both required a Consul ACL token passed via the X-Consul-Token request header. This header is now optional for these two operations, consistent with all other token-based operations within this interface. Signed-off-by: Gareth Davies <womble.abroad@gmail.com>
1 parent 5571c5a commit b8756b5

File tree

1 file changed

+2
-2
lines changed
  • spring-cloud-consul-core/src/main/java/org/springframework/cloud/consul

1 file changed

+2
-2
lines changed

spring-cloud-consul-core/src/main/java/org/springframework/cloud/consul/ConsulClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ ResponseEntity<Void> agentCheckWarn(@PathVariable String checkId, @RequestParam(
8080

8181
@PutExchange("/v1/agent/service/deregister/{serviceId}")
8282
ResponseEntity<Void> agentServiceDeregister(@PathVariable String serviceId,
83-
@RequestHeader(name = ACL_TOKEN_HEADER) String aclToken);
83+
@RequestHeader(name = ACL_TOKEN_HEADER, required = false) String aclToken);
8484

8585
@PutExchange("/v1/agent/service/register")
8686
ResponseEntity<Void> agentServiceRegister(@RequestHeader(name = ACL_TOKEN_HEADER, required = false) String aclToken,
@@ -89,7 +89,7 @@ ResponseEntity<Void> agentServiceRegister(@RequestHeader(name = ACL_TOKEN_HEADER
8989
@PutExchange("/v1/agent/service/maintenance/{serviceId}")
9090
ResponseEntity<Void> agentServiceSetMaintenance(@PathVariable String serviceId,
9191
@RequestParam(required = false) Boolean enable, @RequestParam(required = false) String reason,
92-
@RequestHeader(name = ACL_TOKEN_HEADER) String aclToken);
92+
@RequestHeader(name = ACL_TOKEN_HEADER, required = false) String aclToken);
9393

9494
@GetExchange("/v1/catalog/service/{serviceId}")
9595
ResponseEntity<List<CatalogService>> getCatalogService(@PathVariable String serviceId);

0 commit comments

Comments
 (0)