Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAuthenticationMissing = &hz.Error{ Status: http.StatusBadRequest, Message: "missing authentication header", } ErrInvalidCredentials = &hz.Error{ Status: http.StatusUnauthorized, Message: "invalid credentials", } ErrForbidden = &hz.Error{ Status: http.StatusForbidden, Message: "forbidden", } )
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type CheckRequest ¶
type CheckRequest struct { Session string Verb Verb Object hz.ObjectKeyer }
type Group ¶
type Group struct { Name string Namespaces map[string]*Permissions }
type ListRequest ¶
type ListRequest struct { Session string ObjectList *hz.ObjectList }
Verb is implied (read).
type Permissions ¶
type RBAC ¶
type RBAC struct { Conn *nats.Conn // TODO: RoleBindings and Roles maps are not thread safe. // E.g. HandleRoleEvent and refresh both write and read from Roles. RoleBindings map[string]RoleBinding `json:"roleBindings,omitempty"` Roles map[string]Role `json:"roles,omitempty"` Permissions map[string]*Group `json:"permissions,omitempty"` AdminGroups []string `json:"adminGroups,omitempty"` // contains filtered or unexported fields }
func (*RBAC) HandleRoleBindingEvent ¶
type RBACRequest ¶
type RBACRequest struct { Groups []string Verb Verb Object hz.ObjectKeyer }
type Role ¶
type Role struct { hz.ObjectMeta `json:"metadata,omitempty"` Spec RoleSpec `json:"spec,omitempty" cue:""` }
func (Role) ObjectGroup ¶
func (Role) ObjectKind ¶
func (Role) ObjectVersion ¶
type RoleBinding ¶
type RoleBinding struct { hz.ObjectMeta `json:"metadata,omitempty"` Spec RoleBindingSpec `json:"spec,omitempty" cue:""` }
func (RoleBinding) ObjectGroup ¶
func (RoleBinding) ObjectGroup() string
func (RoleBinding) ObjectKind ¶
func (RoleBinding) ObjectKind() string
func (RoleBinding) ObjectVersion ¶
func (RoleBinding) ObjectVersion() string
type RoleBindingSpec ¶
type Sessions ¶
type Sessions struct { Conn *nats.Conn // contains filtered or unexported fields }
type Verb ¶
type Verb string
const ( // VerbRead is the lowest level of allow access. // VerbRead is the highest level of deny access. // If you are denied read access, you are denied all levels of access. VerbRead Verb = "read" // VerbUpdate allows a user to update objects. // It implies VerbRead. VerbUpdate Verb = "update" // VerbCreate allows a user to create objects. // It implies VerbRead. VerbCreate Verb = "create" // VerbDelete allows a user to delete objects. // It implies VerbRead. VerbDelete Verb = "delete" // VerbRun allows a user to run actions for an actor. VerbRun Verb = "run" )
type VerbFilter ¶
type Verbs ¶
type Verbs struct { Read *VerbFilter `json:"read,omitempty"` Update *VerbFilter `json:"update,omitempty"` Create *VerbFilter `json:"create,omitempty"` Delete *VerbFilter `json:"delete,omitempty"` Run *VerbFilter `json:"run,omitempty"` }
Click to show internal directories.
Click to hide internal directories.