auth

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(repo repository.Repo, telegramClientId string, subscriptions service.SubscriptionService) *Service

func (*Service) ChangePassword

func (s *Service) ChangePassword(ctx context.Context, userUuid uuid.UUID, newPassword string) error

ChangePassword overwrites userUuid's password hash — used by the admin users page to reset a user's password. Callers are responsible for authorizing the caller before invoking this.

func (*Service) CheckIsAdmin

func (s *Service) CheckIsAdmin(ctx context.Context, userUuid uuid.UUID) error

func (*Service) CreateUserUnchecked

func (s *Service) CreateUserUnchecked(ctx context.Context, email, password string) (domain.User, error)

CreateUserUnchecked creates a new non-admin account, bypassing all setup/registration-mode/ auth-method checks — used only by the admin users page, where the caller is already authenticated and authorized as an administrator at the transport level.

func (*Service) EnsureNoAuthUser

func (s *Service) EnsureNoAuthUser(ctx context.Context) (domain.User, error)

func (*Service) GetMe

func (s *Service) GetMe(ctx context.Context, userUuid uuid.UUID) (domain.UserDetails, error)

func (*Service) Login

func (s *Service) Login(ctx context.Context, email, password string) (domain.Session, error)

func (*Service) LoginOrRegisterAdminViaTelegram

func (s *Service) LoginOrRegisterAdminViaTelegram(ctx context.Context, idToken string) (domain.Session, error)

LoginOrRegisterAdminViaTelegram is the wizard-only variant of LoginViaTelegram: it bypasses all setup/auth-method checks and promotes the resulting user to administrator, whether they were just created or already existed.

func (*Service) LoginViaTelegram

func (s *Service) LoginViaTelegram(ctx context.Context, idToken string) (domain.Session, error)

func (*Service) Logout

func (s *Service) Logout(ctx context.Context, token string) error

func (*Service) Refresh

func (s *Service) Refresh(ctx context.Context, refreshToken string) (domain.Session, error)

func (*Service) Register

func (s *Service) Register(ctx context.Context, email, password string) (domain.User, error)

func (*Service) RegisterAdmin

func (s *Service) RegisterAdmin(ctx context.Context, email, password string) (domain.User, error)

RegisterAdmin creates a new administrator account, bypassing all setup/registration-mode/ auth-method checks — used only by the first-run setup wizard, which runs before setup is marked complete.

func (*Service) ValidateToken

func (s *Service) ValidateToken(ctx context.Context, token string) (domain.User, error)

Jump to

Keyboard shortcuts

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