account

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 20 Imported by: 0 modules, 0 packages

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

Overview

Package account is api's AccountService of the contract novatrail.api.v1: the account and its invite code, and, task by task, its PIN, profiles and deletion (R04, R34, R35, R36). Its methods run after the checks of architecture 3.1, which give them the caller (rpc.CallerFrom); a method it has no handler for yet answers unimplemented.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.1.6

type Option func(*Service)

Option is a choice of New's that a test makes.

func WithClock added in v0.1.6

func WithClock(now func() time.Time) Option

WithClock is the clock the PIN's count goes by, the system's by default.

type Rights added in v0.1.8

type Rights interface {
	WriteOwner(ctx context.Context, accountID, profileID string) error
	deletion.Rights
}

Rights is what writes the tuple of a profile it makes, and deletes the tuples of what it deletes: authz.Rights.

type Service

type Service struct {
	apiv1connect.UnimplementedAccountServiceHandler
	// contains filtered or unexported fields
}

Service is the AccountService on the database api.

func New

func New(db rpc.DB, rights Rights, signin deletion.Signin, options ...Option) *Service

New is the AccountService on db, with the tuples of the profiles in rights and the users at signin.

func (*Service) ChangePin added in v0.1.6

func (s *Service) ChangePin(ctx context.Context, req *v1.ChangePinRequest) (*v1.ChangePinResponse, error)

ChangePin changes the PIN by the PIN before it, which counts as VerifyPin counts it; a wrong one changes nothing.

func (*Service) CreateAccount

func (s *Service) CreateAccount(ctx context.Context, req *v1.CreateAccountRequest) (*v1.CreateAccountResponse, error)

CreateAccount creates the caller's account by an invite code and the owner's statement that they are 18 or older. A caller with an account already gets CAUSE_ALREADY_EXISTS before the statement and the code are looked at, so that a repeat after a lost answer gets that rather than a code redeemed (contract, CreateAccount).

func (*Service) CreateChildProfile added in v0.1.7

CreateChildProfile creates a child's profile by its consent, once it is confirmed, of its category and country, and its tuple before the COMMIT. A consent with its profile already is CAUSE_ALREADY_EXISTS before its state is looked at, so that a repeat is told the profile is there.

func (*Service) CreateOwnerProfile added in v0.1.7

CreateOwnerProfile creates the owner's profile, of the category adult by the owner's statement, with its consent, and its tuple before the COMMIT (R04, R36; architecture 3.1). A profile of the owner there already comes before the country, so that a repeat is told it is there.

func (*Service) DeleteAccount added in v0.1.8

DeleteAccount deletes the account, all of it and its user at the sign-in service, by a fresh sign-in, which the checks held (R20, R21). Once its data is gone from the database the answer is "deleted", and what does not finish the daily job does; a repeat gets "the account is gone" from the checks.

func (*Service) DeleteProfile added in v0.1.8

func (s *Service) DeleteProfile(ctx context.Context, req *v1.DeleteProfileRequest) (*v1.DeleteProfileResponse, error)

DeleteProfile deletes the profile and all of it, by can_manage and a fresh sign-in, which the checks held (R20, R21). The owner's profile goes the same way, and the last profile leaves the account without profiles. A tuple left after the database is done is still "deleted": its line names the failure, and the profile's row is gone, so the tuple gives a right to nothing; its repeat deletes it (architecture 3.10).

func (*Service) GetAccount

GetAccount gives the account of the caller: whether its PIN is set, its profiles and its consents for a child with no profile. Open attempts and lesson runs come with epic E3, which keeps them.

func (*Service) RequestChildConsent added in v0.1.7

RequestChildConsent records a consent for a child that waits, with the category worked out of the age and the country; the age in years lives in this request's memory alone (privacy 3.3 spec). A repeat under its key is the same consent, at the limit too, since it is answered before the consents are counted; the key's fingerprint is slow, as the request carries the age.

func (*Service) ResetPin added in v0.1.6

func (s *Service) ResetPin(ctx context.Context, req *v1.ResetPinRequest) (*v1.ResetPinResponse, error)

ResetPin changes a forgotten PIN by a fresh sign-in, which the checks have held last (R20): it sets the new PIN whether there was one or not, and opens the input.

func (*Service) SetPin added in v0.1.6

func (s *Service) SetPin(ctx context.Context, req *v1.SetPinRequest) (*v1.SetPinResponse, error)

SetPin sets the PIN of the section for adults, while the account has none.

func (*Service) SetVoicing added in v0.1.7

func (s *Service) SetVoicing(ctx context.Context, req *v1.SetVoicingRequest) (*v1.SetVoicingResponse, error)

SetVoicing sets the voicing alone, from the screen of a task: the checks have held the right can_learn, which the learner has as well as the adult.

func (*Service) UpdateProfile added in v0.1.7

func (s *Service) UpdateProfile(ctx context.Context, req *v1.UpdateProfileRequest) (*v1.UpdateProfileResponse, error)

UpdateProfile changes the settings sent, and leaves the others (contract, ProfileSettings). The checks have held the right can_manage.

func (*Service) VerifyPin added in v0.1.6

func (s *Service) VerifyPin(ctx context.Context, req *v1.VerifyPinRequest) (*v1.VerifyPinResponse, error)

VerifyPin checks a PIN: a wrong one counts toward closing the input.

Jump to

Keyboard shortcuts

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