Versions in this module Expand all Collapse all v2 v2.0.1 Jun 15, 2021 Changes in this version + var ErrAnonymous = errors.New("anonymous session") + var ErrCSRF = errors.New("CSRF check failed") + var ErrExpired = errors.New("token expired") + var ErrIdempotency = errors.New("idempotency check failed") + var ErrInactive = errors.New("inactive session") + var ErrUpdateConflict = errors.New("update conflict") + var ErrVerification = errors.New("token check failed") + func CanonicalizeEmail(inp string) (string, error) + func CheckVerificationToken(uw UserWrapper, expSecs int64, nonce, token string) error + func DSTest(ctx context.Context, projectID string) (<-chan struct{}, error) + func GetSetting(ctx context.Context, client *datastore.Client, name string) ([]byte, error) + func Idempotent(ctx context.Context, client *datastore.Client, key string) error + func IsNoSession(err error) bool + func LookupUser(ctx context.Context, client *datastore.Client, email string, uw UserWrapper) error + func NewSetting(ctx context.Context, client *datastore.Client, name string, value []byte) error + func NewUser(ctx context.Context, client *datastore.Client, email, pw string, ...) error + func SessionHandler(client *datastore.Client, next http.Handler) http.Handler + func SetSetting(ctx context.Context, client *datastore.Client, name string, value []byte) error + func UpdatePW(ctx context.Context, client *datastore.Client, uw UserWrapper, pw string) error + func UpdateUser(ctx context.Context, client *datastore.Client, email string, uw UserWrapper, ...) error + func VerificationToken(uw UserWrapper) (expSecs int64, nonce, token string, err error) + func VerifyUser(ctx context.Context, client *datastore.Client, uw UserWrapper, expSecs int64, ...) error + type GCloudTasks cloudtasks.Client + func NewGCloudTasks(ctx context.Context, options ...option.ClientOption) (*GCloudTasks, error) + func (t *GCloudTasks) Enqueue(ctx context.Context, queue, taskName, url string, when time.Time) error + func (t *GCloudTasks) IsQueueEmpty(ctx context.Context, queue string) (bool, error) + type IdemKey struct + Exp time.Time + Key string + type Session struct + Active bool + CSRFKey []byte + Exp time.Time + ID int64 + UserKey *datastore.Key + func ContextSession(ctx context.Context) *Session + func GetSession(ctx context.Context, client *datastore.Client, req *http.Request) (*Session, error) + func GetSessionByKey(ctx context.Context, client *datastore.Client, key *datastore.Key) (*Session, error) + func NewSession(ctx context.Context, client *datastore.Client, userKey *datastore.Key) (*Session, error) + func NewSessionWithDuration(ctx context.Context, client *datastore.Client, userKey *datastore.Key, ...) (*Session, error) + func (s *Session) CSRFCheck(inp string) error + func (s *Session) CSRFToken() (string, error) + func (s *Session) Cancel(ctx context.Context, client *datastore.Client) error + func (s *Session) GetUser(ctx context.Context, client *datastore.Client, uw UserWrapper) error + func (s *Session) Key() *datastore.Key + func (s *Session) SetCookie(w http.ResponseWriter) + type Setting struct + Name string + Value []byte + type TaskService interface + Enqueue func(ctx context.Context, queue, taskName, url string, when time.Time) error + IsQueueEmpty func(ctx context.Context, queue string) (bool, error) + type User struct + Email string + PWHash []byte + Salt []byte + Secret []byte + UpdateCounter int64 + Verified bool + func (u *User) CheckPW(pw string) bool + func (u *User) CheckToken(wt io.WriterTo, token string) error + func (u *User) GetUser() *User + func (u *User) Key() *datastore.Key + func (u *User) SecureToken(wt io.WriterTo) (string, error) + func (u *User) SetUser(u2 *User) + type UserWrapper interface + GetUser func() *User + SetUser func(*User) Other modules containing this package github.com/bobg/aesite github.com/bobg/aesite/v3 github.com/bobg/aesite/v4