Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ACLsEnabled bool Logger hclog.Logger LoadAuthMethod func(authMethod string, entMeta *acl.EnterpriseMeta) (*structs.ACLAuthMethod, Validator, error) NewLogin func() Login ForwardRPC func(structs.RPCInfo, func(*grpc.ClientConn) error) (bool, error) ValidateEnterpriseRequest func(*acl.EnterpriseMeta, bool) error LocalTokensEnabled func() bool InPrimaryDatacenter bool PrimaryDatacenter string NewTokenWriter func() TokenWriter }
type Login ¶
type Login interface {
TokenForVerifiedIdentity(identity *authmethod.Identity, authMethod *structs.ACLAuthMethod, description string) (*structs.ACLToken, error)
}
type MockLogin ¶
MockLogin is an autogenerated mock type for the Login type
func NewMockLogin ¶
NewMockLogin creates a new instance of MockLogin. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockLogin) TokenForVerifiedIdentity ¶
func (_m *MockLogin) TokenForVerifiedIdentity(identity *authmethod.Identity, authMethod *structs.ACLAuthMethod, description string) (*structs.ACLToken, error)
TokenForVerifiedIdentity provides a mock function with given fields: identity, authMethod, description
type MockTokenWriter ¶
MockTokenWriter is an autogenerated mock type for the TokenWriter type
func NewMockTokenWriter ¶
func NewMockTokenWriter(t testing.TB) *MockTokenWriter
NewMockTokenWriter creates a new instance of MockTokenWriter. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
type MockValidator ¶
MockValidator is an autogenerated mock type for the Validator type
func NewMockValidator ¶
func NewMockValidator(t testing.TB) *MockValidator
NewMockValidator creates a new instance of MockValidator. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockValidator) ValidateLogin ¶
func (_m *MockValidator) ValidateLogin(ctx context.Context, loginToken string) (*authmethod.Identity, error)
ValidateLogin provides a mock function with given fields: ctx, loginToken
type Server ¶
type Server struct {
Config
}
func (*Server) Login ¶
func (s *Server) Login(ctx context.Context, req *pbacl.LoginRequest) (*pbacl.LoginResponse, error)
Login exchanges the presented bearer token for a Consul ACL token using a configured auth method.
func (*Server) Logout ¶
func (s *Server) Logout(ctx context.Context, req *pbacl.LogoutRequest) (*pbacl.LogoutResponse, error)
Logout destroys the given ACL token once the caller is done with it.