netauth

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SessionContextKey contextKey = "session"

Variables

This section is empty.

Functions

This section is empty.

Types

type CookieOptions

type CookieOptions struct {
	Name   string
	Path   string
	Secure bool
}

type NetAuth

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

func New

func New(options NewOptions) *NetAuth

func (*NetAuth) CreateCookie

func (a *NetAuth) CreateCookie(session auth.Session) (*http.Cookie, error)

func (*NetAuth) CreateNewSession

func (a *NetAuth) CreateNewSession(ctx context.Context, w http.ResponseWriter, newSession auth.Session) (context.Context, auth.Session, error)

func (*NetAuth) EmptyCookie

func (a *NetAuth) EmptyCookie() *http.Cookie

func (*NetAuth) GetSession

func (e *NetAuth) GetSession(ctx context.Context, r *http.Request) (context.Context, auth.Session, error)

func (*NetAuth) GetSessionAndRefresh

func (e *NetAuth) GetSessionAndRefresh(ctx context.Context, w http.ResponseWriter, r *http.Request, expiresAt time.Time) (context.Context, auth.Session, error)

func (*NetAuth) GetSessionFromCookie

func (a *NetAuth) GetSessionFromCookie(ctx context.Context, cookie *http.Cookie) (auth.Session, error)

func (*NetAuth) GetSessionFromCookies

func (a *NetAuth) GetSessionFromCookies(ctx context.Context, cookies []*http.Cookie) (auth.Session, error)

func (*NetAuth) InvalidateSession

func (e *NetAuth) InvalidateSession(ctx context.Context, w http.ResponseWriter, r *http.Request) (context.Context, error)

func (*NetAuth) Service

func (a *NetAuth) Service() *auth.SessionService

type NewOptions

type NewOptions struct {
	Adapter       auth.SessionAdapter
	Encrypter     auth.Encrypter
	Generator     auth.Generator
	CookieOptions CookieOptions
	Validate      Validate
}

Jump to

Keyboard shortcuts

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