Documentation ¶
Overview ¶
Package sesh provides functionality for setting and reading session data as cookies.
Index ¶
- type CsrfSession
- type DynamoClient
- type DynamoStore
- type InvalidSessionError
- type LoginSession
- type LpaDataSession
- type MissingSessionError
- type OneLoginSession
- type PaymentSession
- type Store
- func (s *Store) ClearLogin(r *http.Request, w http.ResponseWriter) error
- func (s *Store) ClearPayment(r *http.Request, w http.ResponseWriter) error
- func (s *Store) Csrf(r *http.Request) (*CsrfSession, error)
- func (s *Store) Login(r *http.Request) (*LoginSession, error)
- func (s *Store) LpaData(r *http.Request) (*LpaDataSession, error)
- func (s *Store) OneLogin(r *http.Request) (*OneLoginSession, error)
- func (s *Store) Payment(r *http.Request) (*PaymentSession, error)
- func (s *Store) SetCsrf(r *http.Request, w http.ResponseWriter, csrfSession *CsrfSession) error
- func (s *Store) SetLogin(r *http.Request, w http.ResponseWriter, donorSession *LoginSession) error
- func (s *Store) SetLpaData(r *http.Request, w http.ResponseWriter, lpaDataSession *LpaDataSession) error
- func (s *Store) SetOneLogin(r *http.Request, w http.ResponseWriter, oneLoginSession *OneLoginSession) error
- func (s *Store) SetPayment(r *http.Request, w http.ResponseWriter, paymentSession *PaymentSession) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CsrfSession ¶ added in v0.1051.0
func (CsrfSession) Valid ¶ added in v0.1051.0
func (s CsrfSession) Valid() bool
type DynamoClient ¶ added in v0.1539.0
type DynamoStore ¶ added in v0.1539.0
type DynamoStore struct { Codecs []securecookie.Codec Options *sessions.Options // contains filtered or unexported fields }
DynamoStore stores sessions in DynamoDB.
func NewDynamoStore ¶ added in v0.1539.0
func NewDynamoStore(dynamoClient DynamoClient, keyPairs ...[]byte) *DynamoStore
func (*DynamoStore) Save ¶ added in v0.1539.0
func (s *DynamoStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
type InvalidSessionError ¶
type InvalidSessionError string
func (InvalidSessionError) Error ¶
func (e InvalidSessionError) Error() string
type LoginSession ¶
type LoginSession struct { IDToken string Sub string Email string OrganisationID string OrganisationName string }
func (LoginSession) SessionID ¶ added in v0.986.0
func (s LoginSession) SessionID() string
SessionID is a safe version of the OneLogin sub, that is used to form DynamoDB keys. Note: this is not the identifier stored in the "session" cookie.
func (LoginSession) Valid ¶
func (s LoginSession) Valid() bool
type LpaDataSession ¶ added in v0.1181.0
type LpaDataSession struct {
LpaID string
}
func (LpaDataSession) Valid ¶ added in v0.1181.0
func (s LpaDataSession) Valid() bool
type MissingSessionError ¶
type MissingSessionError string
func (MissingSessionError) Error ¶
func (e MissingSessionError) Error() string
type OneLoginSession ¶
type OneLoginSession struct { State string Nonce string Locale string Redirect string SessionID string LpaID string }
func (OneLoginSession) Valid ¶
func (s OneLoginSession) Valid() bool
type PaymentSession ¶
type PaymentSession struct {
PaymentID string
}
func (PaymentSession) Valid ¶
func (s PaymentSession) Valid() bool
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶ added in v0.1051.0
func NewStore(dynamoClient DynamoClient, keyPairs [][]byte) *Store
func (*Store) ClearLogin ¶ added in v0.1051.0
func (*Store) ClearPayment ¶ added in v0.1051.0
func (*Store) Login ¶ added in v0.1051.0
func (s *Store) Login(r *http.Request) (*LoginSession, error)
func (*Store) LpaData ¶ added in v0.1181.0
func (s *Store) LpaData(r *http.Request) (*LpaDataSession, error)
func (*Store) OneLogin ¶ added in v0.1051.0
func (s *Store) OneLogin(r *http.Request) (*OneLoginSession, error)
func (*Store) Payment ¶ added in v0.1051.0
func (s *Store) Payment(r *http.Request) (*PaymentSession, error)
func (*Store) SetCsrf ¶ added in v0.1051.0
func (s *Store) SetCsrf(r *http.Request, w http.ResponseWriter, csrfSession *CsrfSession) error
func (*Store) SetLogin ¶ added in v0.1051.0
func (s *Store) SetLogin(r *http.Request, w http.ResponseWriter, donorSession *LoginSession) error
func (*Store) SetLpaData ¶ added in v0.1181.0
func (s *Store) SetLpaData(r *http.Request, w http.ResponseWriter, lpaDataSession *LpaDataSession) error
func (*Store) SetOneLogin ¶ added in v0.1051.0
func (s *Store) SetOneLogin(r *http.Request, w http.ResponseWriter, oneLoginSession *OneLoginSession) error
func (*Store) SetPayment ¶ added in v0.1051.0
func (s *Store) SetPayment(r *http.Request, w http.ResponseWriter, paymentSession *PaymentSession) error
Click to show internal directories.
Click to hide internal directories.