Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoesUserFulfillFilterCriteria ¶ added in v3.2.0
func HasUploaderRole ¶
HasUploaderRole returns true if the user has uploader role.
Types ¶
type BlockedUsers ¶
type BlockedUsers struct {
// contains filtered or unexported fields
}
BlockedUsers is a concurrency-safe set of blocked usernames, consulted on the authentication hot path.
func NewBlockedUsersSet ¶
func NewBlockedUsersSet(users []string) *BlockedUsers
NewBlockedUsersSet creates a new set of blocked users from a list.
func SharedBlockedUsers ¶ added in v3.13.0
func SharedBlockedUsers() *BlockedUsers
SharedBlockedUsers returns the process-wide blocked set, created on first use. The auth interceptor and authprovider seed it from config.
func (*BlockedUsers) Add ¶ added in v3.13.0
func (b *BlockedUsers) Add(users ...string)
Add seeds additional blocked users.
func (*BlockedUsers) Block ¶ added in v3.13.0
func (b *BlockedUsers) Block(user string)
Block adds a user to the set.
func (*BlockedUsers) IsBlocked ¶
func (b *BlockedUsers) IsBlocked(user string) bool
IsBlocked returns true if the user is blocked.
func (*BlockedUsers) List ¶ added in v3.13.0
func (b *BlockedUsers) List() []string
List returns the currently blocked usernames.
func (*BlockedUsers) Unblock ¶ added in v3.13.0
func (b *BlockedUsers) Unblock(user string)
Unblock removes a user from the set.
type Manager ¶
type Manager interface {
// GetUser returns the user metadata identified by a uid.
// The groups of the user are omitted if specified, as these might not be required for certain operations
// and might involve computational overhead.
GetUser(ctx context.Context, uid *userpb.UserId, skipFetchingGroups bool) (*userpb.User, error)
// GetUserByClaim returns the user identified by a specific value for a given claim.
GetUserByClaim(ctx context.Context, claim, value string, skipFetchingGroups bool) (*userpb.User, error)
// GetUserGroups returns the groups a user identified by a uid belongs to.
GetUserGroups(ctx context.Context, uid *userpb.UserId) ([]string, error)
// FindUsers returns all the user objects which match a query parameter.
FindUsers(ctx context.Context, query string, filters []*userpb.Filter, skipFetchingGroups bool) ([]*userpb.User, error)
}
Manager is the interface to implement to manipulate users.
Click to show internal directories.
Click to hide internal directories.