authenticator

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator struct {
	Config      *domain.RuntimeConfig `checkinject:"required"`
	CookieModel interface {
		Get(cookieID string) (domain.Cookie, error)
		Create(domain.Cookie) (string, error)
		UpdateExpires(cookieID string, exp time.Time) error
		Delete(cookieID string) error
	} `checkinject:"required"`
}

Authenticator contains middleware functions for performing authentication

func (*Authenticator) AccountUser

func (a *Authenticator) AccountUser(next http.Handler) http.Handler

AccountUser middleware sets the user id in context if the there is a cookie for user account.

func (*Authenticator) AppspaceUserProxyID

func (a *Authenticator) AppspaceUserProxyID(next http.Handler) http.Handler

AppspaceUserProxyID middleware sets the proxy ID for the user authenticated for the requested appspace

func (*Authenticator) SetForAccount

func (a *Authenticator) SetForAccount(w http.ResponseWriter, userID domain.UserID) error

SetForAccount creates a cookie and sends it down It is for access to the user account only

func (*Authenticator) SetForAppspace

func (a *Authenticator) SetForAppspace(w http.ResponseWriter, proxyID domain.ProxyID, appspaceID domain.AppspaceID, dom string) (string, error)

SetForAppspace creates a cookie and sends it down It is for access to the appspace only

func (*Authenticator) Unset

func (a *Authenticator) Unset(w http.ResponseWriter, r *http.Request)

Unset is the opposite of SetForAccount deletes cookie, wipes cookie from DB?

Jump to

Keyboard shortcuts

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