supporter

package
v0.984.0-MLPAB1780invi... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginCallback

func LoginCallback(oneLoginClient LoginCallbackOneLoginClient, sessionStore sesh.Store) page.Handler

func Register

func Register(
	rootMux *http.ServeMux,
	tmpls template.Templates,
	oneLoginClient OneLoginClient,
	sessionStore SessionStore,
	organisationStore OrganisationStore,
	notFoundHandler page.Handler,
	errorHandler page.ErrorHandler,
	notifyClient NotifyClient,
)

Types

type ErrorHandler

type ErrorHandler func(http.ResponseWriter, *http.Request, error)

type Handler

type Handler func(data page.AppData, w http.ResponseWriter, r *http.Request) error

func EnterOrganisationName added in v0.946.0

func EnterOrganisationName(tmpl template.Template, organisationStore OrganisationStore) Handler

func Guidance added in v0.982.0

func Guidance(tmpl template.Template) Handler

func InviteMember added in v0.949.0

func InviteMember(tmpl template.Template, organisationStore OrganisationStore, notifyClient NotifyClient, randomString func(int) string) Handler

func OrganisationCreated added in v0.948.0

func OrganisationCreated(tmpl template.Template, organisationStore OrganisationStore) Handler

type LoginCallbackOneLoginClient

type LoginCallbackOneLoginClient interface {
	Exchange(ctx context.Context, code, nonce string) (idToken, accessToken string, err error)
	UserInfo(ctx context.Context, accessToken string) (onelogin.UserInfo, error)
}

type NotifyClient added in v0.949.0

type NotifyClient interface {
	SendEmail(context context.Context, to string, email notify.Email) error
}

type OneLoginClient

type OneLoginClient interface {
	AuthCodeURL(state, nonce, locale string, identity bool) (string, error)
	Exchange(ctx context.Context, code, nonce string) (idToken, accessToken string, err error)
	UserInfo(ctx context.Context, accessToken string) (onelogin.UserInfo, error)
}

type OrganisationStore added in v0.946.0

type OrganisationStore interface {
	Create(context.Context, string) error
	CreateMemberInvite(context.Context, *actor.Organisation, string, string) error
	Get(context.Context) (*actor.Organisation, error)
}

type SessionStore

type SessionStore interface {
	Get(r *http.Request, name string) (*sessions.Session, error)
	New(r *http.Request, name string) (*sessions.Session, error)
	Save(r *http.Request, w http.ResponseWriter, s *sessions.Session) error
}

type Template added in v0.946.0

type Template func(io.Writer, interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL