voucherpage

package
v0.1539.0-MLPAB2553ses... Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package voucherpage provides the pages that a voucher interacts with.

Index

Constants

View Source
const (
	None handleOpt = 1 << iota
	RequireSession
	CanGoBack
)

Variables

This section is empty.

Functions

func EnterReferenceNumber

func EnterReferenceNumber(tmpl template.Template, shareCodeStore ShareCodeStore, sessionStore SessionStore, voucherStore VoucherStore) page.Handler

func Register

func Register(
	rootMux *http.ServeMux,
	logger Logger,
	tmpls template.Templates,
	sessionStore SessionStore,
	voucherStore VoucherStore,
	oneLoginClient OneLoginClient,
	shareCodeStore ShareCodeStore,
	dashboardStore DashboardStore,
	errorHandler page.ErrorHandler,
	lpaStoreResolvingService LpaStoreResolvingService,
	notifyClient NotifyClient,
	appPublicURL string,
	donorStore DonorStore,
)

Types

type DashboardStore

type DashboardStore interface {
	GetAll(ctx context.Context) (results dashboarddata.Results, err error)
	SubExistsForActorType(ctx context.Context, sub string, actorType actor.Type) (bool, error)
}

type DonorStore added in v0.1400.0

type DonorStore interface {
	GetAny(ctx context.Context) (*donordata.Provided, error)
	Put(ctx context.Context, donor *donordata.Provided) error
}

type ErrorHandler

type ErrorHandler func(http.ResponseWriter, *http.Request, error)

type Handler

type Handler func(data appcontext.Data, w http.ResponseWriter, r *http.Request, provided *voucherdata.Provided) error

func ConfirmAllowedToVouch added in v0.1369.0

func ConfirmAllowedToVouch(tmpl template.Template, lpaStoreResolvingService LpaStoreResolvingService, voucherStore VoucherStore, fail vouchFailer) Handler

func ConfirmYourName added in v0.1367.0

func ConfirmYourName(tmpl template.Template, lpaStoreResolvingService LpaStoreResolvingService, voucherStore VoucherStore) Handler

func Guidance added in v0.1373.0

func Guidance(tmpl template.Template, lpaStoreResolvingService LpaStoreResolvingService) Handler

func IdentityWithOneLogin added in v0.1375.0

func IdentityWithOneLogin(oneLoginClient OneLoginClient, sessionStore SessionStore, randomString func(int) string) Handler

func IdentityWithOneLoginCallback added in v0.1375.0

func IdentityWithOneLoginCallback(oneLoginClient OneLoginClient, sessionStore SessionStore, voucherStore VoucherStore, lpaStoreResolvingService LpaStoreResolvingService, fail vouchFailer) Handler

func TaskList

func TaskList(tmpl template.Template, lpaStoreResolvingService LpaStoreResolvingService) Handler

func VerifyDonorDetails added in v0.1369.0

func VerifyDonorDetails(tmpl template.Template, lpaStoreResolvingService LpaStoreResolvingService, voucherStore VoucherStore, fail vouchFailer) Handler

func YourDeclaration added in v0.1377.0

func YourDeclaration(tmpl template.Template, lpaStoreResolvingService LpaStoreResolvingService, voucherStore VoucherStore, donorStore DonorStore, notifyClient NotifyClient, now func() time.Time, appPublicURL string) Handler

func YourName added in v0.1369.0

func YourName(tmpl template.Template, lpaStoreResolvingService LpaStoreResolvingService, voucherStore VoucherStore) Handler

type Localizer added in v0.1366.0

type Localizer interface {
	page.Localizer
}

type Logger

type Logger interface {
	InfoContext(ctx context.Context, msg string, args ...any)
	WarnContext(ctx context.Context, msg string, args ...any)
	ErrorContext(ctx context.Context, msg string, args ...any)
}

type LpaStoreResolvingService added in v0.1366.0

type LpaStoreResolvingService interface {
	Get(ctx context.Context) (*lpadata.Lpa, error)
}

type NotifyClient added in v0.1375.0

type NotifyClient interface {
	EmailGreeting(lpa *lpadata.Lpa) string
	SendActorEmail(ctx context.Context, lang localize.Lang, to, lpaUID string, email notify.Email) error
	SendActorSMS(ctx context.Context, lang localize.Lang, to, lpaUID string, sms notify.SMS) error
}

type OneLoginClient

type OneLoginClient interface {
	AuthCodeURL(state, nonce, locale string, identity bool) (string, error)
	Exchange(ctx context.Context, code, nonce string) (idToken, accessToken string, err error)
	UserInfo(ctx context.Context, accessToken string) (onelogin.UserInfo, error)
	ParseIdentityClaim(userInfo onelogin.UserInfo) (identity.UserData, error)
}

type SessionStore

type SessionStore interface {
	Login(r *http.Request) (*sesh.LoginSession, error)
	LpaData(r *http.Request) (*sesh.LpaDataSession, error)
	OneLogin(r *http.Request) (*sesh.OneLoginSession, error)
	SetLogin(r *http.Request, w http.ResponseWriter, session *sesh.LoginSession) error
	SetLpaData(r *http.Request, w http.ResponseWriter, lpaDataSession *sesh.LpaDataSession) error
	SetOneLogin(r *http.Request, w http.ResponseWriter, session *sesh.OneLoginSession) error
}

type ShareCodeStore

type ShareCodeStore interface {
	Get(ctx context.Context, actorType actor.Type, shareCode string) (sharecodedata.Link, error)
	Put(ctx context.Context, actorType actor.Type, shareCode string, data sharecodedata.Link) error
	Delete(ctx context.Context, shareCode sharecodedata.Link) error
}

type Template

type Template func(io.Writer, interface{}) error

type VoucherStore

type VoucherStore interface {
	Create(ctx context.Context, shareCode sharecodedata.Link, email string) (*voucherdata.Provided, error)
	Get(ctx context.Context) (*voucherdata.Provided, error)
	Put(ctx context.Context, provided *voucherdata.Provided) error
}

Jump to

Keyboard shortcuts

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