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
- donordata.Donor - details about the donor, provided by the applicant
- donordata.CertificateProvider - details about the certificate provider, provided by the applicant
- certificateproviderdata.Provided - details about the certificate provider, provided by the certificate provider
- donordata.Attorney - details about an attorney or replacement attorney, provided by the applicant
- donordata.AttorneyDecisions - details about how an attorney or replacement attorney should act, provided by the applicant
- attorneydata.Provided - details about an attorney or replacement attorney, provided by the attorney or replacement attorney
- donordata.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, sessionStore SessionStore) http.HandlerFunc
- func CacheControlHeaders(h http.Handler) http.Handler
- func ChooseAttorneysState(attorneys donordata.Attorneys, decisions donordata.AttorneyDecisions) task.State
- func ChooseReplacementAttorneysState(donor *donordata.Provided) task.State
- func CookieConsent(paths AppPaths) http.HandlerFunc
- func DependencyHealthCheck(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 ValidateCsrf(next http.Handler, store SessionStore, randomString func(int) string, ...) http.HandlerFunc
- type AppPaths
- type AttorneyPaths
- type Bundle
- type CertificateProviderInvite
- type CertificateProviderPaths
- type DashboardStore
- type DonorStore
- type ErrorHandler
- type EventClient
- type HandleOpt
- type Handler
- func Dashboard(tmpl template.Template, donorStore DonorStore, dashboardStore DashboardStore) Handler
- func Guidance(tmpl template.Template) Handler
- func Login(oneLoginClient LoginOneLoginClient, sessionStore LoginSessionStore, ...) Handler
- func LoginCallback(logger Logger, oneLoginClient LoginCallbackOneLoginClient, ...) Handler
- func Root(tmpl template.Template, logger Logger) Handler
- func SignOut(logger Logger, sessionStore SessionStore, oneLoginClient OneLoginClient, ...) Handler
- type HealthCheckPaths
- type HealthChecker
- type Localizer
- type Logger
- type LoginCallbackOneLoginClient
- type LoginCallbackSessionStore
- type LoginOneLoginClient
- type LoginSessionStore
- type LpaAndActorTasks
- type NotifyClient
- type OneLoginClient
- type Path
- type Progress
- type ProgressTask
- type ProgressTracker
- type SessionStore
- type ShareCodeSender
- func (s *ShareCodeSender) SendAttorneys(ctx context.Context, appData appcontext.Data, donor *lpastore.Lpa) error
- func (s *ShareCodeSender) SendCertificateProviderInvite(ctx context.Context, appData appcontext.Data, invite CertificateProviderInvite) error
- func (s *ShareCodeSender) SendCertificateProviderPrompt(ctx context.Context, appData appcontext.Data, donor *donordata.Provided) error
- func (s *ShareCodeSender) UseTestCode(shareCode string)
- type ShareCodeStore
- type SupporterPaths
- type Template
- type WitnessCodeSender
Constants ¶
View Source
const ( PathCertificateProviderConfirmDontWantToBeCertificateProviderLoggedOut = Path("/confirm-you-do-not-want-to-be-a-certificate-provider") PathCertificateProviderEnterReferenceNumber = Path("/certificate-provider-enter-reference-number") PathCertificateProviderEnterReferenceNumberOptOut = Path("/certificate-provider-enter-reference-number-opt-out") PathCertificateProviderLogin = Path("/certificate-provider-login") PathCertificateProviderLoginCallback = Path("/certificate-provider-login-callback") PathCertificateProviderYouHaveDecidedNotToBeCertificateProvider = Path("/you-have-decided-not-to-be-a-certificate-provider") PathAttorneyConfirmDontWantToBeAttorneyLoggedOut = Path("/confirm-you-do-not-want-to-be-an-attorney") PathAttorneyEnterReferenceNumber = Path("/attorney-enter-reference-number") PathAttorneyEnterReferenceNumberOptOut = Path("/attorney-enter-reference-number-opt-out") PathAttorneyLogin = Path("/attorney-login") PathAttorneyLoginCallback = Path("/attorney-login-callback") PathAttorneyStart = Path("/attorney-start") PathAttorneyYouHaveDecidedNotToBeAttorney = Path("/you-have-decided-not-to-be-an-attorney") PathSupporterEnterOrganisationName = Path("/enter-the-name-of-your-organisation-or-company") PathSupporterEnterReferenceNumber = Path("/supporter-reference-number") PathSupporterEnterYourName = Path("/enter-your-name") PathSupporterLogin = Path("/supporter-login") PathSupporterLoginCallback = Path("/supporter-login-callback") PathSupporterOrganisationDeleted = Path("/organisation-deleted") PathSupporterSigningInAdvice = Path("/signing-in-with-govuk-one-login") PathSupporterStart = Path("/supporter-start") PathSupporterInviteExpired = Path("/invite-expired") PathHealthCheckService = Path("/health-check/service") PathHealthCheckDependency = Path("/health-check/dependency") PathAttorneyFixtures = Path("/fixtures/attorney") PathAuthRedirect = Path("/auth/redirect") PathCertificateProviderFixtures = Path("/fixtures/certificate-provider") PathCertificateProviderStart = Path("/certificate-provider-start") PathCookiesConsent = Path("/cookies-consent") PathDashboard = Path("/dashboard") PathDashboardFixtures = Path("/fixtures/dashboard") PathEnterAccessCode = Path("/enter-access-code") PathFixtures = Path("/fixtures") PathLogin = Path("/login") PathLoginCallback = Path("/login-callback") PathLpaDeleted = Path("/lpa-deleted") PathLpaWithdrawn = Path("/lpa-withdrawn") PathRoot = Path("/") PathSignOut = Path("/sign-out") PathStart = Path("/start") PathSupporterFixtures = Path("/fixtures/supporter") )
View Source
const FormUrlEncoded = "application/x-www-form-urlencoded"
Variables ¶
View Source
var ( UseTestWitnessCode = false ErrTooManyWitnessCodeRequests = errors.New("too many witness code requests") )
View Source
var ErrCsrfInvalid = errors.New("CSRF token not valid")
View Source
var Paths = AppPaths{}/* 133 elements not displayed */
Functions ¶
func AuthRedirect ¶
func AuthRedirect(logger Logger, sessionStore SessionStore) http.HandlerFunc
func ChooseAttorneysState ¶
func CookieConsent ¶
func CookieConsent(paths AppPaths) http.HandlerFunc
func DependencyHealthCheck ¶
func DependencyHealthCheck(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 ValidateCsrf ¶
func ValidateCsrf(next http.Handler, store SessionStore, randomString func(int) string, errorHandler ErrorHandler) http.HandlerFunc
Types ¶
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 EnterAccessCode Path Fixtures Path Login Path LoginCallback Path LpaDeleted Path LpaWithdrawn Path Root Path SignOut Path Start Path SupporterFixtures Path AboutPayment donor.Path AddCorrespondent donor.Path AreYouApplyingForFeeDiscountOrExemption donor.Path BecauseYouHaveChosenJointly donor.Path BecauseYouHaveChosenJointlyForSomeSeverallyForOthers donor.Path CanYouSignYourLpa donor.Path CertificateProviderAddress donor.Path CertificateProviderDetails donor.Path CertificateProviderOptOut donor.Path ChangeCertificateProviderMobileNumber donor.Path ChangeIndependentWitnessMobileNumber donor.Path CheckYouCanSign donor.Path CheckYourDetails donor.Path CheckYourLpa donor.Path ChooseAttorneys donor.Path ChooseAttorneysAddress donor.Path ChooseAttorneysGuidance donor.Path ChooseAttorneysSummary donor.Path ChooseNewCertificateProvider donor.Path ChoosePeopleToNotify donor.Path ChoosePeopleToNotifyAddress donor.Path ChoosePeopleToNotifySummary donor.Path ChooseReplacementAttorneys donor.Path ChooseReplacementAttorneysAddress donor.Path ChooseReplacementAttorneysSummary donor.Path ChooseYourCertificateProvider donor.Path ConfirmPersonAllowedToVouch donor.Path ConfirmYourCertificateProviderIsNotRelated donor.Path DeleteThisLpa donor.Path DoYouWantReplacementAttorneys donor.Path DoYouWantToNotifyPeople donor.Path EnterCorrespondentAddress donor.Path EnterCorrespondentDetails donor.Path EnterReplacementTrustCorporation donor.Path EnterReplacementTrustCorporationAddress donor.Path EnterTrustCorporation donor.Path EnterTrustCorporationAddress donor.Path EnterVoucher donor.Path EvidenceRequired donor.Path EvidenceSuccessfullyUploaded donor.Path FeeApproved donor.Path FeeDenied donor.Path GettingHelpSigning donor.Path HowDoYouKnowYourCertificateProvider donor.Path HowLongHaveYouKnownCertificateProvider donor.Path HowShouldAttorneysMakeDecisions donor.Path HowShouldReplacementAttorneysMakeDecisions donor.Path HowShouldReplacementAttorneysStepIn donor.Path HowToConfirmYourIdentityAndSign donor.Path HowToSendEvidence donor.Path HowWouldCertificateProviderPreferToCarryOutTheirRole donor.Path HowWouldYouLikeToSendEvidence donor.Path IdentityWithOneLogin donor.Path IdentityWithOneLoginCallback donor.Path LifeSustainingTreatment donor.Path LpaDetailsSaved donor.Path LpaType donor.Path LpaYourLegalRightsAndResponsibilities donor.Path MakeANewLPA donor.Path NeedHelpSigningConfirmation donor.Path OneLoginIdentityDetails donor.Path PaymentConfirmation donor.Path PreviousApplicationNumber donor.Path PreviousFee donor.Path Progress donor.Path ProveYourIdentity donor.Path ReadYourLpa donor.Path RegisterWithCourtOfProtection donor.Path RemoveAttorney donor.Path RemovePersonToNotify donor.Path RemoveReplacementAttorney donor.Path RemoveReplacementTrustCorporation donor.Path RemoveTrustCorporation donor.Path ResendCertificateProviderCode donor.Path ResendIndependentWitnessCode donor.Path Restrictions donor.Path SendUsYourEvidenceByPost donor.Path SignTheLpaOnBehalf donor.Path SignYourLpa donor.Path TaskList donor.Path UnableToConfirmIdentity donor.Path UploadEvidence donor.Path UploadEvidenceSSE donor.Path UseExistingAddress donor.Path WeHaveContactedVoucher donor.Path WeHaveReceivedVoucherDetails donor.Path WeHaveUpdatedYourDetails donor.Path WhatACertificateProviderDoes donor.Path WhatHappensNextPostEvidence donor.Path WhatHappensNextRegisteringWithCourtOfProtection donor.Path WhatIsVouching donor.Path WhatYouCanDoNow donor.Path WhenCanTheLpaBeUsed donor.Path WhichFeeTypeAreYouApplyingFor donor.Path WithdrawThisLpa donor.Path WitnessingAsCertificateProvider donor.Path WitnessingAsIndependentWitness donor.Path WitnessingYourSignature donor.Path YouCannotSignYourLpaYet donor.Path YouHaveSubmittedYourLpa donor.Path YourAddress donor.Path YourAuthorisedSignatory donor.Path YourDateOfBirth donor.Path YourDetails donor.Path YourEmail donor.Path YourIndependentWitness donor.Path YourIndependentWitnessAddress donor.Path YourIndependentWitnessMobile donor.Path YourLegalRightsAndResponsibilitiesIfYouMakeLpa donor.Path YourLpaLanguage donor.Path YourName donor.Path YourPreferredLanguage donor.Path }
type AttorneyPaths ¶
type AttorneyPaths struct { ConfirmDontWantToBeAttorneyLoggedOut Path EnterReferenceNumber Path EnterReferenceNumberOptOut Path Login Path LoginCallback Path Start Path YouHaveDecidedNotToBeAttorney Path CodeOfConduct attorney.Path ConfirmDontWantToBeAttorney attorney.Path ConfirmYourDetails attorney.Path MobileNumber attorney.Path Progress attorney.Path ReadTheLpa attorney.Path RightsAndResponsibilities attorney.Path Sign attorney.Path TaskList attorney.Path WhatHappensNext attorney.Path WhatHappensWhenYouSign attorney.Path WouldLikeSecondSignatory attorney.Path YourPreferredLanguage attorney.Path }
type CertificateProviderInvite ¶ added in v0.1116.0
type CertificateProviderPaths ¶
type CertificateProviderPaths struct { Login Path LoginCallback Path EnterReferenceNumber Path EnterReferenceNumberOptOut Path ConfirmDontWantToBeCertificateProviderLoggedOut Path YouHaveDecidedNotToBeCertificateProvider Path CertificateProvided certificateprovider.Path ConfirmDontWantToBeCertificateProvider certificateprovider.Path ConfirmYourDetails certificateprovider.Path EnterDateOfBirth certificateprovider.Path IdentityWithOneLogin certificateprovider.Path IdentityWithOneLoginCallback certificateprovider.Path OneLoginIdentityDetails certificateprovider.Path ProveYourIdentity certificateprovider.Path ProvideCertificate certificateprovider.Path ReadTheLpa certificateprovider.Path TaskList certificateprovider.Path UnableToConfirmIdentity certificateprovider.Path WhatHappensNext certificateprovider.Path WhatIsYourHomeAddress certificateprovider.Path WhoIsEligible certificateprovider.Path YourPreferredLanguage certificateprovider.Path YourRole certificateprovider.Path }
type DashboardStore ¶
type DonorStore ¶
type ErrorHandler ¶
type ErrorHandler func(http.ResponseWriter, *http.Request, error)
type EventClient ¶ added in v0.962.0
type EventClient interface { SendNotificationSent(ctx context.Context, notificationSentEvent event.NotificationSent) error SendPaperFormRequested(ctx context.Context, paperFormRequestedEvent event.PaperFormRequested) error }
type Handler ¶
type Handler func(data appcontext.Data, w http.ResponseWriter, r *http.Request) error
func Dashboard ¶
func Dashboard(tmpl template.Template, donorStore DonorStore, dashboardStore DashboardStore) Handler
func Login ¶
func Login(oneLoginClient LoginOneLoginClient, sessionStore LoginSessionStore, randomString func(int) string, redirect Path) Handler
func LoginCallback ¶
func LoginCallback(logger Logger, oneLoginClient LoginCallbackOneLoginClient, sessionStore LoginCallbackSessionStore, redirect Path, dashboardStore DashboardStore, actorType actor.Type) Handler
func SignOut ¶
func SignOut(logger Logger, sessionStore SessionStore, oneLoginClient OneLoginClient, appPublicURL string) Handler
type HealthCheckPaths ¶
type HealthChecker ¶ added in v0.805.0
type Localizer ¶
type Localizer interface { Concat(list []string, joiner string) string Count(messageID string, count int) string Format(messageID string, data map[string]interface{}) string FormatCount(messageID string, count int, data map[string]any) string FormatDate(t date.TimeOrDate) string FormatTime(t time.Time) string FormatDateTime(t time.Time) string Possessive(s string) string SetShowTranslationKeys(s bool) ShowTranslationKeys() bool T(messageID string) string }
type LoginCallbackSessionStore ¶ added in v0.1051.0
type LoginCallbackSessionStore interface { OneLogin(r *http.Request) (*sesh.OneLoginSession, error) SetLogin(r *http.Request, w http.ResponseWriter, session *sesh.LoginSession) error }
type LoginOneLoginClient ¶
type LoginSessionStore ¶ added in v0.1051.0
type LoginSessionStore interface {
SetOneLogin(r *http.Request, w http.ResponseWriter, session *sesh.OneLoginSession) error
}
type LpaAndActorTasks ¶
type LpaAndActorTasks struct { Lpa *lpastore.Lpa CertificateProvider *certificateproviderdata.Provided Attorney *attorneydata.Provided }
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) Redirect ¶ added in v0.833.0
func (p Path) Redirect(w http.ResponseWriter, r *http.Request, appData appcontext.Data) error
func (Path) RedirectQuery ¶ added in v0.833.0
func (p Path) RedirectQuery(w http.ResponseWriter, r *http.Request, appData appcontext.Data, query url.Values) error
type Progress ¶
type Progress struct { Paid ProgressTask ConfirmedID ProgressTask DonorSigned ProgressTask CertificateProviderSigned ProgressTask AttorneysSigned ProgressTask LpaSubmitted ProgressTask NoticesOfIntentSent ProgressTask StatutoryWaitingPeriod ProgressTask LpaRegistered ProgressTask // contains filtered or unexported fields }
func (Progress) ToSlice ¶ added in v0.1158.0
func (p Progress) ToSlice() []ProgressTask
type ProgressTask ¶ added in v0.1090.0
type ProgressTracker ¶ added in v0.1090.0
type ProgressTracker struct {
Localizer Localizer
}
type SessionStore ¶
type SessionStore interface { Csrf(r *http.Request) (*sesh.CsrfSession, error) SetCsrf(r *http.Request, w http.ResponseWriter, session *sesh.CsrfSession) error Login(r *http.Request) (*sesh.LoginSession, error) SetLogin(r *http.Request, w http.ResponseWriter, session *sesh.LoginSession) error ClearLogin(r *http.Request, w http.ResponseWriter) error OneLogin(r *http.Request) (*sesh.OneLoginSession, error) SetOneLogin(r *http.Request, w http.ResponseWriter, session *sesh.OneLoginSession) error }
type ShareCodeSender ¶
type ShareCodeSender struct {
// contains filtered or unexported fields
}
func NewShareCodeSender ¶
func NewShareCodeSender(shareCodeStore ShareCodeStore, notifyClient NotifyClient, appPublicURL string, randomString func(int) string, eventClient EventClient) *ShareCodeSender
func (*ShareCodeSender) SendAttorneys ¶
func (s *ShareCodeSender) SendAttorneys(ctx context.Context, appData appcontext.Data, donor *lpastore.Lpa) error
func (*ShareCodeSender) SendCertificateProviderInvite ¶ added in v0.885.0
func (s *ShareCodeSender) SendCertificateProviderInvite(ctx context.Context, appData appcontext.Data, invite CertificateProviderInvite) error
func (*ShareCodeSender) SendCertificateProviderPrompt ¶ added in v0.885.0
func (s *ShareCodeSender) SendCertificateProviderPrompt(ctx context.Context, appData appcontext.Data, donor *donordata.Provided) error
func (*ShareCodeSender) UseTestCode ¶
func (s *ShareCodeSender) UseTestCode(shareCode string)
type ShareCodeStore ¶
type ShareCodeStore interface {}
type SupporterPaths ¶ added in v0.942.0
type SupporterPaths struct { EnterOrganisationName Path EnterReferenceNumber Path EnterYourName Path InviteExpired Path Login Path LoginCallback Path OrganisationDeleted Path SigningInAdvice Path Start Path ConfirmDonorCanInteractOnline supporter.Path ContactOPGForPaperForms supporter.Path Dashboard supporter.Path DeleteOrganisation supporter.Path EditMember supporter.Path EditOrganisationName supporter.Path InviteMember supporter.Path InviteMemberConfirmation supporter.Path ManageTeamMembers supporter.Path OrganisationCreated supporter.Path OrganisationDetails supporter.Path ViewLPA supporter.LpaPath DonorAccess supporter.LpaPath }
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 (*WitnessCodeSender) SendToIndependentWitness ¶ added in v0.691.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.