Documentation
¶
Index ¶
- type Context
- type Role
- type RoleRef
- type RoleStore
- func (store *RoleStore) AddUserRole(userID, roleID string) error
- func (store *RoleStore) CreateRole(role Role) (string, error)
- func (store *RoleStore) GetRoleMembers(id string) ([]User, error)
- func (store *RoleStore) RemoveUserRole(userID, roleID string) error
- func (store *RoleStore) ResolveRoles(names []string) ([]RoleRef, error)
- func (store *RoleStore) Role(id string) (role *Role, err error)
- func (store *RoleStore) Roles() ([]Role, error)
- func (store *RoleStore) SearchUsers(keywords, source string) ([]User, error)
- func (store *RoleStore) User(id string) (user *User, err error)
- func (store *RoleStore) UserRoles(id string) ([]Role, error)
- type SourceRule
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
Enabled bool `json:"enabled"`
BlockRole bool `json:"block_role"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
Timezone string `json:"timezone"`
}
Context defines the context information for a role.
type Role ¶
type Role struct {
ID string `json:"id"`
Name string `json:"name"`
Explicit bool `json:"explicit" tabulate:"@userCtx"`
Implicit bool `json:"implicit" tabulate:"@userCtx"`
System bool `json:"system"`
GrantType string `json:"grant_type"`
Comment string `json:"comment"`
SourceRule SourceRule `json:"source_rules"`
Permissions []string `json:"permissions"`
Context *Context `json:"context"`
MemberCount int `json:"member_count"`
PublicKey []string `json:"principal_public_key_strings,omitempty"`
}
Role contains PrivX role information.
type RoleStore ¶
type RoleStore struct {
// contains filtered or unexported fields
}
RoleStore is a role-store client instance.
func (*RoleStore) AddUserRole ¶
AddUserRole adds the specified role for the user. If the user already has the role, this function does nothing.
func (*RoleStore) CreateRole ¶
CreateRole creates new role
func (*RoleStore) GetRoleMembers ¶
GetRoleMembers gets all members (users) of the argument role ID.
func (*RoleStore) RemoveUserRole ¶
RemoveUserRole removes the specified role from the user. If the user does not have the role, this function does nothing.
func (*RoleStore) ResolveRoles ¶
ResolveRoles searches give role name and returns corresponding ids
func (*RoleStore) SearchUsers ¶
SearchUsers searches for users, matching the keywords and source criteria.
type SourceRule ¶
type SourceRule struct {
Type string `json:"type"`
Match string `json:"match"`
Source string `json:"source,omitempty"`
Pattern string `json:"search_string,omitempty"`
Rules []SourceRule `json:"rules"`
}
SourceRule defines a mapping of role to object objects in directory
func SourceRuleNone ¶
func SourceRuleNone() SourceRule
SourceRuleNone creates an empty mapping source for the role
type User ¶
type User struct {
ID string `json:"id"`
SourceUserID string `json:"source_user_id"`
Tags []string `json:"tags"`
Principal string `json:"principal"`
Source string `json:"source"`
FullName string `json:"full_name"`
Email string `json:"email"`
DistinguishedName string `json:"distinguished_name"`
Roles []Role `json:"roles"`
}
User contains PrivX user information.