user

package
v3.15.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 3 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoesUserFulfillFilterCriteria added in v3.2.0

func DoesUserFulfillFilterCriteria(user *userpb.User, filter *userpb.Filter) bool

func HasUploaderRole

func HasUploaderRole(user *userpb.User) bool

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.

Directories

Path Synopsis
manager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL