users

package
v0.0.0-...-98cd694 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Unlicense Imports: 38 Imported by: 0

Documentation

Overview

Package users provides a series of HTTP handlers for managing users, passwords, and two factor secrets in a compatible database.

Index

Constants

View Source
const (
	// UserIDURIParamKey is used to refer to user IDs in router params.
	UserIDURIParamKey = "userID"
)

Variables

View Source
var ErrNilConfig = errors.New("nil config provided")

ErrNilConfig is returned when you provide a nil configuration to the users service constructor.

Providers are what we provide for dependency injectors.

Functions

func ProvideUsersService

func ProvideUsersService(
	ctx context.Context,
	cfg *Config,
	authSettings *authservice.Config,
	logger logging.Logger,
	userDataManager types.UserDataManager,
	accountDataManager types.AccountDataManager,
	accountInvitationDataManager types.AccountInvitationDataManager,
	accountUserMembershipDataManager types.AccountUserMembershipDataManager,
	authenticator authentication.Authenticator,
	encoder encoding.ServerEncoderDecoder,
	imageUploadProcessor images.MediaUploadProcessor,
	routeParamManager routing.RouteParamManager,
	tracerProvider tracing.TracerProvider,
	publisherProvider messagequeue.PublisherProvider,
	secretGenerator random.Generator,
	passwordResetTokenDataManager types.PasswordResetTokenDataManager,
	featureFlagManager featureflags.FeatureFlagManager,
	analyticsReporter analytics.EventReporter,
) (types.UserDataService, error)

ProvideUsersService builds a new UsersService.

Types

type Config

type Config struct {
	DataChangesTopicName string         `json:"dataChangesTopicName,omitempty" toml:"data_changes_topic_name,omitempty"`
	PublicMediaURLPrefix string         `json:"publicMediaURLPrefix"           toml:"public_media_url_prefix"`
	Uploads              uploads.Config `json:"uploads"                        toml:"uploads,omitempty"`
}

Config configures the users service.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates a Config struct.

type RequestValidator

type RequestValidator interface {
	Validate(req *http.Request) (bool, error)
}

RequestValidator validates request.

Jump to

Keyboard shortcuts

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