mirror of https://github.com/status-im/consul.git
Merge pull request #10175 from hashicorp/dnephin/backport-9683
[1.8.x] local: use agent token to deregister services
This commit is contained in:
commit
a632542e52
|
@ -0,0 +1,3 @@
|
|||
```release-notes:improvement
|
||||
client: when a client agent is attempting to dereigster a service, anddoes not have access to the ACL token used to register a service, attempt to use the agent token instead of the default user token. If no agent token is set, fall back to the default user token.
|
||||
```
|
|
@ -215,7 +215,7 @@ func (l *State) serviceToken(id structs.ServiceID) string {
|
|||
token = s.Token
|
||||
}
|
||||
if token == "" {
|
||||
token = l.tokens.UserToken()
|
||||
token = l.tokens.AgentToken()
|
||||
}
|
||||
return token
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ func (l *State) checkToken(id structs.CheckID) string {
|
|||
token = c.Token
|
||||
}
|
||||
if token == "" {
|
||||
token = l.tokens.UserToken()
|
||||
token = l.tokens.AgentToken()
|
||||
}
|
||||
return token
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue