Documentation ¶
Index ¶
- Constants
- func NewIpaClient(withKeytab bool) *ipa.Client
- type ApiKeyClient
- type AppContext
- func (app *AppContext) GetSession(r *http.Request) (*sessions.Session, error)
- func (app *AppContext) GetUser(r *http.Request) *ipa.UserRecord
- func (app *AppContext) GetWYAF(session *sessions.Session) string
- func (app *AppContext) RenderError(w http.ResponseWriter, status int)
- func (app *AppContext) RenderNotFound(w http.ResponseWriter)
- func (app *AppContext) RenderTemplate(w http.ResponseWriter, name string, data map[string]interface{})
- func (a *AppContext) SendEmail(email, subject, template string, data map[string]interface{}) error
Constants ¶
View Source
const ( CookieKeySession = "mokey-sessck" CookieKeyAuthenticated = "authenticated" CookieKeySID = "sid" CookieKeyUser = "user" CookieKeyWYAF = "wyaf" ContextKeyUser = "user" ContextKeyApi = "apikey" CSRFFieldName = "auth_tok" TokenRegex = `[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\-\_\.]+` ResetSalt = "resetpw" AccountSetupSalt = "acctsetup" )
Variables ¶
This section is empty.
Functions ¶
func NewIpaClient ¶
func NewIpaClient(withKeytab bool) *ipa.Client
Types ¶
type ApiKeyClient ¶ added in v0.0.6
type AppContext ¶
type AppContext struct { DB *sqlx.DB HydraClient *sdk.Client ApiClients map[string]*ApiKeyClient Tmpldir string // contains filtered or unexported fields }
func NewAppContext ¶
func NewAppContext() (*AppContext, error)
func (*AppContext) GetSession ¶
Get the session
func (*AppContext) GetUser ¶
func (app *AppContext) GetUser(r *http.Request) *ipa.UserRecord
Get the user from the request context
func (*AppContext) GetWYAF ¶ added in v0.0.6
func (app *AppContext) GetWYAF(session *sessions.Session) string
Get WYAF from session
func (*AppContext) RenderError ¶
func (app *AppContext) RenderError(w http.ResponseWriter, status int)
Render error template and write HTTP status
func (*AppContext) RenderNotFound ¶
func (app *AppContext) RenderNotFound(w http.ResponseWriter)
Render 404 template
func (*AppContext) RenderTemplate ¶
func (app *AppContext) RenderTemplate(w http.ResponseWriter, name string, data map[string]interface{})
Render template t using template parameters in data.
Click to show internal directories.
Click to hide internal directories.