mirror of https://github.com/status-im/consul.git
This is needed in order to access the agent token in some enterprise code.
This commit is contained in:
parent
2868a14451
commit
3609d903af
|
@ -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.
|
||||||
|
```
|
|
@ -12,6 +12,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"
|
||||||
|
@ -87,6 +88,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
|
||||||
|
@ -131,6 +135,7 @@ func NewClient(config *Config, options ...ConsulOption) (*Client, error) {
|
||||||
logger: logger,
|
logger: logger,
|
||||||
shutdownCh: make(chan struct{}),
|
shutdownCh: make(chan struct{}),
|
||||||
tlsConfigurator: tlsConfigurator,
|
tlsConfigurator: tlsConfigurator,
|
||||||
|
tokens: flat.tokens,
|
||||||
}
|
}
|
||||||
|
|
||||||
c.rpcLimiter.Store(rate.NewLimiter(config.RPCRate, config.RPCMaxBurst))
|
c.rpcLimiter.Store(rate.NewLimiter(config.RPCRate, config.RPCMaxBurst))
|
||||||
|
|
Loading…
Reference in New Issue