Documentation ¶
Overview ¶
Package page contains the core code and business logic of Make and Register a Lasting Power of Attorney (MRLPA)
Useful links:
- actor.Lpa - details about the LPA being drafted
- actor.Donor - details about the donor, provided by the applicant
- actor.CertificateProvider - details about the certificate provider, provided by the applicant
- actor.CertificateProviderProvidedDetails - details about the certificate provider, provided by the certificate provider
- actor.Attorney - details about an attorney or replacement attorney, provided by the applicant
- actor.AttorneyDecisions - details about how an attorney or replacement attorney should act, provided by the applicant
- actor.AttorneyProvidedDetails - details about an attorney or replacement attorney, provided by the attorney or replacement attorney
- actor.PersonToNotify - details about a person to notify, provided by the applicant
Modified from io/multi.go which carries the following licence:
Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- Constants
- Variables
- func AuthRedirect(logger Logger, store sesh.Store) http.HandlerFunc
- func CacheControlHeaders(h http.Handler) http.Handler
- func CanGoTo(donor *actor.DonorProvidedDetails, url string) bool
- func ChooseAttorneysState(attorneys actor.Attorneys, decisions actor.AttorneyDecisions) actor.TaskState
- func ChooseReplacementAttorneysState(donor *actor.DonorProvidedDetails) actor.TaskState
- func ContextWithAppData(ctx context.Context, appData AppData) context.Context
- func ContextWithSessionData(ctx context.Context, data *SessionData) context.Context
- func CookieConsent(paths AppPaths) http.HandlerFunc
- func DependencyHealthCheck(logger Logger, services map[string]HealthChecker) http.HandlerFunc
- func MultiReadCloser(readClosers ...io.ReadCloser) io.ReadCloser
- func PostFormReferenceNumber(r *http.Request, name string) string
- func PostFormString(r *http.Request, name string) string
- func Recover(tmpl template.Template, logger Logger, bundle Bundle, next http.Handler) http.HandlerFunc
- func RouteToPrefix(prefix string, mux http.Handler, notFoundHandler Handler) http.HandlerFunc
- func ValidateCsrf(next http.Handler, store sessions.Store, randomString func(int) string, ...) http.HandlerFunc
- type AppData
- type AppPaths
- type AttorneyPath
- func (p AttorneyPath) Format(id string) string
- func (p AttorneyPath) Redirect(w http.ResponseWriter, r *http.Request, appData AppData, lpaID string) error
- func (p AttorneyPath) RedirectQuery(w http.ResponseWriter, r *http.Request, appData AppData, lpaID string, ...) error
- func (p AttorneyPath) String() string
- type AttorneyPaths
- type Bundle
- type CertificateProviderPath
- type CertificateProviderPaths
- type DashboardStore
- type Document
- type Documents
- func (ds *Documents) Delete(documentKey string) bool
- func (ds *Documents) Filenames() []string
- func (ds *Documents) Get(documentKey string) Document
- func (ds *Documents) InfectedFilenames() []string
- func (ds *Documents) Keys() []string
- func (ds *Documents) NotScanned() Documents
- func (ds *Documents) Put(scannedDocument Document)
- func (ds *Documents) Scanned() Documents
- func (ds *Documents) ScannedNotSent() Documents
- func (ds *Documents) Sent() Documents
- type DonorStore
- type ErrorHandler
- type HandleOpt
- type Handler
- func Dashboard(tmpl template.Template, donorStore DonorStore, dashboardStore DashboardStore) Handler
- func Guidance(tmpl template.Template) Handler
- func Login(oneLoginClient LoginOneLoginClient, store sesh.Store, ...) Handler
- func LoginCallback(oneLoginClient LoginCallbackOneLoginClient, sessionStore sesh.Store, ...) Handler
- func Root(tmpl template.Template, logger Logger) Handler
- func SignOut(logger Logger, sessionStore sesh.Store, oneLoginClient OneLoginClient, ...) Handler
- type HealthCheckPaths
- type HealthChecker
- type Localizer
- type Logger
- type LoginCallbackOneLoginClient
- type LoginOneLoginClient
- type LpaAndActorTasks
- type LpaPath
- type NotifyClient
- type OneLoginClient
- type Path
- type RumConfig
- type SessionData
- type SessionMissingError
- type SessionStore
- type ShareCodeSender
- func (s *ShareCodeSender) SendAttorneys(ctx context.Context, appData AppData, donor *actor.DonorProvidedDetails) error
- func (s *ShareCodeSender) SendCertificateProviderInvite(ctx context.Context, appData AppData, donor *actor.DonorProvidedDetails) error
- func (s *ShareCodeSender) SendCertificateProviderPrompt(ctx context.Context, appData AppData, donor *actor.DonorProvidedDetails) error
- func (s *ShareCodeSender) UseTestCode()
- type ShareCodeStore
- type SupporterPath
- type SupporterPaths
- type Template
- type WitnessCodeSender
Constants ¶
View Source
const FormUrlEncoded = "application/x-www-form-urlencoded"
Variables ¶
View Source
var ErrCsrfInvalid = errors.New("CSRF token not valid")
View Source
var ErrTooManyWitnessCodeRequests = errors.New("too many witness code requests")
View Source
var Paths = AppPaths{}/* 113 elements not displayed */
Functions ¶
func AuthRedirect ¶
func AuthRedirect(logger Logger, store sesh.Store) http.HandlerFunc
func ChooseAttorneysState ¶
func ChooseReplacementAttorneysState ¶
func ChooseReplacementAttorneysState(donor *actor.DonorProvidedDetails) actor.TaskState
func ContextWithAppData ¶
func ContextWithSessionData ¶
func ContextWithSessionData(ctx context.Context, data *SessionData) context.Context
func CookieConsent ¶
func CookieConsent(paths AppPaths) http.HandlerFunc
func DependencyHealthCheck ¶
func DependencyHealthCheck(logger Logger, services map[string]HealthChecker) http.HandlerFunc
func MultiReadCloser ¶
func MultiReadCloser(readClosers ...io.ReadCloser) io.ReadCloser
MultiReadCloser returns a io.ReadCloser that's the logical concatenation of the provided input readClosers. They're read sequentially. Once all inputs have returned EOF, Read will return EOF. If any of the readClosers return a non-nil, non-EOF error, Read will return that error.
func RouteToPrefix ¶
func ValidateCsrf ¶
func ValidateCsrf(next http.Handler, store sessions.Store, randomString func(int) string, errorHandler ErrorHandler) http.HandlerFunc
Types ¶
type AppData ¶
type AppData struct { Page string Path string Query string Localizer Localizer Lang localize.Lang CookieConsentSet bool CanGoBack bool SessionID string RumConfig RumConfig StaticHash string Paths AppPaths LpaID string CsrfToken string ActorTypes actor.Types ActorType actor.Type AttorneyID string OneloginURL string AppPublicURL string }
func AppDataFromContext ¶
func (AppData) IsCertificateProvider ¶
func (AppData) IsReplacementAttorney ¶
func (AppData) IsTrustCorporation ¶
type AppPaths ¶
type AppPaths struct { Attorney AttorneyPaths CertificateProvider CertificateProviderPaths Supporter SupporterPaths HealthCheck HealthCheckPaths AttorneyFixtures Path AuthRedirect Path CertificateProviderFixtures Path CertificateProviderStart Path CookiesConsent Path Dashboard Path DashboardFixtures Path DonorSubByLpaUID Path Fixtures Path Login Path LoginCallback Path LpaDeleted Path LpaWithdrawn Path Root Path SignOut Path Start Path SupporterFixtures Path YourLegalRightsAndResponsibilities Path AboutPayment LpaPath AreYouApplyingForFeeDiscountOrExemption LpaPath CertificateProviderAddress LpaPath CertificateProviderDetails LpaPath CertificateProviderOptOut LpaPath ChangeCertificateProviderMobileNumber LpaPath ChangeIndependentWitnessMobileNumber LpaPath CheckYouCanSign LpaPath CheckYourLpa LpaPath ChooseAttorneys LpaPath ChooseAttorneysAddress LpaPath ChooseAttorneysGuidance LpaPath ChooseAttorneysSummary LpaPath ChooseNewCertificateProvider LpaPath ChoosePeopleToNotify LpaPath ChoosePeopleToNotifyAddress LpaPath ChoosePeopleToNotifySummary LpaPath ChooseReplacementAttorneys LpaPath ChooseReplacementAttorneysAddress LpaPath ChooseReplacementAttorneysSummary LpaPath ChooseYourCertificateProvider LpaPath ConfirmYourCertificateProviderIsNotRelated LpaPath DeleteThisLpa LpaPath DoYouWantReplacementAttorneys LpaPath DoYouWantToNotifyPeople LpaPath EnterReplacementTrustCorporation LpaPath EnterReplacementTrustCorporationAddress LpaPath EnterTrustCorporation LpaPath EnterTrustCorporationAddress LpaPath EvidenceRequired LpaPath EvidenceSuccessfullyUploaded LpaPath FeeDenied LpaPath GettingHelpSigning LpaPath HowDoYouKnowYourCertificateProvider LpaPath HowLongHaveYouKnownCertificateProvider LpaPath HowShouldAttorneysMakeDecisions LpaPath HowShouldReplacementAttorneysMakeDecisions LpaPath HowShouldReplacementAttorneysStepIn LpaPath HowToConfirmYourIdentityAndSign LpaPath HowToSendEvidence LpaPath HowWouldCertificateProviderPreferToCarryOutTheirRole LpaPath HowWouldYouLikeToSendEvidence LpaPath IdentityConfirmed LpaPath IdentityWithOneLogin LpaPath IdentityWithOneLoginCallback LpaPath LifeSustainingTreatment LpaPath LpaDetailsSaved LpaPath LpaType LpaPath LpaYourLegalRightsAndResponsibilities LpaPath MakeANewLPA LpaPath NeedHelpSigningConfirmation LpaPath PaymentConfirmation LpaPath PreviousApplicationNumber LpaPath PreviousFee LpaPath Progress LpaPath ProveYourIdentity LpaPath ReadYourLpa LpaPath RemoveAttorney LpaPath RemovePersonToNotify LpaPath RemoveReplacementAttorney LpaPath RemoveReplacementTrustCorporation LpaPath RemoveTrustCorporation LpaPath ResendCertificateProviderCode LpaPath ResendIndependentWitnessCode LpaPath Restrictions LpaPath SendUsYourEvidenceByPost LpaPath SignTheLpaOnBehalf LpaPath SignYourLpa LpaPath TaskList LpaPath UploadEvidence LpaPath UploadEvidenceSSE LpaPath UseExistingAddress LpaPath WeHaveUpdatedYourDetails LpaPath WhatACertificateProviderDoes LpaPath WhatHappensNextPostEvidence LpaPath WhenCanTheLpaBeUsed LpaPath WhichFeeTypeAreYouApplyingFor LpaPath WithdrawThisLpa LpaPath WitnessingAsCertificateProvider LpaPath WitnessingAsIndependentWitness LpaPath WitnessingYourSignature LpaPath YouHaveSubmittedYourLpa LpaPath YouCannotSignYourLpaYet LpaPath YourAddress LpaPath YourAuthorisedSignatory LpaPath YourDetails LpaPath YourDateOfBirth LpaPath YourIndependentWitness LpaPath YourIndependentWitnessAddress LpaPath YourIndependentWitnessMobile LpaPath YourName LpaPath YourPreferredLanguage LpaPath }
type AttorneyPath ¶
type AttorneyPath string
func (AttorneyPath) Format ¶
func (p AttorneyPath) Format(id string) string
func (AttorneyPath) Redirect ¶ added in v0.833.0
func (p AttorneyPath) Redirect(w http.ResponseWriter, r *http.Request, appData AppData, lpaID string) error
func (AttorneyPath) RedirectQuery ¶ added in v0.833.0
func (p AttorneyPath) RedirectQuery(w http.ResponseWriter, r *http.Request, appData AppData, lpaID string, query url.Values) error
func (AttorneyPath) String ¶
func (p AttorneyPath) String() string
type AttorneyPaths ¶
type AttorneyPaths struct { EnterReferenceNumber Path Login Path LoginCallback Path Start Path CodeOfConduct AttorneyPath ConfirmYourDetails AttorneyPath MobileNumber AttorneyPath Progress AttorneyPath ReadTheLpa AttorneyPath RightsAndResponsibilities AttorneyPath Sign AttorneyPath TaskList AttorneyPath WhatHappensNext AttorneyPath WhatHappensWhenYouSign AttorneyPath WouldLikeSecondSignatory AttorneyPath YourPreferredLanguage AttorneyPath }
type CertificateProviderPath ¶
type CertificateProviderPath string
func (CertificateProviderPath) Format ¶
func (p CertificateProviderPath) Format(id string) string
func (CertificateProviderPath) Redirect ¶ added in v0.833.0
func (p CertificateProviderPath) Redirect(w http.ResponseWriter, r *http.Request, appData AppData, lpaID string) error
func (CertificateProviderPath) String ¶
func (p CertificateProviderPath) String() string
type CertificateProviderPaths ¶
type CertificateProviderPaths struct { Login Path LoginCallback Path EnterReferenceNumber Path CertificateProvided CertificateProviderPath ConfirmYourDetails CertificateProviderPath EnterDateOfBirth CertificateProviderPath IdentityWithOneLogin CertificateProviderPath IdentityWithOneLoginCallback CertificateProviderPath ProveYourIdentity CertificateProviderPath ProvideCertificate CertificateProviderPath ReadTheLpa CertificateProviderPath TaskList CertificateProviderPath WhatHappensNext CertificateProviderPath WhatIsYourHomeAddress CertificateProviderPath WhoIsEligible CertificateProviderPath YourPreferredLanguage CertificateProviderPath YourRole CertificateProviderPath }
type DashboardStore ¶
type Documents ¶ added in v0.794.0
type Documents []Document
func (*Documents) InfectedFilenames ¶ added in v0.794.0
func (*Documents) NotScanned ¶ added in v0.794.0
func (*Documents) ScannedNotSent ¶ added in v0.923.0
type DonorStore ¶
type DonorStore interface { Create(context.Context) (*actor.DonorProvidedDetails, error) Put(context.Context, *actor.DonorProvidedDetails) error }
type ErrorHandler ¶
type ErrorHandler func(http.ResponseWriter, *http.Request, error)
type Handler ¶
func Dashboard ¶
func Dashboard(tmpl template.Template, donorStore DonorStore, dashboardStore DashboardStore) Handler
func LoginCallback ¶
func LoginCallback(oneLoginClient LoginCallbackOneLoginClient, sessionStore sesh.Store, redirect Path, dashboardStore DashboardStore, actorType actor.Type) Handler
type HealthCheckPaths ¶
type HealthChecker ¶ added in v0.805.0
type Localizer ¶
type Localizer interface { Concat([]string, string) string Count(string, int) string Format(string, map[string]any) string FormatCount(string, int, map[string]interface{}) string FormatDate(date.TimeOrDate) string FormatDateTime(time.Time) string Possessive(string) string SetShowTranslationKeys(bool) ShowTranslationKeys() bool T(string) string }
type LoginOneLoginClient ¶
type LpaAndActorTasks ¶
type LpaAndActorTasks struct { Donor *actor.DonorProvidedDetails CertificateProvider *actor.CertificateProviderProvidedDetails Attorney *actor.AttorneyProvidedDetails }
type LpaPath ¶
type LpaPath string
func (LpaPath) Redirect ¶ added in v0.833.0
func (p LpaPath) Redirect(w http.ResponseWriter, r *http.Request, appData AppData, donor *actor.DonorProvidedDetails) error
func (LpaPath) RedirectQuery ¶ added in v0.833.0
type NotifyClient ¶
type OneLoginClient ¶
type OneLoginClient interface { AuthCodeURL(state, nonce, locale string, identity bool) (string, error) EndSessionURL(idToken, postLogoutURL string) (string, error) Exchange(ctx context.Context, code, nonce string) (idToken, accessToken string, err error) UserInfo(ctx context.Context, accessToken string) (onelogin.UserInfo, error) }
type Path ¶
type Path string
func (Path) RedirectQuery ¶ added in v0.833.0
type SessionData ¶
func SessionDataFromContext ¶
func SessionDataFromContext(ctx context.Context) (*SessionData, error)
type SessionMissingError ¶
type SessionMissingError struct{}
func (SessionMissingError) Error ¶
func (s SessionMissingError) Error() string
type SessionStore ¶
type ShareCodeSender ¶
type ShareCodeSender struct {
// contains filtered or unexported fields
}
func NewShareCodeSender ¶
func NewShareCodeSender(shareCodeStore ShareCodeStore, notifyClient NotifyClient, appPublicURL string, randomString func(int) string) *ShareCodeSender
func (*ShareCodeSender) SendAttorneys ¶
func (s *ShareCodeSender) SendAttorneys(ctx context.Context, appData AppData, donor *actor.DonorProvidedDetails) error
func (*ShareCodeSender) SendCertificateProviderInvite ¶ added in v0.885.0
func (s *ShareCodeSender) SendCertificateProviderInvite(ctx context.Context, appData AppData, donor *actor.DonorProvidedDetails) error
func (*ShareCodeSender) SendCertificateProviderPrompt ¶ added in v0.885.0
func (s *ShareCodeSender) SendCertificateProviderPrompt(ctx context.Context, appData AppData, donor *actor.DonorProvidedDetails) error
func (*ShareCodeSender) UseTestCode ¶
func (s *ShareCodeSender) UseTestCode()
type ShareCodeStore ¶
type ShareCodeStore interface {}
type SupporterPath ¶ added in v0.942.0
type SupporterPath string
func (SupporterPath) Format ¶ added in v0.942.0
func (p SupporterPath) Format() string
func (SupporterPath) Redirect ¶ added in v0.942.0
func (p SupporterPath) Redirect(w http.ResponseWriter, r *http.Request, appData AppData) error
func (SupporterPath) String ¶ added in v0.942.0
func (p SupporterPath) String() string
type SupporterPaths ¶ added in v0.942.0
type SupporterPaths struct { Start Path Login Path LoginCallback Path EnterOrganisationName SupporterPath OrganisationCreated SupporterPath Dashboard SupporterPath InviteMember SupporterPath }
type WitnessCodeSender ¶
type WitnessCodeSender struct {
// contains filtered or unexported fields
}
func NewWitnessCodeSender ¶
func NewWitnessCodeSender(donorStore DonorStore, notifyClient NotifyClient) *WitnessCodeSender
func (*WitnessCodeSender) SendToCertificateProvider ¶ added in v0.691.0
func (s *WitnessCodeSender) SendToCertificateProvider(ctx context.Context, donor *actor.DonorProvidedDetails, localizer Localizer) error
func (*WitnessCodeSender) SendToIndependentWitness ¶ added in v0.691.0
func (s *WitnessCodeSender) SendToIndependentWitness(ctx context.Context, donor *actor.DonorProvidedDetails, localizer Localizer) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.