mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 13:26:07 +00:00
Hold onto the token store from the base deps in the Client (#10432)
This is needed in order to access the agent token in some enterprise code.
This commit is contained in:
parent
796ebbe5f5
commit
94e4ef0c17
3
.changelog/10432.txt
Normal file
3
.changelog/10432.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
```release-note:bug
|
||||||
|
license: **(Enterprise only)** Fixed an issue that would cause client agents on versions before 1.10 to not be able to retrieve the license from a 1.10+ server.
|
||||||
|
```
|
@ -13,6 +13,7 @@ import (
|
|||||||
"github.com/hashicorp/consul/agent/pool"
|
"github.com/hashicorp/consul/agent/pool"
|
||||||
"github.com/hashicorp/consul/agent/router"
|
"github.com/hashicorp/consul/agent/router"
|
||||||
"github.com/hashicorp/consul/agent/structs"
|
"github.com/hashicorp/consul/agent/structs"
|
||||||
|
"github.com/hashicorp/consul/agent/token"
|
||||||
"github.com/hashicorp/consul/lib"
|
"github.com/hashicorp/consul/lib"
|
||||||
"github.com/hashicorp/consul/logging"
|
"github.com/hashicorp/consul/logging"
|
||||||
"github.com/hashicorp/consul/tlsutil"
|
"github.com/hashicorp/consul/tlsutil"
|
||||||
@ -90,6 +91,9 @@ type Client struct {
|
|||||||
EnterpriseClient
|
EnterpriseClient
|
||||||
|
|
||||||
tlsConfigurator *tlsutil.Configurator
|
tlsConfigurator *tlsutil.Configurator
|
||||||
|
|
||||||
|
// tokens is the agent wide token store
|
||||||
|
tokens *token.Store
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewClient creates and returns a Client
|
// NewClient creates and returns a Client
|
||||||
@ -111,6 +115,7 @@ func NewClient(config *Config, deps Deps) (*Client, error) {
|
|||||||
logger: deps.Logger.NamedIntercept(logging.ConsulClient),
|
logger: deps.Logger.NamedIntercept(logging.ConsulClient),
|
||||||
shutdownCh: make(chan struct{}),
|
shutdownCh: make(chan struct{}),
|
||||||
tlsConfigurator: deps.TLSConfigurator,
|
tlsConfigurator: deps.TLSConfigurator,
|
||||||
|
tokens: deps.Tokens,
|
||||||
}
|
}
|
||||||
|
|
||||||
c.rpcLimiter.Store(rate.NewLimiter(config.RPCRate, config.RPCMaxBurst))
|
c.rpcLimiter.Store(rate.NewLimiter(config.RPCRate, config.RPCMaxBurst))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user