Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionArgs ¶
type ActionArgs struct { Namespace string Service string Method string Path string Properties []string }
ActionArgs contains information about the detail of a request.
type ConfigStore ¶
type ConfigStore struct { // All the Roles organized per namespace. Roles RolesMapByNamespace }
ConfigStore contains all ServiceRole and ServiceRoleBinding information. ConfigStore implements authorizer interface.
func (*ConfigStore) CheckPermission ¶
func (rs *ConfigStore) CheckPermission(subject SubjectArgs, action ActionArgs) (bool, error)
CheckPermission checks permission for a given subject and action. TODO(yangminzhu): Refactor and support checking RbacConfig.
type RoleInfo ¶
type RoleInfo struct { // ServiceRole proto definition Info *rbacproto.ServiceRole // A set of ServiceRoleBindings that refer to this role. Bindings map[string]*rbacproto.ServiceRoleBinding }
RoleInfo contains information about a ServiceRole and associated ServiceRoleBindings.
type RolesMapByNamespace ¶
type RolesMapByNamespace map[string]RolesByName
RolesMapByNamespace maps namespace to a set of Roles in the namespace
func (*RolesMapByNamespace) AddServiceRole ¶
func (rs *RolesMapByNamespace) AddServiceRole(name, namespace string, proto *rbacproto.ServiceRole) error
AddServiceRole adds a new ServiceRole to RolesMapByNamespace with the specified name and namespace. Return nil if added successfully, otherwise return an error.
func (*RolesMapByNamespace) AddServiceRoleBinding ¶
func (rs *RolesMapByNamespace) AddServiceRoleBinding(name, namespace string, proto *rbacproto.ServiceRoleBinding) error
AddServiceRoleBinding adds a new ServiceRoleBinding to RolesMapByNamespace with the specified name and namespace. Return nil if added successfully, otherwise return an error.
type SubjectArgs ¶
SubjectArgs contains information about the subject of a request.