Documentation ¶
Index ¶
- Constants
- Variables
- func GetEventHeader(headerName string, event events.APIGatewayProxyRequest) []string
- type Address
- type Attorney
- type AttorneyStatus
- type AuthorDetails
- type CanUse
- type CertificateProvider
- type Change
- type Channel
- type Date
- func (d Date) IsZero() bool
- func (d Date) MarshalDynamoDBAttributeValue() (types.AttributeValue, error)
- func (d Date) MarshalText() ([]byte, error)
- func (d *Date) UnmarshalDynamoDBAttributeValue(av types.AttributeValue) error
- func (d *Date) UnmarshalJSON(data []byte) error
- func (d *Date) UnmarshalText(data []byte) error
- type Donor
- type FieldError
- type File
- type FileUpload
- type HowMakeDecisions
- type HowStepIn
- type IdentityCheck
- type IdentityCheckType
- type JWTVerifier
- type Lang
- type LifeSustainingTreatment
- type LogEvent
- type Lpa
- type LpaInit
- type LpaStatus
- type LpaStoreClaims
- type LpaType
- type Person
- type PersonToNotify
- type Problem
- type Signatory
- type TrustCorporation
- type URN
- type Update
Constants ¶
View Source
const ( LpaTypePersonalWelfare = LpaType("personal-welfare") LpaTypePropertyAndAffairs = LpaType("property-and-affairs") )
View Source
const ( LpaStatusInProgress = LpaStatus("in-progress") LpaStatusStatutoryWaitingPeriod = LpaStatus("statutory-waiting-period") LpaStatusRegistered = LpaStatus("registered") LpaStatusCannotRegister = LpaStatus("cannot-register") LpaStatusWithdrawn = LpaStatus("withdrawn") )
View Source
const ( ChannelOnline = Channel("online") ChannelPaper = Channel("paper") )
View Source
const ( AttorneyStatusActive = AttorneyStatus("active") AttorneyStatusReplacement = AttorneyStatus("replacement") AttorneyStatusRemoved = AttorneyStatus("removed") )
View Source
const ( IdentityCheckTypeOneLogin = IdentityCheckType("one-login") IdentityCheckTypeOpgPaperId = IdentityCheckType("opg-paper-id") )
View Source
const ( HowMakeDecisionsUnset = HowMakeDecisions("") HowMakeDecisionsJointly = HowMakeDecisions("jointly") HowMakeDecisionsJointlyAndSeverally = HowMakeDecisions("jointly-and-severally") HowMakeDecisionsJointlyForSomeSeverallyForOthers = HowMakeDecisions("jointly-for-some-severally-for-others") )
View Source
const ( HowStepInUnset = HowStepIn("") HowStepInAllCanNoLongerAct = HowStepIn("all-can-no-longer-act") HowStepInOneCanNoLongerAct = HowStepIn("one-can-no-longer-act") HowStepInAnotherWay = HowStepIn("another-way") )
View Source
const ( CanUseUnset = CanUse("") CanUseWhenCapacityLost = CanUse("when-capacity-lost") CanUseWhenHasCapacity = CanUse("when-has-capacity") )
View Source
const ( LifeSustainingTreatmentUnset = LifeSustainingTreatment("") LifeSustainingTreatmentOptionA = LifeSustainingTreatment("option-a") LifeSustainingTreatmentOptionB = LifeSustainingTreatment("option-b") )
Variables ¶
View Source
var ( LangCy = Lang("cy") LangEn = Lang("en") )
View Source
var ( ProblemInternalServerError = Problem{ StatusCode: 500, Code: "INTERNAL_SERVER_ERROR", Detail: "Internal server error", } ProblemInvalidRequest = Problem{ StatusCode: 400, Code: "INVALID_REQUEST", Detail: "Invalid request", } StatusCode: 401, Code: "UNAUTHORISED", Detail: "Invalid JWT", } ProblemNotFoundRequest = Problem{ StatusCode: 404, Code: "NOT_FOUND", Detail: "Record not found", } )
Functions ¶
func GetEventHeader ¶
func GetEventHeader(headerName string, event events.APIGatewayProxyRequest) []string
Types ¶
type Address ¶
type Attorney ¶
type Attorney struct { Person DateOfBirth Date `json:"dateOfBirth"` Email string `json:"email,omitempty"` Status AttorneyStatus `json:"status"` Mobile string `json:"mobile,omitempty"` SignedAt *time.Time `json:"signedAt,omitempty"` ContactLanguagePreference Lang `json:"contactLanguagePreference,omitempty"` Channel Channel `json:"channel"` }
type AttorneyStatus ¶
type AttorneyStatus string
func (AttorneyStatus) IsValid ¶
func (a AttorneyStatus) IsValid() bool
type AuthorDetails ¶
type CertificateProvider ¶
type CertificateProvider struct { Person Email string `json:"email"` Phone string `json:"phone"` Channel Channel `json:"channel"` SignedAt *time.Time `json:"signedAt,omitempty"` ContactLanguagePreference Lang `json:"contactLanguagePreference,omitempty"` IdentityCheck *IdentityCheck `json:"identityCheck,omitempty"` }
type Change ¶
type Change struct { Key string `json:"key"` Old json.RawMessage `json:"old"` New json.RawMessage `json:"new"` }
type Date ¶
type Date struct { IsMalformed bool // contains filtered or unexported fields }
func (Date) MarshalDynamoDBAttributeValue ¶
func (d Date) MarshalDynamoDBAttributeValue() (types.AttributeValue, error)
func (Date) MarshalText ¶
func (*Date) UnmarshalDynamoDBAttributeValue ¶
func (d *Date) UnmarshalDynamoDBAttributeValue(av types.AttributeValue) error
func (*Date) UnmarshalJSON ¶
func (*Date) UnmarshalText ¶
type FieldError ¶
type FileUpload ¶
type HowMakeDecisions ¶
type HowMakeDecisions string
func (HowMakeDecisions) IsValid ¶
func (e HowMakeDecisions) IsValid() bool
func (HowMakeDecisions) Unset ¶
func (e HowMakeDecisions) Unset() bool
type IdentityCheck ¶
type IdentityCheck struct { CheckedAt time.Time `json:"checkedAt"` Type IdentityCheckType `json:"type"` }
type IdentityCheckType ¶
type IdentityCheckType string
func (IdentityCheckType) IsValid ¶
func (e IdentityCheckType) IsValid() bool
type JWTVerifier ¶
type JWTVerifier struct { Logger logger // contains filtered or unexported fields }
func NewJWTVerifier ¶
func NewJWTVerifier(cfg aws.Config, logger logger) JWTVerifier
func (JWTVerifier) VerifyHeader ¶
func (v JWTVerifier) VerifyHeader(event events.APIGatewayProxyRequest) (*LpaStoreClaims, error)
verify JWT from event header returns true if verified, false otherwise
type LifeSustainingTreatment ¶
type LifeSustainingTreatment string
func (LifeSustainingTreatment) IsValid ¶
func (e LifeSustainingTreatment) IsValid() bool
func (LifeSustainingTreatment) Unset ¶
func (e LifeSustainingTreatment) Unset() bool
type LpaInit ¶
type LpaInit struct { LpaType LpaType `json:"lpaType"` Channel Channel `json:"channel"` Donor Donor `json:"donor"` Attorneys []Attorney `json:"attorneys"` TrustCorporations []TrustCorporation `json:"trustCorporations,omitempty"` CertificateProvider CertificateProvider `json:"certificateProvider"` PeopleToNotify []PersonToNotify `json:"peopleToNotify,omitempty"` HowAttorneysMakeDecisions HowMakeDecisions `json:"howAttorneysMakeDecisions,omitempty"` HowAttorneysMakeDecisionsDetails string `json:"howAttorneysMakeDecisionsDetails,omitempty"` HowReplacementAttorneysMakeDecisions HowMakeDecisions `json:"howReplacementAttorneysMakeDecisions,omitempty"` HowReplacementAttorneysMakeDecisionsDetails string `json:"howReplacementAttorneysMakeDecisionsDetails,omitempty"` HowReplacementAttorneysStepIn HowStepIn `json:"howReplacementAttorneysStepIn,omitempty"` HowReplacementAttorneysStepInDetails string `json:"howReplacementAttorneysStepInDetails,omitempty"` WhenTheLpaCanBeUsed CanUse `json:"whenTheLpaCanBeUsed,omitempty"` LifeSustainingTreatmentOption LifeSustainingTreatment `json:"lifeSustainingTreatmentOption,omitempty"` RestrictionsAndConditions string `json:"restrictionsAndConditions,omitempty"` RestrictionsAndConditionsImages []FileUpload `json:"restrictionsAndConditionsImages,omitempty"` SignedAt time.Time `json:"signedAt"` CertificateProviderNotRelatedConfirmedAt *time.Time `json:"certificateProviderNotRelatedConfirmedAt,omitempty"` }
type LpaStoreClaims ¶
type LpaStoreClaims struct {
jwt.RegisteredClaims
}
func (LpaStoreClaims) Validate ¶
func (l LpaStoreClaims) Validate() error
note that default validation for RegisteredClaims checks exp is in the future
type PersonToNotify ¶
type PersonToNotify struct {
Person
}
type Problem ¶
type Problem struct { StatusCode int `json:"-"` Code string `json:"code"` Detail string `json:"detail"` Errors []FieldError `json:"errors,omitempty"` }
type Signatory ¶
type TrustCorporation ¶
type TrustCorporation struct { UID string `json:"uid"` Name string `json:"name"` CompanyNumber string `json:"companyNumber"` Email string `json:"email,omitempty"` Address Address `json:"address"` Status AttorneyStatus `json:"status"` Mobile string `json:"mobile,omitempty"` Signatories []Signatory `json:"signatories,omitempty"` ContactLanguagePreference Lang `json:"contactLanguagePreference,omitempty"` Channel Channel `json:"channel"` }
Click to show internal directories.
Click to hide internal directories.