stdattrs

package
v0.0.0-...-09efcc3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ClaimStore

type ClaimStore interface {
	ListByClaimName(ctx context.Context, userID string, claimName string) ([]*verification.Claim, error)
	ListByUserIDsAndClaimNames(ctx context.Context, userIDs []string, claimNames []string) ([]*verification.Claim, error)
}

type EventService

type EventService interface {
	DispatchEventOnCommit(ctx context.Context, payload event.Payload) error
}

type IdentityService

type IdentityService interface {
	ListByUser(ctx context.Context, userID string) ([]*identity.Info, error)
}

type PictureTransformer

type PictureTransformer struct {
	HTTPProto     httputil.HTTPProto
	HTTPHost      httputil.HTTPHost
	ImagesCDNHost config.ImagesCDNHost
}

func (*PictureTransformer) RepresentationFormToStorageForm

func (t *PictureTransformer) RepresentationFormToStorageForm(key string, value interface{}) (interface{}, error)

func (*PictureTransformer) StorageFormToRepresentationForm

func (t *PictureTransformer) StorageFormToRepresentationForm(key string, value interface{}) (interface{}, error)

type Service

type Service struct {
	UserProfileConfig *config.UserProfileConfig
	ServiceNoEvent    *ServiceNoEvent
	Identities        IdentityService
	UserQueries       UserQueries
	UserStore         UserStore
	Events            EventService
}

func (*Service) DeriveStandardAttributes

func (s *Service) DeriveStandardAttributes(ctx context.Context, role accesscontrol.Role, userID string, updatedAt time.Time, attrs map[string]interface{}) (map[string]interface{}, error)

func (*Service) PopulateIdentityAwareStandardAttributes

func (s *Service) PopulateIdentityAwareStandardAttributes(ctx context.Context, userID string) (err error)

func (*Service) PopulateStandardAttributes

func (s *Service) PopulateStandardAttributes(ctx context.Context, userID string, iden *identity.Info) error

func (*Service) UpdateStandardAttributes

func (s *Service) UpdateStandardAttributes(ctx context.Context, role accesscontrol.Role, userID string, stdAttrs map[string]interface{}) error

func (*Service) UpdateStandardAttributesWithList

func (s *Service) UpdateStandardAttributesWithList(ctx context.Context, role accesscontrol.Role, userID string, attrs attrs.List) error

type ServiceNoEvent

type ServiceNoEvent struct {
	UserProfileConfig *config.UserProfileConfig
	Identities        IdentityService
	UserQueries       UserQueries
	UserStore         UserStore
	ClaimStore        ClaimStore
	Transformer       Transformer
}

func (*ServiceNoEvent) DeriveStandardAttributes

func (s *ServiceNoEvent) DeriveStandardAttributes(
	ctx context.Context,
	role accesscontrol.Role,
	userID string,
	updatedAt time.Time,
	attrs map[string]interface{},
) (map[string]interface{}, error)

DeriveStandardAttributes populates email_verified and phone_number_verified, if email or phone_number are found in attrs.

func (*ServiceNoEvent) DeriveStandardAttributesForUsers

func (s *ServiceNoEvent) DeriveStandardAttributesForUsers(
	ctx context.Context,
	role accesscontrol.Role,
	userIDs []string,
	updatedAts []time.Time,
	attrsList []map[string]interface{},
) (map[string]map[string]interface{}, error)

Batch implementation of DeriveStandardAttributes TODO: Write some tests and simplify the implementation nolint:gocognit

func (*ServiceNoEvent) PopulateIdentityAwareStandardAttributes

func (s *ServiceNoEvent) PopulateIdentityAwareStandardAttributes(ctx context.Context, userID string) (err error)

func (*ServiceNoEvent) UpdateStandardAttributes

func (s *ServiceNoEvent) UpdateStandardAttributes(ctx context.Context, role accesscontrol.Role, userID string, stdAttrs map[string]interface{}) error

type Transformer

type Transformer interface {
	StorageFormToRepresentationForm(key string, value interface{}) (interface{}, error)
	RepresentationFormToStorageForm(key string, value interface{}) (interface{}, error)
}

type UserQueries

type UserQueries interface {
	GetRaw(ctx context.Context, userID string) (*user.User, error)
}

type UserStore

type UserStore interface {
	UpdateStandardAttributes(ctx context.Context, userID string, stdAttrs map[string]interface{}) error
}

Jump to

Keyboard shortcuts

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