Documentation ¶
Index ¶
- type Authenticator
- func (a *Authenticator) AccountUser(next http.Handler) http.Handler
- func (a *Authenticator) AppspaceUserProxyID(next http.Handler) http.Handler
- func (a *Authenticator) SetForAccount(w http.ResponseWriter, userID domain.UserID) error
- func (a *Authenticator) SetForAppspace(w http.ResponseWriter, proxyID domain.ProxyID, appspaceID domain.AppspaceID, ...) (string, error)
- func (a *Authenticator) Unset(w http.ResponseWriter, r *http.Request)
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?
Click to show internal directories.
Click to hide internal directories.