Documentation ¶
Index ¶
- type AuthValidator
- type BasicAuth
- type Context
- func (c *Context) Admin() bool
- func (c *Context) ApproveConsent(u *core.User, challenge string) (rdr string, err error)
- func (c *Context) ApproveLogin(u *core.User, challenge string) (rdr string, err error)
- func (c *Context) CheckXsrf() (ok bool)
- func (c *Context) Consent(challenge string) (cr *client.ConsentRequest, err error)
- func (c *Context) Error(i interface{})
- func (c *Context) Exec()
- func (c *Context) Forbidden()
- func (c *Context) Form(name string) string
- func (c *Context) FormSlice(name string) []string
- func (c *Context) Forwarded() (ret string)
- func (c *Context) LogSetCookie(err error, msg string)
- func (c *Context) LoggedOn() (ok bool)
- func (c *Context) Login(u *core.User, remember string)
- func (c *Context) Method() string
- func (c *Context) NotFound()
- func (c *Context) Path() string
- func (c *Context) PlainForbidden()
- func (c *Context) PlainOK()
- func (c *Context) PlainUnauthorized()
- func (c *Context) Query(name string) string
- func (c *Context) Redirect(uri string, code int)
- func (c *Context) RejectConsent(challenge string) (rdr string, err error)
- func (c *Context) Remember() string
- func (c *Context) RevokeSession(user, client string, all bool) (err error)
- func (c *Context) Sessions(user string) (m map[string]sess, err error)
- func (c *Context) SetCookie(claims jwt.Claims, d time.Duration)
- func (c *Context) SetHeader(name, value string)
- func (c *Context) Template(name string)
- func (c *Context) Totp() string
- func (c *Context) User() string
- func (c *Context) Var(name string) (ret string)
- type DBLoginValidator
- type Server
- type TemplateStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthValidator ¶
type BasicAuth ¶
type BasicAuth struct {
// contains filtered or unexported fields
}
func NewBasicAuth ¶
func NewBasicAuth(auth AuthValidator) (*BasicAuth, error)
type Context ¶
type Context struct { Request *http.Request Response http.ResponseWriter Srv *Server T *template.Template Status int Err error Time time.Time Token jwt.Token Data webData // contains filtered or unexported fields }
func (*Context) ApproveConsent ¶
func (*Context) ApproveLogin ¶
func (*Context) Consent ¶
func (c *Context) Consent(challenge string) (cr *client.ConsentRequest, err error)
func (*Context) LogSetCookie ¶
func (*Context) PlainForbidden ¶
func (c *Context) PlainForbidden()
func (*Context) PlainUnauthorized ¶
func (c *Context) PlainUnauthorized()
func (*Context) RejectConsent ¶
func (*Context) RevokeSession ¶
type DBLoginValidator ¶
type DBLoginValidator struct {
// contains filtered or unexported fields
}
func NewDBLoginValidator ¶
func NewDBLoginValidator(db *db.DB) *DBLoginValidator
func (*DBLoginValidator) Login ¶
func (val *DBLoginValidator) Login(username, password string) bool
type Server ¶
type TemplateStore ¶
type TemplateStore struct {
// contains filtered or unexported fields
}
func NewTemplateStore ¶
func NewTemplateStore() *TemplateStore
Click to show internal directories.
Click to hide internal directories.