Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGRPCServer ¶
func NewGRPCServer(c Control) pb.ControlServer
NewGRPCServer creates a new grpc server instance for the rbac control
Types ¶
type AccountRoles ¶
type AccountRoles []RoleID
AccountRoles are the roles attached to a subject
func (AccountRoles) Contains ¶
func (r AccountRoles) Contains(roleID RoleID) bool
Contains checks whether a rule is available in the role rules
type Control ¶
type Control interface { GetRoleRules(ctx context.Context, roleID RoleID) (RoleRules, error) SetRoleRules(ctx context.Context, roleID RoleID, rules RoleRules) error GetAccountRoles(ctx context.Context, accountID AccountID) (AccountRoles, error) SetAccountRoles(ctx context.Context, accountID AccountID, roles AccountRoles) error IsAccountAllowed(ctx context.Context, accountID AccountID, rule Rule) (bool, error) }
Control of the rbac system
func NewGRPCClient ¶
func NewGRPCClient(c *grpc.ClientConn) Control
NewGRPCClient for the rbac controller
type Repository ¶
type Repository interface { // GetRoleRules fetches all available Rules from a role GetRoleRules(context.Context, RoleID) (RoleRules, error) // SetRoleRules sets the rules of a role SetRoleRules(context.Context, RoleID, RoleRules) error // GetAccountRoles returns the roles of a subject GetAccountRoles(context.Context, AccountID) (AccountRoles, error) // SetAccountRoles sets the roles of a subject SetAccountRoles(context.Context, AccountID, AccountRoles) error // GetAccountRuleCount returns the amount of occurrences of a given rule // for a given subject GetAccountRuleCount(context.Context, AccountID, Rule) (uint64, error) }
Repository for persistent RBAC storage
Source Files
¶
Click to show internal directories.
Click to hide internal directories.