Documentation ¶
Index ¶
- Variables
- func ValidateKey(key string) error
- type AddGroupToRolesOptions
- type AddGroupToUsersOptions
- type AddRoleToGroupsOptions
- type AddRoleToUsersOptions
- type AddUserToGroupsOptions
- type AddUserToRolesOptions
- type Commands
- func (c *Commands) AddGroupToRoles(ctx context.Context, options *AddGroupToRolesOptions) (*model.Group, error)
- func (c *Commands) AddGroupToUsers(ctx context.Context, options *AddGroupToUsersOptions) (*model.Group, error)
- func (c *Commands) AddRoleToGroups(ctx context.Context, options *AddRoleToGroupsOptions) (*model.Role, error)
- func (c *Commands) AddRoleToUsers(ctx context.Context, options *AddRoleToUsersOptions) (*model.Role, error)
- func (c *Commands) AddUserToGroups(ctx context.Context, options *AddUserToGroupsOptions) error
- func (c *Commands) AddUserToRoles(ctx context.Context, options *AddUserToRolesOptions) error
- func (c *Commands) CreateGroup(ctx context.Context, options *NewGroupOptions) (*model.Group, error)
- func (c *Commands) CreateRole(ctx context.Context, options *NewRoleOptions) (*model.Role, error)
- func (c *Commands) DeleteGroup(ctx context.Context, id string) error
- func (c *Commands) DeleteRole(ctx context.Context, id string) error
- func (c *Commands) DeleteUserGroup(ctx context.Context, userID string) error
- func (c *Commands) DeleteUserRole(ctx context.Context, userID string) error
- func (c *Commands) RemoveGroupFromRoles(ctx context.Context, options *RemoveGroupFromRolesOptions) (*model.Group, error)
- func (c *Commands) RemoveGroupFromUsers(ctx context.Context, options *RemoveGroupFromUsersOptions) (*model.Group, error)
- func (c *Commands) RemoveRoleFromGroups(ctx context.Context, options *RemoveRoleFromGroupsOptions) (*model.Role, error)
- func (c *Commands) RemoveRoleFromUsers(ctx context.Context, options *RemoveRoleFromUsersOptions) (*model.Role, error)
- func (c *Commands) RemoveUserFromGroups(ctx context.Context, options *RemoveUserFromGroupsOptions) error
- func (c *Commands) RemoveUserFromRoles(ctx context.Context, options *RemoveUserFromRolesOptions) error
- func (c *Commands) ResetUserGroup(ctx context.Context, options *ResetUserGroupOptions) error
- func (c *Commands) ResetUserRole(ctx context.Context, options *ResetUserRoleOptions) error
- func (c *Commands) UpdateGroup(ctx context.Context, options *UpdateGroupOptions) (*model.Group, error)
- func (c *Commands) UpdateRole(ctx context.Context, options *UpdateRoleOptions) (*model.Role, error)
- type Group
- type ListGroupsOptions
- type ListRolesOptions
- type NewGroupOptions
- type NewRoleOptions
- type Queries
- func (q *Queries) CountGroups(ctx context.Context) (uint64, error)
- func (q *Queries) CountRoles(ctx context.Context) (uint64, error)
- func (q *Queries) GetGroup(ctx context.Context, id string) (*model.Group, error)
- func (q *Queries) GetManyGroups(ctx context.Context, ids []string) ([]*model.Group, error)
- func (q *Queries) GetManyRoles(ctx context.Context, ids []string) ([]*model.Role, error)
- func (q *Queries) GetRole(ctx context.Context, id string) (*model.Role, error)
- func (f *Queries) ListAllGroupsByKeys(ctx context.Context, keys []string) ([]*model.Group, error)
- func (f *Queries) ListAllRolesByKeys(ctx context.Context, keys []string) ([]*model.Role, error)
- func (q *Queries) ListAllUserIDsByEffectiveRoleIDs(ctx context.Context, roleIDs []string) ([]string, error)
- func (q *Queries) ListAllUserIDsByGroupIDs(ctx context.Context, groupIDs []string) ([]string, error)
- func (q *Queries) ListAllUserIDsByGroupKeys(ctx context.Context, groupKeys []string) ([]string, error)
- func (q *Queries) ListAllUserIDsByRoleIDs(ctx context.Context, roleIDs []string) ([]string, error)
- func (q *Queries) ListEffectiveRolesByUserID(ctx context.Context, userID string) ([]*model.Role, error)
- func (q *Queries) ListGroups(ctx context.Context, options *ListGroupsOptions, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
- func (q *Queries) ListGroupsByRoleID(ctx context.Context, roleID string) ([]*model.Group, error)
- func (q *Queries) ListGroupsByUserID(ctx context.Context, userID string) ([]*model.Group, error)
- func (q *Queries) ListGroupsByUserIDs(ctx context.Context, userIDs []string) (map[string][]*model.Group, error)
- func (q *Queries) ListRoles(ctx context.Context, options *ListRolesOptions, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
- func (q *Queries) ListRolesByGroupID(ctx context.Context, groupID string) ([]*model.Role, error)
- func (q *Queries) ListRolesByUserID(ctx context.Context, userID string) ([]*model.Role, error)
- func (q *Queries) ListRolesByUserIDs(ctx context.Context, userIDs []string) (map[string][]*model.Role, error)
- func (q *Queries) ListUserIDsByGroupID(ctx context.Context, groupID string, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
- func (q *Queries) ListUserIDsByRoleID(ctx context.Context, roleID string, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
- type RemoveGroupFromRolesOptions
- type RemoveGroupFromUsersOptions
- type RemoveRoleFromGroupsOptions
- type RemoveRoleFromUsersOptions
- type RemoveUserFromGroupsOptions
- type RemoveUserFromRolesOptions
- type ResetUserGroupOptions
- type ResetUserRoleOptions
- type Role
- type Store
- func (s *Store) AddGroupToRoles(ctx context.Context, options *AddGroupToRolesOptions) (*Group, error)
- func (s *Store) AddGroupToUsers(ctx context.Context, options *AddGroupToUsersOptions) (*Group, error)
- func (s *Store) AddRoleToGroups(ctx context.Context, options *AddRoleToGroupsOptions) (*Role, error)
- func (s *Store) AddRoleToUsers(ctx context.Context, options *AddRoleToUsersOptions) (*Role, error)
- func (s *Store) AddUserToGroups(ctx context.Context, options *AddUserToGroupsOptions) error
- func (s *Store) AddUserToRoles(ctx context.Context, options *AddUserToRolesOptions) error
- func (s *Store) CountGroups(ctx context.Context) (uint64, error)
- func (s *Store) CountRoles(ctx context.Context) (uint64, error)
- func (s *Store) CreateGroup(ctx context.Context, r *Group) error
- func (s *Store) CreateRole(ctx context.Context, r *Role) error
- func (s *Store) DeleteGroup(ctx context.Context, id string) error
- func (s *Store) DeleteRole(ctx context.Context, id string) error
- func (s *Store) DeleteUserGroup(ctx context.Context, userID string) error
- func (s *Store) DeleteUserRole(ctx context.Context, userID string) error
- func (s *Store) GetGroupByID(ctx context.Context, id string) (*Group, error)
- func (s *Store) GetGroupByKey(ctx context.Context, key string) (*Group, error)
- func (s *Store) GetManyGroups(ctx context.Context, ids []string) ([]*Group, error)
- func (s *Store) GetManyGroupsByKeys(ctx context.Context, keys []string) ([]*Group, error)
- func (s *Store) GetManyRoles(ctx context.Context, ids []string) ([]*Role, error)
- func (s *Store) GetManyRolesByKeys(ctx context.Context, keys []string) ([]*Role, error)
- func (s *Store) GetManyUsersByIds(ctx context.Context, ids []string) ([]string, error)
- func (s *Store) GetRoleByID(ctx context.Context, id string) (*Role, error)
- func (s *Store) GetRoleByKey(ctx context.Context, key string) (*Role, error)
- func (s *Store) GetUserByID(ctx context.Context, id string) (string, error)
- func (s *Store) ListAllUserIDsByEffectiveRoleIDs(ctx context.Context, roleIDs []string) ([]string, error)
- func (s *Store) ListAllUserIDsByGroupIDs(ctx context.Context, groupIDs []string) ([]string, error)
- func (s *Store) ListAllUserIDsByRoleID(ctx context.Context, roleIDs []string) ([]string, error)
- func (s *Store) ListEffectiveRolesByUserID(ctx context.Context, userID string) ([]*Role, error)
- func (s *Store) ListGroups(ctx context.Context, options *ListGroupsOptions, pageArgs graphqlutil.PageArgs) ([]*Group, uint64, error)
- func (s *Store) ListGroupsByRoleID(ctx context.Context, roleID string) ([]*Group, error)
- func (s *Store) ListGroupsByUserID(ctx context.Context, userID string) ([]*Group, error)
- func (s *Store) ListGroupsByUserIDs(ctx context.Context, userIDs []string) (map[string][]*Group, error)
- func (s *Store) ListRoles(ctx context.Context, options *ListRolesOptions, pageArgs graphqlutil.PageArgs) ([]*Role, uint64, error)
- func (s *Store) ListRolesByGroupID(ctx context.Context, groupID string) ([]*Role, error)
- func (s *Store) ListRolesByUserID(ctx context.Context, userID string) ([]*Role, error)
- func (s *Store) ListRolesByUserIDs(ctx context.Context, userIDs []string) (map[string][]*Role, error)
- func (s *Store) ListUserIDsByGroupID(ctx context.Context, groupID string, pageArgs graphqlutil.PageArgs) ([]string, uint64, error)
- func (s *Store) ListUserIDsByRoleID(ctx context.Context, roleID string, pageArgs graphqlutil.PageArgs) ([]string, uint64, error)
- func (s *Store) NewGroup(options *NewGroupOptions) *Group
- func (s *Store) NewRole(options *NewRoleOptions) *Role
- func (s *Store) RemoveGroupFromRoles(ctx context.Context, options *RemoveGroupFromRolesOptions) (*Group, error)
- func (s *Store) RemoveGroupFromUsers(ctx context.Context, options *RemoveGroupFromUsersOptions) (*Group, error)
- func (s *Store) RemoveRoleFromGroups(ctx context.Context, options *RemoveRoleFromGroupsOptions) (*Role, error)
- func (s *Store) RemoveRoleFromUsers(ctx context.Context, options *RemoveRoleFromUsersOptions) (*Role, error)
- func (s *Store) RemoveUserFromGroups(ctx context.Context, options *RemoveUserFromGroupsOptions) error
- func (s *Store) RemoveUserFromRoles(ctx context.Context, options *RemoveUserFromRolesOptions) error
- func (s *Store) ResetUserGroup(ctx context.Context, options *ResetUserGroupOptions) error
- func (s *Store) ResetUserRole(ctx context.Context, options *ResetUserRoleOptions) error
- func (s *Store) UpdateGroup(ctx context.Context, options *UpdateGroupOptions) error
- func (s *Store) UpdateRole(ctx context.Context, options *UpdateRoleOptions) error
- type UpdateGroupOptions
- type UpdateRoleOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var DependencySet = wire.NewSet( wire.Struct(new(Store), "*"), wire.Struct(new(Queries), "*"), wire.Struct(new(Commands), "*"), )
View Source
var ErrGroupDuplicateKey = apierrors.BadRequest.WithReason("GroupDuplicateKey").New("duplicate group key")
View Source
var ErrGroupNotFound = apierrors.NotFound.WithReason("GroupNotFound").New("group not found")
View Source
var ErrRoleDuplicateKey = apierrors.BadRequest.WithReason("RoleDuplicateKey").New("duplicate role key")
View Source
var ErrRoleNotFound = apierrors.NotFound.WithReason("RoleNotFound").New("role not found")
View Source
var GroupUnknownKeys = apierrors.NotFound.WithReason("GroupUnknownKeys")
View Source
var KeySchema = validation.NewSimpleSchema(`
{
"type": "string",
"minLength": 1,
"maxLength": 40,
"pattern": "^[a-zA-Z_][a-zA-Z0-9:_]*$",
"format": "x_role_group_key"
}
`)
View Source
var RoleUnknownKeys = apierrors.NotFound.WithReason("RoleUnknownKeys")
View Source
var UserUnknownKeys = apierrors.NotFound.WithReason("UserUnknownKeys")
Functions ¶
func ValidateKey ¶
Types ¶
type AddGroupToRolesOptions ¶
type AddGroupToUsersOptions ¶
type AddRoleToGroupsOptions ¶
type AddRoleToUsersOptions ¶
type AddUserToGroupsOptions ¶
type AddUserToRolesOptions ¶
type Commands ¶
type Commands struct {
Store *Store
}
func (*Commands) AddGroupToRoles ¶
func (*Commands) AddGroupToUsers ¶
func (*Commands) AddRoleToGroups ¶
func (*Commands) AddRoleToUsers ¶
func (*Commands) AddUserToGroups ¶
func (c *Commands) AddUserToGroups(ctx context.Context, options *AddUserToGroupsOptions) error
func (*Commands) AddUserToRoles ¶
func (c *Commands) AddUserToRoles(ctx context.Context, options *AddUserToRolesOptions) error
func (*Commands) CreateGroup ¶
func (*Commands) CreateRole ¶
func (*Commands) DeleteUserGroup ¶
func (*Commands) DeleteUserRole ¶
func (*Commands) RemoveGroupFromRoles ¶
func (*Commands) RemoveGroupFromUsers ¶
func (*Commands) RemoveRoleFromGroups ¶
func (*Commands) RemoveRoleFromUsers ¶
func (*Commands) RemoveUserFromGroups ¶
func (c *Commands) RemoveUserFromGroups(ctx context.Context, options *RemoveUserFromGroupsOptions) error
func (*Commands) RemoveUserFromRoles ¶
func (c *Commands) RemoveUserFromRoles(ctx context.Context, options *RemoveUserFromRolesOptions) error
func (*Commands) ResetUserGroup ¶
func (c *Commands) ResetUserGroup(ctx context.Context, options *ResetUserGroupOptions) error
func (*Commands) ResetUserRole ¶
func (c *Commands) ResetUserRole(ctx context.Context, options *ResetUserRoleOptions) error
func (*Commands) UpdateGroup ¶
func (*Commands) UpdateRole ¶
type Group ¶
type ListGroupsOptions ¶
type ListRolesOptions ¶
type NewGroupOptions ¶
type NewRoleOptions ¶
type Queries ¶
type Queries struct {
Store *Store
}
func (*Queries) GetManyGroups ¶
func (*Queries) GetManyRoles ¶
func (*Queries) ListAllGroupsByKeys ¶
func (*Queries) ListAllRolesByKeys ¶
func (*Queries) ListAllUserIDsByEffectiveRoleIDs ¶
func (*Queries) ListAllUserIDsByGroupIDs ¶
func (*Queries) ListAllUserIDsByGroupKeys ¶
func (*Queries) ListAllUserIDsByRoleIDs ¶
func (*Queries) ListEffectiveRolesByUserID ¶
func (*Queries) ListGroups ¶
func (q *Queries) ListGroups(ctx context.Context, options *ListGroupsOptions, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
func (*Queries) ListGroupsByRoleID ¶
func (*Queries) ListGroupsByUserID ¶
func (*Queries) ListGroupsByUserIDs ¶
func (*Queries) ListRoles ¶
func (q *Queries) ListRoles(ctx context.Context, options *ListRolesOptions, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
func (*Queries) ListRolesByGroupID ¶
func (*Queries) ListRolesByUserID ¶
func (*Queries) ListRolesByUserIDs ¶
func (*Queries) ListUserIDsByGroupID ¶
func (q *Queries) ListUserIDsByGroupID(ctx context.Context, groupID string, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
func (*Queries) ListUserIDsByRoleID ¶
func (q *Queries) ListUserIDsByRoleID(ctx context.Context, roleID string, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
type ResetUserGroupOptions ¶
type ResetUserRoleOptions ¶
type Role ¶
type Store ¶
type Store struct { SQLBuilder *appdb.SQLBuilderApp SQLExecutor *appdb.SQLExecutor Clock clock.Clock }
func (*Store) AddGroupToRoles ¶
func (*Store) AddGroupToUsers ¶
func (*Store) AddRoleToGroups ¶
func (*Store) AddRoleToUsers ¶
func (*Store) AddUserToGroups ¶
func (s *Store) AddUserToGroups(ctx context.Context, options *AddUserToGroupsOptions) error
func (*Store) AddUserToRoles ¶
func (s *Store) AddUserToRoles(ctx context.Context, options *AddUserToRolesOptions) error
func (*Store) DeleteUserGroup ¶
func (*Store) DeleteUserRole ¶
func (*Store) GetGroupByID ¶
func (*Store) GetGroupByKey ¶
func (*Store) GetManyGroups ¶
func (*Store) GetManyGroupsByKeys ¶
func (*Store) GetManyRoles ¶
func (*Store) GetManyRolesByKeys ¶
func (*Store) GetManyUsersByIds ¶
func (*Store) GetRoleByID ¶
func (*Store) GetRoleByKey ¶
func (*Store) GetUserByID ¶
func (*Store) ListAllUserIDsByEffectiveRoleIDs ¶
func (*Store) ListAllUserIDsByGroupIDs ¶
func (*Store) ListAllUserIDsByRoleID ¶
func (*Store) ListEffectiveRolesByUserID ¶
func (*Store) ListGroups ¶
func (s *Store) ListGroups(ctx context.Context, options *ListGroupsOptions, pageArgs graphqlutil.PageArgs) ([]*Group, uint64, error)
func (*Store) ListGroupsByRoleID ¶
func (*Store) ListGroupsByUserID ¶
func (*Store) ListGroupsByUserIDs ¶
func (*Store) ListRoles ¶
func (s *Store) ListRoles(ctx context.Context, options *ListRolesOptions, pageArgs graphqlutil.PageArgs) ([]*Role, uint64, error)
func (*Store) ListRolesByGroupID ¶
func (*Store) ListRolesByUserID ¶
func (*Store) ListRolesByUserIDs ¶
func (*Store) ListUserIDsByGroupID ¶
func (*Store) ListUserIDsByRoleID ¶
func (*Store) NewGroup ¶
func (s *Store) NewGroup(options *NewGroupOptions) *Group
func (*Store) NewRole ¶
func (s *Store) NewRole(options *NewRoleOptions) *Role
func (*Store) RemoveGroupFromRoles ¶
func (*Store) RemoveGroupFromUsers ¶
func (*Store) RemoveRoleFromGroups ¶
func (*Store) RemoveRoleFromUsers ¶
func (*Store) RemoveUserFromGroups ¶
func (s *Store) RemoveUserFromGroups(ctx context.Context, options *RemoveUserFromGroupsOptions) error
func (*Store) RemoveUserFromRoles ¶
func (s *Store) RemoveUserFromRoles(ctx context.Context, options *RemoveUserFromRolesOptions) error
func (*Store) ResetUserGroup ¶
func (s *Store) ResetUserGroup(ctx context.Context, options *ResetUserGroupOptions) error
func (*Store) ResetUserRole ¶
func (s *Store) ResetUserRole(ctx context.Context, options *ResetUserRoleOptions) error
func (*Store) UpdateGroup ¶
func (s *Store) UpdateGroup(ctx context.Context, options *UpdateGroupOptions) error
func (*Store) UpdateRole ¶
func (s *Store) UpdateRole(ctx context.Context, options *UpdateRoleOptions) error
type UpdateGroupOptions ¶
func (*UpdateGroupOptions) RequireUpdate ¶
func (o *UpdateGroupOptions) RequireUpdate() bool
type UpdateRoleOptions ¶
func (*UpdateRoleOptions) RequireUpdate ¶
func (o *UpdateRoleOptions) RequireUpdate() bool
Click to show internal directories.
Click to hide internal directories.