supporter

package
v0.951.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 13 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 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

func TODO

func TODO() 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, string, notify.Email) (string, 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