Documentation ¶
Overview ¶
Package acl provides all functionality within arrebato regarding access-control lists. This includes both gRPC, raft and data store interactions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidACL = errors.New("invalid ACL")
ErrInvalidACL is the error given when an ACL is invalid.
var ErrNoACL = errors.New("no acl")
ErrNoACL is the error given when querying the server's ACL before one has been initially created.
Functions ¶
Types ¶
type BoltStore ¶
type BoltStore struct {
// contains filtered or unexported fields
}
The BoltStore type is responsible for querying/mutating ACL data within a boltdb database.
func NewBoltStore ¶
NewBoltStore returns a new instance of the BoltStore type that will manage/query ACL data in a boltdb database.
func (*BoltStore) Allowed ¶
func (bs *BoltStore) Allowed(ctx context.Context, topic, client string, permission acl.Permission) (bool, error)
Allowed returns a boolean value indicating if the client has the given permission on a topic. This method returns true in scenarios where an ACL has yet to be created.
type GRPC ¶
type GRPC struct {
// contains filtered or unexported fields
}
The GRPC type is an aclsvc.ACLServiceServer implementation that handles inbound gRPC requests to manage and query the server ACL.
func NewGRPC ¶
NewGRPC returns a new instance of the GRPC type that will modify ACL data via commands sent to the Executor and query ACL data via the Getter implementation.
func (*GRPC) Get ¶
func (svr *GRPC) Get(ctx context.Context, _ *aclsvc.GetRequest) (*aclsvc.GetResponse, error)
Get the server's current ACL state.
func (*GRPC) Register ¶
func (svr *GRPC) Register(registrar grpc.ServiceRegistrar, health *health.Server)
Register the GRPC service onto the grpc.ServiceRegistrar.
func (*GRPC) Set ¶
func (svr *GRPC) Set(ctx context.Context, request *aclsvc.SetRequest) (*aclsvc.SetResponse, error)
Set the server's new ACL state.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
The Handler type is responsible for handling commands sent to the server regarding ACL state.
func NewHandler ¶
NewHandler returns a new instance of the Handler type that will handle inbound commands regarding ACLs.