Documentation
¶
Index ¶
- Constants
- type AuthGateway
- type AuthGatewayOption
- type AuthenticationMethod
- type Handlers
- func (h *Handlers) GetActiveDomain(r *http.Request) (string, error)
- func (h *Handlers) GetUser(tk string) (*User, error)
- func (s *Handlers) LoginRequestCallbackHandler() http.HandlerFunc
- func (s *Handlers) LoginRequestCallbackHandler_v2(fn NewUserLoginHandlerFunc, redirectUrl string) http.HandlerFunc
- func (s *Handlers) Logout() http.HandlerFunc
- func (svc *Handlers) Refresh() http.HandlerFunc
- func (h *Handlers) SetActiveDomain(r *http.Request, activeDomain string) error
- type JSONResponse
- type LoginRequest
- type Middlewares
- type NewUserLoginHandlerFunc
- type User
- type UserAttribute
- type UserContextkey
- type UserGroup
Constants ¶
View Source
const ( LOCAL_DB_AUTH = "local" LDAP_AUTH = "ldap" )
View Source
const SESSION_EXPIRY = 5 * time.Minute
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthGateway ¶
type AuthGateway struct { Middlewares Middlewares Handlers Handlers // contains filtered or unexported fields }
func NewAuthGateway ¶
func NewAuthGateway(o AuthGatewayOption) (*AuthGateway, error)
type AuthGatewayOption ¶
type AuthenticationMethod ¶
type AuthenticationMethod func(*zap.SugaredLogger, User, LoginRequest) (*User, error)
type Handlers ¶
type Handlers struct { CookiePath string // contains filtered or unexported fields }
func (*Handlers) GetActiveDomain ¶
func (*Handlers) LoginRequestCallbackHandler ¶
func (s *Handlers) LoginRequestCallbackHandler() http.HandlerFunc
func (*Handlers) LoginRequestCallbackHandler_v2 ¶
func (s *Handlers) LoginRequestCallbackHandler_v2(fn NewUserLoginHandlerFunc, redirectUrl string) http.HandlerFunc
func (*Handlers) Logout ¶
func (s *Handlers) Logout() http.HandlerFunc
func (*Handlers) Refresh ¶
func (svc *Handlers) Refresh() http.HandlerFunc
type JSONResponse ¶
type LoginRequest ¶
type Middlewares ¶
type Middlewares struct {
// contains filtered or unexported fields
}
func (*Middlewares) AddLoggedInUserDetails ¶
func (s *Middlewares) AddLoggedInUserDetails(h http.Handler) http.Handler
func (*Middlewares) LoginRequired ¶
func (s *Middlewares) LoginRequired(h http.Handler) http.Handler
type NewUserLoginHandlerFunc ¶
type User ¶
type User struct { gorm.Model ID int64 SID string `gorm:"uniqueIndex;size:255" json:"-"` GUID string `gorm:"uniqueIndex;size:255" json:"global_id"` Username string `gorm:"uniqueIndex;size:255"` Firstname string `json:"firstname"` Lastname string `json:"lastname"` FullName string `json:"fullname"` Email string `gorm:"uniqueIndex;size:255" json:"email"` Password []byte `json:"-"` Active bool Locked bool ExpiryDate time.Time AuthenticationSystem string EnableTOTP bool TOTPSecret string TOTPSecretLength int64 IAMRoles map[string]map[string]bool `gorm:"-" json:"iam_roles"` Attributes map[string]string `gorm:"-" json:"attributes"` UserMessage string `json:"message,omitempty"` ActiveDomain string `gorm:"-"` }
func (*User) HasPriviledge ¶
type UserAttribute ¶
Click to show internal directories.
Click to hide internal directories.