controller

package
v0.2.92 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieKeyString           = "auth-session"
	AuthorizationHeaderString = "Authorization"
	BearerHeaderString        = "Bearer "
	KeyDelimiterString        = "."
)

Variables

View Source
var (
	CookieKey           = []byte(CookieKeyString)
	AuthorizationHeader = []byte(AuthorizationHeaderString)
	BearerHeader        = []byte(BearerHeaderString)
	KeyDelimiter        = []byte(KeyDelimiterString)

	EmptySecretKey = [32]byte{}
)
View Source
var (
	ErrInvalidContext = errors.New("invalid context")
)

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func New

func New(sessionDomain string, secureOnlyCookies bool, storage storage.Storage, logger *zerolog.Logger) *Controller

func (*Controller) CreateServiceSession

func (m *Controller) CreateServiceSession(ctx *fiber.Ctx, keyID string, keySecret []byte) (*servicesession.ServiceSession, []byte, error)

func (*Controller) CreateSession

func (m *Controller) CreateSession(ctx *fiber.Ctx, device bool, provider flow.Key, userID string, organization string) (*fiber.Cookie, string, error)

func (*Controller) DecodeMagic

func (m *Controller) DecodeMagic(encoded string) (string, []byte, error)

func (*Controller) EncodeMagic

func (m *Controller) EncodeMagic(email string, secret []byte) (string, error)

func (*Controller) GenerateCookie

func (m *Controller) GenerateCookie(session string, expiry time.Time) *fiber.Cookie

func (*Controller) LogoutServiceSession

func (m *Controller) LogoutServiceSession(ctx *fiber.Ctx) (bool, error)

func (*Controller) LogoutSession

func (m *Controller) LogoutSession(ctx *fiber.Ctx) (bool, error)

func (*Controller) ManualValidate

func (m *Controller) ManualValidate(ctx *fiber.Ctx) (bool, error)

func (*Controller) Start

func (m *Controller) Start() error

func (*Controller) Stop

func (m *Controller) Stop() error

func (*Controller) SubscriptionHealthy

func (m *Controller) SubscriptionHealthy() bool

func (*Controller) Validate

func (m *Controller) Validate(ctx *fiber.Ctx) error

Jump to

Keyboard shortcuts

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