Documentation ¶
Index ¶
- func NewIdentitiesClient(logger hclog.Logger, tokenDeriver TokenDeriverFunc) *identitiesClient
- type MockServiceIdentitiesClient
- func (mtc *MockServiceIdentitiesClient) DeriveSITokens(alloc *structs.Allocation, tasks []string) (map[string]string, error)
- func (mtc *MockServiceIdentitiesClient) DeriveTokenErrors() map[string]map[string]error
- func (mtc *MockServiceIdentitiesClient) SetDeriveTokenError(allocID string, tasks []string, err error)
- type ServiceIdentityAPI
- type SupportedProxiesAPI
- type TokenDeriverFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIdentitiesClient ¶
func NewIdentitiesClient(logger hclog.Logger, tokenDeriver TokenDeriverFunc) *identitiesClient
Types ¶
type MockServiceIdentitiesClient ¶
type MockServiceIdentitiesClient struct { // DeriveTokenFn allows the caller to control the DeriveToken function. If // not set an error is returned if found in DeriveTokenErrors and otherwise // a token is generated and returned DeriveTokenFn TokenDeriverFunc // contains filtered or unexported fields }
MockServiceIdentitiesClient is used for testing the client for managing consul service identity tokens.
func NewMockServiceIdentitiesClient ¶
func NewMockServiceIdentitiesClient() *MockServiceIdentitiesClient
NewMockServiceIdentitiesClient returns a MockServiceIdentitiesClient for testing.
func (*MockServiceIdentitiesClient) DeriveSITokens ¶
func (mtc *MockServiceIdentitiesClient) DeriveSITokens(alloc *structs.Allocation, tasks []string) (map[string]string, error)
func (*MockServiceIdentitiesClient) DeriveTokenErrors ¶
func (mtc *MockServiceIdentitiesClient) DeriveTokenErrors() map[string]map[string]error
func (*MockServiceIdentitiesClient) SetDeriveTokenError ¶
func (mtc *MockServiceIdentitiesClient) SetDeriveTokenError(allocID string, tasks []string, err error)
type ServiceIdentityAPI ¶
type ServiceIdentityAPI interface { // DeriveSITokens contacts the nomad server and requests consul service // identity tokens be generated for tasks in the allocation. DeriveSITokens(alloc *structs.Allocation, tasks []string) (map[string]string, error) }
ServiceIdentityAPI is the interface the Nomad Client uses to request Consul Service Identity tokens through Nomad Server.
ACL requirements - acl:write (used by Server only)
type SupportedProxiesAPI ¶
SupportedProxiesAPI is the interface the Nomad Client uses to request from Consul the set of supported proxied to use for Consul Connect.
No ACL requirements
type TokenDeriverFunc ¶
TokenDeriverFunc takes an allocation and a set of tasks and derives a service identity token for each. Requests go through nomad server.