mirror of
https://github.com/volatiletech/authboss.git
synced 2025-02-03 13:21:22 +02:00
Destroy a list of go lint errors.
This commit is contained in:
parent
ae71333bfe
commit
99d0af8b72
10
README.md
10
README.md
@ -48,10 +48,10 @@ The amount of code necessary to start and configure authboss is fairly minimal,
|
||||
your storer, cookie storer, session storer, xsrf maker implementations.
|
||||
|
||||
```go
|
||||
authboss.Cfg = authboss.NewConfig()
|
||||
// Do all configuration here
|
||||
authboss.MountPath = "/authboss"
|
||||
authboss.LogWriter = os.Stdout
|
||||
// Do all configuration here (authboss.Cfg is a global
|
||||
// config created automatically at runtime)
|
||||
authboss.Cfg.MountPath = "/authboss"
|
||||
authboss.Cfg.LogWriter = os.Stdout
|
||||
|
||||
if err := authboss.Init(); err != nil {
|
||||
// Handle error, don't let program continue to run
|
||||
@ -413,4 +413,4 @@ Recover Email (txt) | recover_email.txt.tpl
|
||||
- [Login](https://github.com/go-authboss/authboss-sample/blob/master/ab_views/login.html.tpl)
|
||||
- [Recover](https://github.com/go-authboss/authboss-sample/blob/master/ab_views/recover.html.tpl)
|
||||
- [Recover New Password](https://github.com/go-authboss/authboss-sample/blob/master/ab_views/recover_complete.html.tpl)
|
||||
- [Register](https://github.com/go-authboss/authboss-sample/blob/master/ab_views/register.html.tpl)
|
||||
- [Register](https://github.com/go-authboss/authboss-sample/blob/master/ab_views/register.html.tpl)
|
||||
|
@ -22,13 +22,15 @@ func init() {
|
||||
authboss.RegisterModule("auth", &Auth{})
|
||||
}
|
||||
|
||||
// Auth module
|
||||
type Auth struct {
|
||||
templates render.Templates
|
||||
}
|
||||
|
||||
// Initialize module
|
||||
func (a *Auth) Initialize() (err error) {
|
||||
if authboss.Cfg.Storer == nil {
|
||||
return errors.New("auth: Need a Storer.")
|
||||
return errors.New("auth: Need a Storer")
|
||||
}
|
||||
|
||||
if len(authboss.Cfg.XSRFName) == 0 {
|
||||
@ -47,6 +49,7 @@ func (a *Auth) Initialize() (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Routes for the module
|
||||
func (a *Auth) Routes() authboss.RouteTable {
|
||||
return authboss.RouteTable{
|
||||
"/login": a.loginHandlerFunc,
|
||||
@ -54,6 +57,7 @@ func (a *Auth) Routes() authboss.RouteTable {
|
||||
}
|
||||
}
|
||||
|
||||
// Storage requirements
|
||||
func (a *Auth) Storage() authboss.StorageOptions {
|
||||
return authboss.StorageOptions{
|
||||
authboss.Cfg.PrimaryID: authboss.String,
|
||||
|
@ -82,6 +82,7 @@ type Callbacks struct {
|
||||
}
|
||||
|
||||
// NewCallbacks creates a new set of before and after callbacks.
|
||||
// Called only by authboss internals and for testing.
|
||||
func NewCallbacks() *Callbacks {
|
||||
return &Callbacks{
|
||||
make(map[Event][]Before),
|
||||
|
@ -5,7 +5,7 @@ import "net/http"
|
||||
const (
|
||||
// SessionKey is the primarily used key by authboss.
|
||||
SessionKey = "uid"
|
||||
// HalfAuthKey is used for sessions that have been authenticated by
|
||||
// SessionHalfAuthKey is used for sessions that have been authenticated by
|
||||
// the remember module. This serves as a way to force full authentication
|
||||
// by denying half-authed users acccess to sensitive areas.
|
||||
SessionHalfAuthKey = "halfauth"
|
||||
|
@ -119,6 +119,8 @@ type Config struct {
|
||||
|
||||
// NewConfig creates a config full of healthy default values.
|
||||
// Notable exceptions to default values are the Storers.
|
||||
// This method is called automatically on startup and is set to authboss.Cfg
|
||||
// so implementers need not call it. Primarily exported for testing.
|
||||
func NewConfig() *Config {
|
||||
return &Config{
|
||||
MountPath: "/",
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
"gopkg.in/authboss.v0/internal/render"
|
||||
)
|
||||
|
||||
// Storer and FormValue constants
|
||||
const (
|
||||
StoreConfirmToken = "confirm_token"
|
||||
StoreConfirmed = "confirmed"
|
||||
@ -43,16 +44,18 @@ func init() {
|
||||
authboss.RegisterModule("confirm", &Confirm{})
|
||||
}
|
||||
|
||||
// Confirm module
|
||||
type Confirm struct {
|
||||
emailHTMLTemplates render.Templates
|
||||
emailTextTemplates render.Templates
|
||||
}
|
||||
|
||||
// Initialize the module
|
||||
func (c *Confirm) Initialize() (err error) {
|
||||
var ok bool
|
||||
storer, ok := authboss.Cfg.Storer.(ConfirmStorer)
|
||||
if storer == nil || !ok {
|
||||
return errors.New("confirm: Need a ConfirmStorer.")
|
||||
return errors.New("confirm: Need a ConfirmStorer")
|
||||
}
|
||||
|
||||
c.emailHTMLTemplates, err = render.LoadTemplates(authboss.Cfg.LayoutHTMLEmail, authboss.Cfg.ViewsPath, tplConfirmHTML)
|
||||
@ -64,19 +67,21 @@ func (c *Confirm) Initialize() (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
authboss.Cfg.Callbacks.Before(authboss.EventGet, c.BeforeGet)
|
||||
authboss.Cfg.Callbacks.Before(authboss.EventAuth, c.BeforeGet)
|
||||
authboss.Cfg.Callbacks.After(authboss.EventRegister, c.AfterRegister)
|
||||
authboss.Cfg.Callbacks.Before(authboss.EventGet, c.beforeGet)
|
||||
authboss.Cfg.Callbacks.Before(authboss.EventAuth, c.beforeGet)
|
||||
authboss.Cfg.Callbacks.After(authboss.EventRegister, c.afterRegister)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Routes for the module
|
||||
func (c *Confirm) Routes() authboss.RouteTable {
|
||||
return authboss.RouteTable{
|
||||
"/confirm": c.confirmHandler,
|
||||
}
|
||||
}
|
||||
|
||||
// Storage requirements
|
||||
func (c *Confirm) Storage() authboss.StorageOptions {
|
||||
return authboss.StorageOptions{
|
||||
StoreConfirmToken: authboss.String,
|
||||
@ -84,7 +89,7 @@ func (c *Confirm) Storage() authboss.StorageOptions {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Confirm) BeforeGet(ctx *authboss.Context) (authboss.Interrupt, error) {
|
||||
func (c *Confirm) beforeGet(ctx *authboss.Context) (authboss.Interrupt, error) {
|
||||
if confirmed, err := ctx.User.BoolErr(StoreConfirmed); err != nil {
|
||||
return authboss.InterruptNone, err
|
||||
} else if !confirmed {
|
||||
@ -95,7 +100,7 @@ func (c *Confirm) BeforeGet(ctx *authboss.Context) (authboss.Interrupt, error) {
|
||||
}
|
||||
|
||||
// AfterRegister ensures the account is not activated.
|
||||
func (c *Confirm) AfterRegister(ctx *authboss.Context) error {
|
||||
func (c *Confirm) afterRegister(ctx *authboss.Context) error {
|
||||
if ctx.User == nil {
|
||||
return errUserMissing
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ func TestConfirm_BeforeGet(t *testing.T) {
|
||||
c := setup()
|
||||
ctx := authboss.NewContext()
|
||||
|
||||
if _, err := c.BeforeGet(ctx); err == nil {
|
||||
if _, err := c.beforeGet(ctx); err == nil {
|
||||
t.Error("Should stop the get due to attribute missing:", err)
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ func TestConfirm_BeforeGet(t *testing.T) {
|
||||
StoreConfirmed: false,
|
||||
}
|
||||
|
||||
if interrupt, err := c.BeforeGet(ctx); interrupt != authboss.InterruptAccountNotConfirmed {
|
||||
if interrupt, err := c.beforeGet(ctx); interrupt != authboss.InterruptAccountNotConfirmed {
|
||||
t.Error("Should stop the get due to non-confirm:", interrupt)
|
||||
} else if err != nil {
|
||||
t.Error(err)
|
||||
@ -91,7 +91,7 @@ func TestConfirm_BeforeGet(t *testing.T) {
|
||||
StoreConfirmed: true,
|
||||
}
|
||||
|
||||
if interrupt, err := c.BeforeGet(ctx); interrupt != authboss.InterruptNone || err != nil {
|
||||
if interrupt, err := c.beforeGet(ctx); interrupt != authboss.InterruptNone || err != nil {
|
||||
t.Error(interrupt, err)
|
||||
}
|
||||
}
|
||||
@ -111,18 +111,18 @@ func TestConfirm_AfterRegister(t *testing.T) {
|
||||
sentEmail = true
|
||||
}
|
||||
|
||||
if err := c.AfterRegister(ctx); err != errUserMissing {
|
||||
if err := c.afterRegister(ctx); err != errUserMissing {
|
||||
t.Error("Expected it to die with user error:", err)
|
||||
}
|
||||
|
||||
ctx.User = authboss.Attributes{authboss.Cfg.PrimaryID: "username"}
|
||||
if err := c.AfterRegister(ctx); err == nil || err.(authboss.AttributeErr).Name != "email" {
|
||||
if err := c.afterRegister(ctx); err == nil || err.(authboss.AttributeErr).Name != "email" {
|
||||
t.Error("Expected it to die with e-mail address error:", err)
|
||||
}
|
||||
|
||||
ctx.User[authboss.StoreEmail] = "a@a.com"
|
||||
log.Reset()
|
||||
c.AfterRegister(ctx)
|
||||
c.afterRegister(ctx)
|
||||
if str := log.String(); !strings.Contains(str, "Subject: Confirm New Account") {
|
||||
t.Error("Expected it to send an e-mail:", str)
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// FormValue constants
|
||||
var (
|
||||
FormValueRedirect = "redir"
|
||||
FormValueOAuth2State = "state"
|
||||
@ -26,6 +27,7 @@ type Context struct {
|
||||
formValues map[string][]string
|
||||
}
|
||||
|
||||
// NewContext is exported for testing modules.
|
||||
func NewContext() *Context {
|
||||
return &Context{}
|
||||
}
|
||||
@ -76,7 +78,7 @@ func (c *Context) FirstPostFormValue(key string) (string, bool) {
|
||||
return val[0], ok
|
||||
}
|
||||
|
||||
// FirstFormValueErrr gets the first form value from a context created with a request
|
||||
// FirstFormValueErr gets the first form value from a context created with a request
|
||||
// and additionally returns an error not a bool if it's not found.
|
||||
func (c *Context) FirstFormValueErr(key string) (string, error) {
|
||||
val, ok := c.formValues[key]
|
||||
@ -88,7 +90,7 @@ func (c *Context) FirstFormValueErr(key string) (string, error) {
|
||||
return val[0], nil
|
||||
}
|
||||
|
||||
// FirstPostFormValue gets the first form value from a context created with a request.
|
||||
// FirstPostFormValueErr gets the first form value from a context created with a request.
|
||||
func (c *Context) FirstPostFormValueErr(key string) (string, error) {
|
||||
val, ok := c.postFormValues[key]
|
||||
|
||||
|
@ -10,7 +10,9 @@ type AttributeErr struct {
|
||||
GotKind string
|
||||
}
|
||||
|
||||
func MakeAttributeErr(name string, kind DataType, val interface{}) AttributeErr {
|
||||
// NewAttributeErr creates a new attribute err type. Useful for when you want
|
||||
// to have a type mismatch error.
|
||||
func NewAttributeErr(name string, kind DataType, val interface{}) AttributeErr {
|
||||
return AttributeErr{
|
||||
Name: name,
|
||||
WantKind: kind,
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
|
||||
func TestAttributeErr(t *testing.T) {
|
||||
estr := "Failed to retrieve database attribute, type was wrong: lol (want: String, got: int)"
|
||||
if str := MakeAttributeErr("lol", String, 5).Error(); str != estr {
|
||||
if str := NewAttributeErr("lol", String, 5).Error(); str != estr {
|
||||
t.Error("Error was wrong:", str)
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// mocks defines implemented interfaces for testing modules
|
||||
// Package mocks defines implemented interfaces for testing modules
|
||||
package mocks
|
||||
|
||||
import (
|
||||
@ -42,6 +42,7 @@ type MockStorer struct {
|
||||
ConfirmUserErr string
|
||||
}
|
||||
|
||||
// NewMockStorer constructor
|
||||
func NewMockStorer() *MockStorer {
|
||||
return &MockStorer{
|
||||
Users: make(map[string]authboss.Attributes),
|
||||
@ -49,6 +50,7 @@ func NewMockStorer() *MockStorer {
|
||||
}
|
||||
}
|
||||
|
||||
// Create a new user
|
||||
func (m *MockStorer) Create(key string, attr authboss.Attributes) error {
|
||||
if len(m.CreateErr) > 0 {
|
||||
return errors.New(m.CreateErr)
|
||||
@ -58,6 +60,7 @@ func (m *MockStorer) Create(key string, attr authboss.Attributes) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Put updates to a user
|
||||
func (m *MockStorer) Put(key string, attr authboss.Attributes) error {
|
||||
if len(m.PutErr) > 0 {
|
||||
return errors.New(m.PutErr)
|
||||
@ -73,6 +76,7 @@ func (m *MockStorer) Put(key string, attr authboss.Attributes) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get a user
|
||||
func (m *MockStorer) Get(key string) (result interface{}, err error) {
|
||||
if len(m.GetErr) > 0 {
|
||||
return nil, errors.New(m.GetErr)
|
||||
@ -91,6 +95,7 @@ func (m *MockStorer) Get(key string) (result interface{}, err error) {
|
||||
return u, nil
|
||||
}
|
||||
|
||||
// PutOAuth user
|
||||
func (m *MockStorer) PutOAuth(uid, provider string, attr authboss.Attributes) error {
|
||||
if len(m.PutErr) > 0 {
|
||||
return errors.New(m.PutErr)
|
||||
@ -106,6 +111,7 @@ func (m *MockStorer) PutOAuth(uid, provider string, attr authboss.Attributes) er
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetOAuth user
|
||||
func (m *MockStorer) GetOAuth(uid, provider string) (result interface{}, err error) {
|
||||
if len(m.GetErr) > 0 {
|
||||
return nil, errors.New(m.GetErr)
|
||||
@ -124,6 +130,7 @@ func (m *MockStorer) GetOAuth(uid, provider string) (result interface{}, err err
|
||||
return u, nil
|
||||
}
|
||||
|
||||
// AddToken for remember me
|
||||
func (m *MockStorer) AddToken(key, token string) error {
|
||||
if len(m.AddTokenErr) > 0 {
|
||||
return errors.New(m.AddTokenErr)
|
||||
@ -134,6 +141,7 @@ func (m *MockStorer) AddToken(key, token string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DelTokens for a user
|
||||
func (m *MockStorer) DelTokens(key string) error {
|
||||
if len(m.DelTokensErr) > 0 {
|
||||
return errors.New(m.DelTokensErr)
|
||||
@ -143,6 +151,7 @@ func (m *MockStorer) DelTokens(key string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// UseToken if it exists, deleting it in the process
|
||||
func (m *MockStorer) UseToken(givenKey, token string) (err error) {
|
||||
if len(m.UseTokenErr) > 0 {
|
||||
return errors.New(m.UseTokenErr)
|
||||
@ -159,6 +168,7 @@ func (m *MockStorer) UseToken(givenKey, token string) (err error) {
|
||||
return authboss.ErrTokenNotFound
|
||||
}
|
||||
|
||||
// RecoverUser by the token.
|
||||
func (m *MockStorer) RecoverUser(token string) (result interface{}, err error) {
|
||||
if len(m.RecoverUserErr) > 0 {
|
||||
return nil, errors.New(m.RecoverUserErr)
|
||||
@ -179,6 +189,7 @@ func (m *MockStorer) RecoverUser(token string) (result interface{}, err error) {
|
||||
return nil, authboss.ErrUserNotFound
|
||||
}
|
||||
|
||||
// ConfirmUser via their token
|
||||
func (m *MockStorer) ConfirmUser(confirmToken string) (result interface{}, err error) {
|
||||
if len(m.ConfirmUserErr) > 0 {
|
||||
return nil, errors.New(m.ConfirmUserErr)
|
||||
@ -199,24 +210,20 @@ func (m *MockStorer) ConfirmUser(confirmToken string) (result interface{}, err e
|
||||
return nil, authboss.ErrUserNotFound
|
||||
}
|
||||
|
||||
func (m *MockStorer) OAuth2NewOrUpdate(key string, attr authboss.Attributes) error {
|
||||
if len(m.CreateErr) > 0 {
|
||||
return errors.New(m.CreateErr)
|
||||
}
|
||||
|
||||
m.Users[key] = attr
|
||||
return nil
|
||||
}
|
||||
|
||||
// MockFailStorer is used for testing module initialize functions that recover more than the base storer
|
||||
type MockFailStorer struct{}
|
||||
|
||||
// Create fails
|
||||
func (_ MockFailStorer) Create(_ string, _ authboss.Attributes) error {
|
||||
return errors.New("fail storer: create")
|
||||
}
|
||||
|
||||
// Put fails
|
||||
func (_ MockFailStorer) Put(_ string, _ authboss.Attributes) error {
|
||||
return errors.New("fail storer: put")
|
||||
}
|
||||
|
||||
// Get fails
|
||||
func (_ MockFailStorer) Get(_ string) (interface{}, error) {
|
||||
return nil, errors.New("fail storer: get")
|
||||
}
|
||||
@ -227,6 +234,7 @@ type MockClientStorer struct {
|
||||
GetShouldFail bool
|
||||
}
|
||||
|
||||
// NewMockClientStorer constructs a MockClientStorer
|
||||
func NewMockClientStorer(data ...string) *MockClientStorer {
|
||||
if len(data)%2 != 0 {
|
||||
panic("It should be a key value list of arguments.")
|
||||
@ -241,6 +249,7 @@ func NewMockClientStorer(data ...string) *MockClientStorer {
|
||||
return &MockClientStorer{Values: values}
|
||||
}
|
||||
|
||||
// Get a key's value
|
||||
func (m *MockClientStorer) Get(key string) (string, bool) {
|
||||
if m.GetShouldFail {
|
||||
return "", false
|
||||
@ -249,6 +258,8 @@ func (m *MockClientStorer) Get(key string) (string, bool) {
|
||||
v, ok := m.Values[key]
|
||||
return v, ok
|
||||
}
|
||||
|
||||
// GetErr gets a key's value or err if not exist
|
||||
func (m *MockClientStorer) GetErr(key string) (string, error) {
|
||||
if m.GetShouldFail {
|
||||
return "", authboss.ClientDataErr{key}
|
||||
@ -260,8 +271,12 @@ func (m *MockClientStorer) GetErr(key string) (string, error) {
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
|
||||
// Put a value
|
||||
func (m *MockClientStorer) Put(key, val string) { m.Values[key] = val }
|
||||
func (m *MockClientStorer) Del(key string) { delete(m.Values, key) }
|
||||
|
||||
// Del a key/value pair
|
||||
func (m *MockClientStorer) Del(key string) { delete(m.Values, key) }
|
||||
|
||||
// MockRequestContext returns a new context as if it came from POST request.
|
||||
func MockRequestContext(postKeyValues ...string) *authboss.Context {
|
||||
@ -293,10 +308,12 @@ type MockMailer struct {
|
||||
SendErr string
|
||||
}
|
||||
|
||||
// NewMockMailer constructs a mock mailer
|
||||
func NewMockMailer() *MockMailer {
|
||||
return &MockMailer{}
|
||||
}
|
||||
|
||||
// Send an e-mail
|
||||
func (m *MockMailer) Send(email authboss.Email) error {
|
||||
if len(m.SendErr) > 0 {
|
||||
return errors.New(m.SendErr)
|
||||
@ -306,11 +323,13 @@ func (m *MockMailer) Send(email authboss.Email) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MockAfterCallback is a callback that knows if it was called
|
||||
type MockAfterCallback struct {
|
||||
HasBeenCalled bool
|
||||
Fn authboss.After
|
||||
}
|
||||
|
||||
// NewMockAfterCallback constructs a new mockaftercallback.
|
||||
func NewMockAfterCallback() *MockAfterCallback {
|
||||
m := MockAfterCallback{}
|
||||
|
||||
|
@ -6,11 +6,6 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
"os"
|
||||
"time"
|
||||
"io/ioutil"
|
||||
"path"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func bindata_read(data []byte, name string) ([]byte, error) {
|
||||
@ -30,227 +25,226 @@ func bindata_read(data []byte, name string) ([]byte, error) {
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
type asset struct {
|
||||
bytes []byte
|
||||
info os.FileInfo
|
||||
}
|
||||
|
||||
type bindata_file_info struct {
|
||||
name string
|
||||
size int64
|
||||
mode os.FileMode
|
||||
modTime time.Time
|
||||
}
|
||||
|
||||
func (fi bindata_file_info) Name() string {
|
||||
return fi.name
|
||||
}
|
||||
func (fi bindata_file_info) Size() int64 {
|
||||
return fi.size
|
||||
}
|
||||
func (fi bindata_file_info) Mode() os.FileMode {
|
||||
return fi.mode
|
||||
}
|
||||
func (fi bindata_file_info) ModTime() time.Time {
|
||||
return fi.modTime
|
||||
}
|
||||
func (fi bindata_file_info) IsDir() bool {
|
||||
return false
|
||||
}
|
||||
func (fi bindata_file_info) Sys() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
var _confirm_email_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb2\xc9\x30\xb4\x73\xce\xcf\x4b\xcb\x2c\xca\x55\xa8\xcc\x2f\x2d\x52\x48\x4c\x4e\xce\x2f\xcd\x2b\xb1\xd1\x07\x4a\x70\xd9\x24\x15\x29\xe8\x03\xa9\x02\xbb\x80\x9c\xd4\xc4\xe2\x54\x85\xe4\x9c\xcc\xe4\x6c\x05\x9b\x44\x85\x8c\xa2\xd4\x34\x5b\xa5\xea\x6a\xbd\xda\x5a\x25\xa0\x92\x8c\xd4\xa2\x54\x1b\xfd\x44\x3b\x85\x92\x7c\x85\x64\xac\xc6\x15\xd8\x71\x01\x02\x00\x00\xff\xff\xd9\xba\x4f\x59\x6c\x00\x00\x00")
|
||||
|
||||
func confirm_email_html_tpl_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
_confirm_email_html_tpl,
|
||||
func confirm_email_html_tpl() ([]byte, error) {
|
||||
return bindata_read([]byte{
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0xb2, 0xc9,
|
||||
0x30, 0xb4, 0x73, 0xce, 0xcf, 0x4b, 0xcb, 0x2c, 0xca, 0x55, 0xa8, 0xcc,
|
||||
0x2f, 0x2d, 0x52, 0x48, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0xb1, 0xd1,
|
||||
0x07, 0x4a, 0x70, 0xd9, 0x24, 0x15, 0x29, 0xe8, 0x03, 0xa9, 0x02, 0xbb,
|
||||
0x80, 0x9c, 0xd4, 0xc4, 0xe2, 0x54, 0x85, 0xe4, 0x9c, 0xcc, 0xe4, 0x6c,
|
||||
0x05, 0x9b, 0x44, 0x85, 0x8c, 0xa2, 0xd4, 0x34, 0x5b, 0xa5, 0xea, 0x6a,
|
||||
0xbd, 0xda, 0x5a, 0x25, 0xa0, 0x92, 0x8c, 0xd4, 0xa2, 0x54, 0x1b, 0xfd,
|
||||
0x44, 0x3b, 0x85, 0x92, 0x7c, 0x85, 0x64, 0xac, 0xc6, 0x15, 0xd8, 0x71,
|
||||
0x01, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd9, 0xba, 0x4f, 0x59, 0x6c, 0x00,
|
||||
0x00, 0x00,
|
||||
},
|
||||
"confirm_email.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func confirm_email_html_tpl() (*asset, error) {
|
||||
bytes, err := confirm_email_html_tpl_bytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindata_file_info{name: "confirm_email.html.tpl", size: 108, mode: os.FileMode(438), modTime: time.Unix(1425861488, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confirm_email_txt_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x24\xc8\xd1\x0d\x82\x40\x10\x04\xd0\x56\xa6\x02\x6b\xb1\x00\x7e\xce\x73\xd1\x8d\xeb\x0c\xd9\x5b\x42\x08\xa1\x77\x4d\xf8\x7c\xef\x1e\xd6\x86\xa1\x6b\xd9\xd1\xf8\xc4\xd2\x46\x19\xea\x6d\x98\x15\xa1\xcd\xf9\x42\x38\x3f\x70\x96\xb0\x6b\x4d\x3c\x52\xdb\xb0\xc4\xdf\x5d\x9c\x3d\xbf\xd7\xb7\xde\xb5\xb2\x26\x4e\x3c\x8e\xdb\x79\xfe\x02\x00\x00\xff\xff\x66\x27\xac\x6d\x5b\x00\x00\x00")
|
||||
|
||||
func confirm_email_txt_tpl_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
_confirm_email_txt_tpl,
|
||||
func confirm_email_txt_tpl() ([]byte, error) {
|
||||
return bindata_read([]byte{
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0x24, 0xc8,
|
||||
0xd1, 0x0d, 0x82, 0x40, 0x10, 0x04, 0xd0, 0x56, 0xa6, 0x02, 0x6b, 0xb1,
|
||||
0x00, 0x7e, 0xce, 0x73, 0xd1, 0x8d, 0xeb, 0x0c, 0xd9, 0x5b, 0x42, 0x08,
|
||||
0xa1, 0x77, 0x4d, 0xf8, 0x7c, 0xef, 0x1e, 0xd6, 0x86, 0xa1, 0x6b, 0xd9,
|
||||
0xd1, 0xf8, 0xc4, 0xd2, 0x46, 0x19, 0xea, 0x6d, 0x98, 0x15, 0xa1, 0xcd,
|
||||
0xf9, 0x42, 0x38, 0x3f, 0x70, 0x96, 0xb0, 0x6b, 0x4d, 0x3c, 0x52, 0xdb,
|
||||
0xb0, 0xc4, 0xdf, 0x5d, 0x9c, 0x3d, 0xbf, 0xd7, 0xb7, 0xde, 0xb5, 0xb2,
|
||||
0x26, 0x4e, 0x3c, 0x8e, 0xdb, 0x79, 0xfe, 0x02, 0x00, 0x00, 0xff, 0xff,
|
||||
0x66, 0x27, 0xac, 0x6d, 0x5b, 0x00, 0x00, 0x00,
|
||||
},
|
||||
"confirm_email.txt.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func confirm_email_txt_tpl() (*asset, error) {
|
||||
bytes, err := confirm_email_txt_tpl_bytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindata_file_info{name: "confirm_email.txt.tpl", size: 91, mode: os.FileMode(438), modTime: time.Unix(1425861619, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _login_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x7c\x92\xcb\x6a\xf3\x30\x10\x85\xf7\x81\xbc\x83\xd0\xfe\x8f\x5f\xc0\x36\xfc\xd0\x4d\xa1\x97\xd0\x86\x6e\x8b\x2c\x8f\x2b\x11\x4b\x63\x46\xe3\x5c\x10\x7e\xf7\x5a\xb5\xd3\xc4\xa5\xd4\x2b\xeb\x9c\xd1\x99\x4f\x23\xc5\xb8\x69\x5a\x15\xcc\x7b\xe8\xb5\x86\x10\x86\x61\xbd\xca\x1b\x24\x27\x94\x66\x8b\xbe\x90\x31\x3a\xec\x3d\x77\x8a\x0d\xd4\x42\xb6\xf8\x61\xbd\x1c\x06\x29\x1c\xb0\xc1\xba\x90\xdb\xe7\xd7\x9d\x2c\xd7\x2b\x31\x7e\x31\xda\x46\x6c\x80\x08\x69\x18\xc6\xec\xf9\x2f\xaf\x48\x64\x65\x8c\xe0\xeb\xd4\x20\x55\xe6\xd6\x77\x3d\x0b\x3e\x77\x50\x48\x86\x13\x4b\xa1\x47\x90\x50\xc8\xd4\xfd\x9f\x46\xcf\x84\xad\x14\x5e\x39\x48\x10\x9b\x8e\xac\x53\x74\xbe\xbf\x4b\xbd\xbb\x56\x69\x30\xd8\xd6\x40\xc9\x64\xcb\x2d\x88\x65\xc9\x41\xb5\xfd\x8f\x9d\x6f\x49\x1a\xbd\x72\xe2\x59\x80\xcc\x24\xdd\x88\x70\x44\xaa\xff\xa4\xb9\x16\x2d\x38\xb6\x17\xf9\xb7\xfc\x29\xde\xd8\xba\x06\x7f\x73\xaa\x53\xa0\xe6\x69\x5c\x2c\x89\x93\xba\xc3\x3d\xf8\x24\x67\x8b\xd9\x06\x83\xc7\x17\x70\xe0\x2a\x48\x83\xbd\x0d\xd7\x06\xf4\xbe\xc2\xd3\x25\x9e\xdc\x77\x26\x53\x0f\xb2\x14\x97\x8d\xe2\x11\x96\x97\x51\xf5\xcc\xe8\xe7\x9c\xd0\x57\xce\xb2\x2c\x1f\xd2\x55\xe7\xd9\xe4\x2d\xce\x74\x8b\xa2\xf1\xf0\x45\xa2\x84\x21\x68\x0a\x99\xd1\x24\xc9\x72\xf6\xc4\x7f\xad\xd3\x0b\xca\x33\x75\x7d\x02\x79\x96\x06\x5b\x7e\x06\x00\x00\xff\xff\x65\x0d\x58\xda\x7f\x02\x00\x00")
|
||||
|
||||
func login_html_tpl_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
_login_html_tpl,
|
||||
func login_html_tpl() ([]byte, error) {
|
||||
return bindata_read([]byte{
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0x7c, 0x92,
|
||||
0xcb, 0x6a, 0xf3, 0x30, 0x10, 0x85, 0xf7, 0x81, 0xbc, 0x83, 0xd0, 0xfe,
|
||||
0x8f, 0x5f, 0xc0, 0x36, 0xfc, 0xd0, 0x4d, 0xa1, 0x97, 0xd0, 0x86, 0x6e,
|
||||
0x8b, 0x2c, 0x8f, 0x2b, 0x11, 0x4b, 0x63, 0x46, 0xe3, 0x5c, 0x10, 0x7e,
|
||||
0xf7, 0x5a, 0xb5, 0xd3, 0xc4, 0xa5, 0xd4, 0x2b, 0xeb, 0x9c, 0xd1, 0x99,
|
||||
0x4f, 0x23, 0xc5, 0xb8, 0x69, 0x5a, 0x15, 0xcc, 0x7b, 0xe8, 0xb5, 0x86,
|
||||
0x10, 0x86, 0x61, 0xbd, 0xca, 0x1b, 0x24, 0x27, 0x94, 0x66, 0x8b, 0xbe,
|
||||
0x90, 0x31, 0x3a, 0xec, 0x3d, 0x77, 0x8a, 0x0d, 0xd4, 0x42, 0xb6, 0xf8,
|
||||
0x61, 0xbd, 0x1c, 0x06, 0x29, 0x1c, 0xb0, 0xc1, 0xba, 0x90, 0xdb, 0xe7,
|
||||
0xd7, 0x9d, 0x2c, 0xd7, 0x2b, 0x31, 0x7e, 0x31, 0xda, 0x46, 0x6c, 0x80,
|
||||
0x08, 0x69, 0x18, 0xc6, 0xec, 0xf9, 0x2f, 0xaf, 0x48, 0x64, 0x65, 0x8c,
|
||||
0xe0, 0xeb, 0xd4, 0x20, 0x55, 0xe6, 0xd6, 0x77, 0x3d, 0x0b, 0x3e, 0x77,
|
||||
0x50, 0x48, 0x86, 0x13, 0x4b, 0xa1, 0x47, 0x90, 0x50, 0xc8, 0xd4, 0xfd,
|
||||
0x9f, 0x46, 0xcf, 0x84, 0xad, 0x14, 0x5e, 0x39, 0x48, 0x10, 0x9b, 0x8e,
|
||||
0xac, 0x53, 0x74, 0xbe, 0xbf, 0x4b, 0xbd, 0xbb, 0x56, 0x69, 0x30, 0xd8,
|
||||
0xd6, 0x40, 0xc9, 0x64, 0xcb, 0x2d, 0x88, 0x65, 0xc9, 0x41, 0xb5, 0xfd,
|
||||
0x8f, 0x9d, 0x6f, 0x49, 0x1a, 0xbd, 0x72, 0xe2, 0x59, 0x80, 0xcc, 0x24,
|
||||
0xdd, 0x88, 0x70, 0x44, 0xaa, 0xff, 0xa4, 0xb9, 0x16, 0x2d, 0x38, 0xb6,
|
||||
0x17, 0xf9, 0xb7, 0xfc, 0x29, 0xde, 0xd8, 0xba, 0x06, 0x7f, 0x73, 0xaa,
|
||||
0x53, 0xa0, 0xe6, 0x69, 0x5c, 0x2c, 0x89, 0x93, 0xba, 0xc3, 0x3d, 0xf8,
|
||||
0x24, 0x67, 0x8b, 0xd9, 0x06, 0x83, 0xc7, 0x17, 0x70, 0xe0, 0x2a, 0x48,
|
||||
0x83, 0xbd, 0x0d, 0xd7, 0x06, 0xf4, 0xbe, 0xc2, 0xd3, 0x25, 0x9e, 0xdc,
|
||||
0x77, 0x26, 0x53, 0x0f, 0xb2, 0x14, 0x97, 0x8d, 0xe2, 0x11, 0x96, 0x97,
|
||||
0x51, 0xf5, 0xcc, 0xe8, 0xe7, 0x9c, 0xd0, 0x57, 0xce, 0xb2, 0x2c, 0x1f,
|
||||
0xd2, 0x55, 0xe7, 0xd9, 0xe4, 0x2d, 0xce, 0x74, 0x8b, 0xa2, 0xf1, 0xf0,
|
||||
0x45, 0xa2, 0x84, 0x21, 0x68, 0x0a, 0x99, 0xd1, 0x24, 0xc9, 0x72, 0xf6,
|
||||
0xc4, 0x7f, 0xad, 0xd3, 0x0b, 0xca, 0x33, 0x75, 0x7d, 0x02, 0x79, 0x96,
|
||||
0x06, 0x5b, 0x7e, 0x06, 0x00, 0x00, 0xff, 0xff, 0x65, 0x0d, 0x58, 0xda,
|
||||
0x7f, 0x02, 0x00, 0x00,
|
||||
},
|
||||
"login.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func login_html_tpl() (*asset, error) {
|
||||
bytes, err := login_html_tpl_bytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindata_file_info{name: "login.html.tpl", size: 639, mode: os.FileMode(438), modTime: time.Unix(1424982621, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _recover_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x52\x4d\x6f\xe2\x30\x10\xbd\xf3\x2b\x46\x16\x7b\x25\xf7\x95\x93\x0b\x7b\xd9\x4b\x8b\x5a\xd4\x6b\x65\x92\x09\xb1\x6a\x8f\x2d\x67\x42\x41\x6e\xfe\x7b\x6d\x82\x10\xb4\x12\xa8\x87\xe6\x90\xcc\xc7\x7b\x6f\x32\x4f\x23\x5b\x17\x2c\xa8\x9a\xb5\xa3\x52\xc4\x68\xdd\x40\xec\x15\x77\xd8\x80\x08\x58\xbb\x1d\x06\x31\x8e\x02\x2c\x72\xe7\x9a\x52\xac\x1e\x9f\xd7\xa2\x9a\x41\x7a\xa4\x26\x3f\x30\xf0\xc1\x63\x29\x18\xf7\x2c\x80\x94\xc5\x2c\xb3\xf0\x41\x5b\x15\x0e\xff\xff\x65\xae\x37\xaa\xc6\xce\x99\x06\x43\x6e\xb2\x66\x83\x70\x0d\xd9\x29\x33\x7c\x61\xbe\xe4\x52\xee\x15\x95\xdc\x84\xf4\x3e\x0e\x8d\x71\xee\x75\x03\x7f\xcb\x2b\x81\x18\xdf\x35\x77\xb0\xc0\x10\xfa\x73\x36\x4f\x99\xd1\x3d\x67\xb0\xa6\x06\xf7\xb0\x80\x4c\xce\x80\xa0\x68\x8b\x67\xc4\x38\xca\xde\x2b\xaa\xd2\xf8\x14\x16\xc7\x78\x9a\x19\x23\xd2\x91\x70\xf9\xb9\xbd\x7d\xed\xa8\xd5\xc1\xbe\xde\x74\x61\x39\x81\xe0\x9e\x1b\x27\xb1\xd5\x5d\x53\xea\x6f\xae\xc0\x07\xa4\x98\xb8\x85\xf3\x2f\xfd\xe9\xc5\x4f\xbc\xaa\x7f\xc7\xac\x4e\x37\x0d\xd2\xc5\xb1\xec\xfb\xd0\x3e\xa4\xe4\x7a\xf5\x5c\x5d\xbb\x37\xa4\x69\xdd\x49\x67\x33\x30\x3b\x3a\x09\xf5\xc3\xc6\x6a\x16\xd5\xd3\x74\xa7\xb2\x98\xba\x97\xce\x48\x05\x5d\xc0\xb6\x14\x85\x71\x5b\x4d\xa2\x5a\x2a\xaa\xd1\xc8\x42\x55\x33\x59\xe4\xe3\xaf\x3e\x03\x00\x00\xff\xff\xa8\x01\x1f\xc8\x03\x03\x00\x00")
|
||||
|
||||
func recover_html_tpl_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
_recover_html_tpl,
|
||||
func recover_html_tpl() ([]byte, error) {
|
||||
return bindata_read([]byte{
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0xb4, 0x52,
|
||||
0x4d, 0x6f, 0xe2, 0x30, 0x10, 0xbd, 0xf3, 0x2b, 0x46, 0x16, 0x7b, 0x25,
|
||||
0xf7, 0x95, 0x93, 0x0b, 0x7b, 0xd9, 0x4b, 0x8b, 0x5a, 0xd4, 0x6b, 0x65,
|
||||
0x92, 0x09, 0xb1, 0x6a, 0x8f, 0x2d, 0x67, 0x42, 0x41, 0x6e, 0xfe, 0x7b,
|
||||
0x6d, 0x82, 0x10, 0xb4, 0x12, 0xa8, 0x87, 0xe6, 0x90, 0xcc, 0xc7, 0x7b,
|
||||
0x6f, 0x32, 0x4f, 0x23, 0x5b, 0x17, 0x2c, 0xa8, 0x9a, 0xb5, 0xa3, 0x52,
|
||||
0xc4, 0x68, 0xdd, 0x40, 0xec, 0x15, 0x77, 0xd8, 0x80, 0x08, 0x58, 0xbb,
|
||||
0x1d, 0x06, 0x31, 0x8e, 0x02, 0x2c, 0x72, 0xe7, 0x9a, 0x52, 0xac, 0x1e,
|
||||
0x9f, 0xd7, 0xa2, 0x9a, 0x41, 0x7a, 0xa4, 0x26, 0x3f, 0x30, 0xf0, 0xc1,
|
||||
0x63, 0x29, 0x18, 0xf7, 0x2c, 0x80, 0x94, 0xc5, 0x2c, 0xb3, 0xf0, 0x41,
|
||||
0x5b, 0x15, 0x0e, 0xff, 0xff, 0x65, 0xae, 0x37, 0xaa, 0xc6, 0xce, 0x99,
|
||||
0x06, 0x43, 0x6e, 0xb2, 0x66, 0x83, 0x70, 0x0d, 0xd9, 0x29, 0x33, 0x7c,
|
||||
0x61, 0xbe, 0xe4, 0x52, 0xee, 0x15, 0x95, 0xdc, 0x84, 0xf4, 0x3e, 0x0e,
|
||||
0x8d, 0x71, 0xee, 0x75, 0x03, 0x7f, 0xcb, 0x2b, 0x81, 0x18, 0xdf, 0x35,
|
||||
0x77, 0xb0, 0xc0, 0x10, 0xfa, 0x73, 0x36, 0x4f, 0x99, 0xd1, 0x3d, 0x67,
|
||||
0xb0, 0xa6, 0x06, 0xf7, 0xb0, 0x80, 0x4c, 0xce, 0x80, 0xa0, 0x68, 0x8b,
|
||||
0x67, 0xc4, 0x38, 0xca, 0xde, 0x2b, 0xaa, 0xd2, 0xf8, 0x14, 0x16, 0xc7,
|
||||
0x78, 0x9a, 0x19, 0x23, 0xd2, 0x91, 0x70, 0xf9, 0xb9, 0xbd, 0x7d, 0xed,
|
||||
0xa8, 0xd5, 0xc1, 0xbe, 0xde, 0x74, 0x61, 0x39, 0x81, 0xe0, 0x9e, 0x1b,
|
||||
0x27, 0xb1, 0xd5, 0x5d, 0x53, 0xea, 0x6f, 0xae, 0xc0, 0x07, 0xa4, 0x98,
|
||||
0xb8, 0x85, 0xf3, 0x2f, 0xfd, 0xe9, 0xc5, 0x4f, 0xbc, 0xaa, 0x7f, 0xc7,
|
||||
0xac, 0x4e, 0x37, 0x0d, 0xd2, 0xc5, 0xb1, 0xec, 0xfb, 0xd0, 0x3e, 0xa4,
|
||||
0xe4, 0x7a, 0xf5, 0x5c, 0x5d, 0xbb, 0x37, 0xa4, 0x69, 0xdd, 0x49, 0x67,
|
||||
0x33, 0x30, 0x3b, 0x3a, 0x09, 0xf5, 0xc3, 0xc6, 0x6a, 0x16, 0xd5, 0xd3,
|
||||
0x74, 0xa7, 0xb2, 0x98, 0xba, 0x97, 0xce, 0x48, 0x05, 0x5d, 0xc0, 0xb6,
|
||||
0x14, 0x85, 0x71, 0x5b, 0x4d, 0xa2, 0x5a, 0x2a, 0xaa, 0xd1, 0xc8, 0x42,
|
||||
0x55, 0x33, 0x59, 0xe4, 0xe3, 0xaf, 0x3e, 0x03, 0x00, 0x00, 0xff, 0xff,
|
||||
0xa8, 0x01, 0x1f, 0xc8, 0x03, 0x03, 0x00, 0x00,
|
||||
},
|
||||
"recover.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func recover_html_tpl() (*asset, error) {
|
||||
bytes, err := recover_html_tpl_bytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindata_file_info{name: "recover.html.tpl", size: 771, mode: os.FileMode(438), modTime: time.Unix(1425014937, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _recover_complete_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x52\xc1\x6e\xeb\x20\x10\xbc\xe7\x2b\x10\x7a\xe7\x70\x7f\xc2\xbe\xe4\xde\x46\x6d\xee\x15\x31\xeb\x18\x15\x16\x04\xeb\x24\x95\xe5\x7f\x2f\xc4\x49\x9c\xb6\xa9\x7a\xa8\xea\x8b\x99\x65\x67\x86\x91\x46\xb6\x3e\x3a\xa6\x1a\x32\x1e\x2b\x3e\x0c\xce\xf7\x48\x41\x51\x07\x9a\xf1\x08\x8d\xdf\x43\x14\x8d\x77\xc1\x02\x01\x1f\x47\xce\x1c\x50\xe7\x75\xc5\xd7\x8f\xcf\x1b\x5e\x2f\x58\xfe\xa4\xc1\xd0\x13\xa3\xb7\x00\x15\xef\x8c\xd6\x80\x9c\xa1\x72\x19\x91\x7f\x2d\x60\xaf\x6c\x0f\x45\x7f\x79\x1a\x14\x1d\x71\x87\x1b\x54\x4a\x07\x1f\xf5\x85\x3d\xe3\x60\x55\x03\x9d\xb7\x1a\x62\xb6\xbe\x8e\x67\xdd\xcb\xea\x24\x2d\xb7\xf1\x62\x30\x0c\x07\x43\x1d\x5b\x42\x8c\x69\x1c\xcf\xe8\x5f\x46\xd6\x24\x62\xff\x2b\x66\x50\xc3\x91\x2d\xd9\xec\x56\xd6\xa2\xc2\x1d\x5c\xf7\xc6\x51\xa6\xa0\xb0\xce\x46\xf9\x28\x4e\xe7\xc9\x63\x18\x00\x75\x21\xdc\xfe\x7e\x4e\xd6\x78\x6c\x4d\x74\x2f\xdf\x24\x5c\x4d\xd7\xec\x5e\xd2\x33\x75\xfd\xfb\xc0\x5f\x1e\xf1\x07\xc1\x3f\xd6\x21\xcb\x1c\x53\x6c\x1f\x32\x28\xef\x9e\x43\x95\xe9\xe6\x73\x35\xb6\x3d\x91\xc7\xb3\x50\xea\xb7\xce\x10\xaf\x9f\xa6\x52\x4a\x31\xdd\xde\x26\x97\x8a\x75\x11\xda\x8a\x0b\xeb\x77\x06\x79\xbd\x52\xd8\x80\x95\x42\xd5\x0b\x29\x4a\xd3\xeb\xf7\x00\x00\x00\xff\xff\xba\x89\x7e\x9e\xf0\x02\x00\x00")
|
||||
|
||||
func recover_complete_html_tpl_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
_recover_complete_html_tpl,
|
||||
func recover_complete_html_tpl() ([]byte, error) {
|
||||
return bindata_read([]byte{
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0xb4, 0x52,
|
||||
0xc1, 0x6e, 0xeb, 0x20, 0x10, 0xbc, 0xe7, 0x2b, 0x10, 0x7a, 0xe7, 0x70,
|
||||
0x7f, 0xc2, 0xbe, 0xe4, 0xde, 0x46, 0x6d, 0xee, 0x15, 0x31, 0xeb, 0x18,
|
||||
0x15, 0x16, 0x04, 0xeb, 0x24, 0x95, 0xe5, 0x7f, 0x2f, 0xc4, 0x49, 0x9c,
|
||||
0xb6, 0xa9, 0x7a, 0xa8, 0xea, 0x8b, 0x99, 0x65, 0x67, 0x86, 0x91, 0x46,
|
||||
0xb6, 0x3e, 0x3a, 0xa6, 0x1a, 0x32, 0x1e, 0x2b, 0x3e, 0x0c, 0xce, 0xf7,
|
||||
0x48, 0x41, 0x51, 0x07, 0x9a, 0xf1, 0x08, 0x8d, 0xdf, 0x43, 0x14, 0x8d,
|
||||
0x77, 0xc1, 0x02, 0x01, 0x1f, 0x47, 0xce, 0x1c, 0x50, 0xe7, 0x75, 0xc5,
|
||||
0xd7, 0x8f, 0xcf, 0x1b, 0x5e, 0x2f, 0x58, 0xfe, 0xa4, 0xc1, 0xd0, 0x13,
|
||||
0xa3, 0xb7, 0x00, 0x15, 0xef, 0x8c, 0xd6, 0x80, 0x9c, 0xa1, 0x72, 0x19,
|
||||
0x91, 0x7f, 0x2d, 0x60, 0xaf, 0x6c, 0x0f, 0x45, 0x7f, 0x79, 0x1a, 0x14,
|
||||
0x1d, 0x71, 0x87, 0x1b, 0x54, 0x4a, 0x07, 0x1f, 0xf5, 0x85, 0x3d, 0xe3,
|
||||
0x60, 0x55, 0x03, 0x9d, 0xb7, 0x1a, 0x62, 0xb6, 0xbe, 0x8e, 0x67, 0xdd,
|
||||
0xcb, 0xea, 0x24, 0x2d, 0xb7, 0xf1, 0x62, 0x30, 0x0c, 0x07, 0x43, 0x1d,
|
||||
0x5b, 0x42, 0x8c, 0x69, 0x1c, 0xcf, 0xe8, 0x5f, 0x46, 0xd6, 0x24, 0x62,
|
||||
0xff, 0x2b, 0x66, 0x50, 0xc3, 0x91, 0x2d, 0xd9, 0xec, 0x56, 0xd6, 0xa2,
|
||||
0xc2, 0x1d, 0x5c, 0xf7, 0xc6, 0x51, 0xa6, 0xa0, 0xb0, 0xce, 0x46, 0xf9,
|
||||
0x28, 0x4e, 0xe7, 0xc9, 0x63, 0x18, 0x00, 0x75, 0x21, 0xdc, 0xfe, 0x7e,
|
||||
0x4e, 0xd6, 0x78, 0x6c, 0x4d, 0x74, 0x2f, 0xdf, 0x24, 0x5c, 0x4d, 0xd7,
|
||||
0xec, 0x5e, 0xd2, 0x33, 0x75, 0xfd, 0xfb, 0xc0, 0x5f, 0x1e, 0xf1, 0x07,
|
||||
0xc1, 0x3f, 0xd6, 0x21, 0xcb, 0x1c, 0x53, 0x6c, 0x1f, 0x32, 0x28, 0xef,
|
||||
0x9e, 0x43, 0x95, 0xe9, 0xe6, 0x73, 0x35, 0xb6, 0x3d, 0x91, 0xc7, 0xb3,
|
||||
0x50, 0xea, 0xb7, 0xce, 0x10, 0xaf, 0x9f, 0xa6, 0x52, 0x4a, 0x31, 0xdd,
|
||||
0xde, 0x26, 0x97, 0x8a, 0x75, 0x11, 0xda, 0x8a, 0x0b, 0xeb, 0x77, 0x06,
|
||||
0x79, 0xbd, 0x52, 0xd8, 0x80, 0x95, 0x42, 0xd5, 0x0b, 0x29, 0x4a, 0xd3,
|
||||
0xeb, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0x89, 0x7e, 0x9e, 0xf0,
|
||||
0x02, 0x00, 0x00,
|
||||
},
|
||||
"recover_complete.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func recover_complete_html_tpl() (*asset, error) {
|
||||
bytes, err := recover_complete_html_tpl_bytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindata_file_info{name: "recover_complete.html.tpl", size: 752, mode: os.FileMode(438), modTime: time.Unix(1425060725, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _recover_email_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb2\xc9\x30\xb4\x0b\x4a\x4d\xce\x2f\x4b\x2d\x52\xa8\xcc\x2f\x2d\x52\x48\x4c\x4e\xce\x2f\xcd\x2b\xb1\xd1\x07\x4a\x70\xd9\x24\x15\x29\xe8\x03\xa9\x02\xbb\x80\x9c\xd4\xc4\xe2\x54\x85\xe4\x9c\xcc\xe4\x6c\x05\x9b\x44\x85\x8c\xa2\xd4\x34\x5b\xa5\xea\x6a\xbd\xda\x5a\x25\xa0\x92\x8c\xd4\xa2\x54\x1b\xfd\x44\x3b\x85\x92\x7c\x85\x22\xac\xc6\x15\xd8\x71\x01\x02\x00\x00\xff\xff\x9d\xc9\x73\xb1\x6c\x00\x00\x00")
|
||||
|
||||
func recover_email_html_tpl_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
_recover_email_html_tpl,
|
||||
func recover_email_html_tpl() ([]byte, error) {
|
||||
return bindata_read([]byte{
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0xb2, 0xc9,
|
||||
0x30, 0xb4, 0x0b, 0x4a, 0x4d, 0xce, 0x2f, 0x4b, 0x2d, 0x52, 0xa8, 0xcc,
|
||||
0x2f, 0x2d, 0x52, 0x48, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0xb1, 0xd1,
|
||||
0x07, 0x4a, 0x70, 0xd9, 0x24, 0x15, 0x29, 0xe8, 0x03, 0xa9, 0x02, 0xbb,
|
||||
0x80, 0x9c, 0xd4, 0xc4, 0xe2, 0x54, 0x85, 0xe4, 0x9c, 0xcc, 0xe4, 0x6c,
|
||||
0x05, 0x9b, 0x44, 0x85, 0x8c, 0xa2, 0xd4, 0x34, 0x5b, 0xa5, 0xea, 0x6a,
|
||||
0xbd, 0xda, 0x5a, 0x25, 0xa0, 0x92, 0x8c, 0xd4, 0xa2, 0x54, 0x1b, 0xfd,
|
||||
0x44, 0x3b, 0x85, 0x92, 0x7c, 0x85, 0x22, 0xac, 0xc6, 0x15, 0xd8, 0x71,
|
||||
0x01, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9d, 0xc9, 0x73, 0xb1, 0x6c, 0x00,
|
||||
0x00, 0x00,
|
||||
},
|
||||
"recover_email.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func recover_email_html_tpl() (*asset, error) {
|
||||
bytes, err := recover_email_html_tpl_bytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindata_file_info{name: "recover_email.html.tpl", size: 108, mode: os.FileMode(438), modTime: time.Unix(1425861503, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _recover_email_txt_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x24\xc8\xd1\x0d\x82\x40\x10\x04\xd0\x56\xa6\x02\x6b\xb1\x00\x7e\xce\x73\xd1\x8d\xeb\x0c\xd9\x5b\x42\x08\xa1\x77\x4d\xf8\x7c\xef\x1e\xd6\x86\xa1\x6b\xd9\xd1\xf8\xc4\xd2\x46\x19\xea\x6d\x98\x15\xa1\xcd\xf9\x42\x38\x3f\x70\x96\xb0\x6b\x4d\x3c\x52\xdb\xb0\xc4\xdf\x5d\x9c\x3d\xbf\xd7\xb7\xde\xb5\xb2\x26\x4e\x3c\x8e\xdb\x79\xfe\x02\x00\x00\xff\xff\x66\x27\xac\x6d\x5b\x00\x00\x00")
|
||||
|
||||
func recover_email_txt_tpl_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
_recover_email_txt_tpl,
|
||||
func recover_email_txt_tpl() ([]byte, error) {
|
||||
return bindata_read([]byte{
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0x24, 0xc8,
|
||||
0xd1, 0x0d, 0x82, 0x40, 0x10, 0x04, 0xd0, 0x56, 0xa6, 0x02, 0x6b, 0xb1,
|
||||
0x00, 0x7e, 0xce, 0x73, 0xd1, 0x8d, 0xeb, 0x0c, 0xd9, 0x5b, 0x42, 0x08,
|
||||
0xa1, 0x77, 0x4d, 0xf8, 0x7c, 0xef, 0x1e, 0xd6, 0x86, 0xa1, 0x6b, 0xd9,
|
||||
0xd1, 0xf8, 0xc4, 0xd2, 0x46, 0x19, 0xea, 0x6d, 0x98, 0x15, 0xa1, 0xcd,
|
||||
0xf9, 0x42, 0x38, 0x3f, 0x70, 0x96, 0xb0, 0x6b, 0x4d, 0x3c, 0x52, 0xdb,
|
||||
0xb0, 0xc4, 0xdf, 0x5d, 0x9c, 0x3d, 0xbf, 0xd7, 0xb7, 0xde, 0xb5, 0xb2,
|
||||
0x26, 0x4e, 0x3c, 0x8e, 0xdb, 0x79, 0xfe, 0x02, 0x00, 0x00, 0xff, 0xff,
|
||||
0x66, 0x27, 0xac, 0x6d, 0x5b, 0x00, 0x00, 0x00,
|
||||
},
|
||||
"recover_email.txt.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func recover_email_txt_tpl() (*asset, error) {
|
||||
bytes, err := recover_email_txt_tpl_bytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindata_file_info{name: "recover_email.txt.tpl", size: 91, mode: os.FileMode(438), modTime: time.Unix(1425861617, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _register_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x94\x53\x4d\x6f\xe2\x30\x10\x3d\x93\x5f\x31\xb2\x38\x93\x3b\x72\x72\xd9\xbd\xec\x65\x85\x56\xab\x5e\x2b\x13\x4f\x88\x55\x7f\xc9\x76\x0a\x28\xca\x7f\xaf\x9d\x40\x42\x40\x6d\xe9\xc5\xf6\x8c\xde\x9b\x79\x6f\x34\xa6\xb5\x71\x0a\x58\x15\x84\xd1\x05\xe9\x3a\x65\x5a\x1d\x2c\x0b\x0d\x72\x20\x0e\x0f\xc2\x07\x74\xa4\xef\x09\x28\x0c\x8d\xe1\x05\xb1\xc6\x07\x52\x66\x2b\x2a\xd9\x1e\x25\x44\x7e\xe2\x6d\xac\x13\x8a\xb9\xf3\x9f\xdf\x11\x5b\x76\x5d\x10\x41\x22\xdc\x66\xb7\x34\x1f\x18\x89\x2a\xb4\x6d\x03\x68\xa6\xf0\x81\x0b\xe1\x6c\x63\x36\xe0\x29\x10\x78\x67\xb2\x1d\x20\x47\x11\x9a\x9b\x6a\x2f\x29\xdf\xf7\x91\x9a\x0e\xd4\x3c\x11\xad\x64\x15\x36\x46\x72\x1c\x14\x3d\x2a\x20\x90\x97\x74\xef\xe2\x99\xad\xba\x6e\x6d\x05\x87\x6d\xb1\x40\x5c\x1b\xa1\x73\x7e\x8a\xd6\x31\x92\x71\x0e\x09\x2c\x34\xc7\x13\x6c\x20\x91\x13\xc0\x31\x7d\xc0\x09\xd1\xf7\xd4\x5b\xa6\xcb\x41\x17\xcd\x87\xf7\xd8\xf0\x22\x72\x79\x2d\x67\x68\x99\xf7\x47\xe3\x38\x29\x77\x97\xd7\x67\x13\x9b\x90\x97\x59\xcd\xf1\x62\x04\xbb\x29\x7d\x6b\x7b\x69\x70\xd4\xbf\xb9\x56\x78\xd6\xc0\x52\x79\x65\x74\x2d\x9c\x7a\x9d\x1d\xfc\x1a\x33\xf0\x9d\x93\x07\xe6\xd7\x8e\xee\xcb\x3e\xe1\xec\xbe\xc3\x0f\x1c\x8e\x42\x47\x41\xbe\xdd\x2b\x31\x2f\xe4\xbf\xeb\xc7\x98\xda\x53\x06\x8d\xc3\xba\x20\x79\x74\xcf\x74\x85\x92\xe6\xac\xcc\xee\xca\x34\x82\x73\xd4\x64\xde\xfc\x93\x77\xf5\xdf\x18\xa4\xe5\x9c\x96\x7d\xc8\xfe\x37\x6f\xa8\xc7\x9d\xcd\x68\x9e\x7e\x69\xf9\x11\x00\x00\xff\xff\x0e\xa6\x2d\x81\xac\x03\x00\x00")
|
||||
|
||||
func register_html_tpl_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
_register_html_tpl,
|
||||
func register_html_tpl() ([]byte, error) {
|
||||
return bindata_read([]byte{
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0x94, 0x53,
|
||||
0x4d, 0x6f, 0xe2, 0x30, 0x10, 0x3d, 0x93, 0x5f, 0x31, 0xb2, 0x38, 0x93,
|
||||
0x3b, 0x72, 0x72, 0xd9, 0xbd, 0xec, 0x65, 0x85, 0x56, 0xab, 0x5e, 0x2b,
|
||||
0x13, 0x4f, 0x88, 0x55, 0x7f, 0xc9, 0x76, 0x0a, 0x28, 0xca, 0x7f, 0xaf,
|
||||
0x9d, 0x40, 0x42, 0x40, 0x6d, 0xe9, 0xc5, 0xf6, 0x8c, 0xde, 0x9b, 0x79,
|
||||
0x6f, 0x34, 0xa6, 0xb5, 0x71, 0x0a, 0x58, 0x15, 0x84, 0xd1, 0x05, 0xe9,
|
||||
0x3a, 0x65, 0x5a, 0x1d, 0x2c, 0x0b, 0x0d, 0x72, 0x20, 0x0e, 0x0f, 0xc2,
|
||||
0x07, 0x74, 0xa4, 0xef, 0x09, 0x28, 0x0c, 0x8d, 0xe1, 0x05, 0xb1, 0xc6,
|
||||
0x07, 0x52, 0x66, 0x2b, 0x2a, 0xd9, 0x1e, 0x25, 0x44, 0x7e, 0xe2, 0x6d,
|
||||
0xac, 0x13, 0x8a, 0xb9, 0xf3, 0x9f, 0xdf, 0x11, 0x5b, 0x76, 0x5d, 0x10,
|
||||
0x41, 0x22, 0xdc, 0x66, 0xb7, 0x34, 0x1f, 0x18, 0x89, 0x2a, 0xb4, 0x6d,
|
||||
0x03, 0x68, 0xa6, 0xf0, 0x81, 0x0b, 0xe1, 0x6c, 0x63, 0x36, 0xe0, 0x29,
|
||||
0x10, 0x78, 0x67, 0xb2, 0x1d, 0x20, 0x47, 0x11, 0x9a, 0x9b, 0x6a, 0x2f,
|
||||
0x29, 0xdf, 0xf7, 0x91, 0x9a, 0x0e, 0xd4, 0x3c, 0x11, 0xad, 0x64, 0x15,
|
||||
0x36, 0x46, 0x72, 0x1c, 0x14, 0x3d, 0x2a, 0x20, 0x90, 0x97, 0x74, 0xef,
|
||||
0xe2, 0x99, 0xad, 0xba, 0x6e, 0x6d, 0x05, 0x87, 0x6d, 0xb1, 0x40, 0x5c,
|
||||
0x1b, 0xa1, 0x73, 0x7e, 0x8a, 0xd6, 0x31, 0x92, 0x71, 0x0e, 0x09, 0x2c,
|
||||
0x34, 0xc7, 0x13, 0x6c, 0x20, 0x91, 0x13, 0xc0, 0x31, 0x7d, 0xc0, 0x09,
|
||||
0xd1, 0xf7, 0xd4, 0x5b, 0xa6, 0xcb, 0x41, 0x17, 0xcd, 0x87, 0xf7, 0xd8,
|
||||
0xf0, 0x22, 0x72, 0x79, 0x2d, 0x67, 0x68, 0x99, 0xf7, 0x47, 0xe3, 0x38,
|
||||
0x29, 0x77, 0x97, 0xd7, 0x67, 0x13, 0x9b, 0x90, 0x97, 0x59, 0xcd, 0xf1,
|
||||
0x62, 0x04, 0xbb, 0x29, 0x7d, 0x6b, 0x7b, 0x69, 0x70, 0xd4, 0xbf, 0xb9,
|
||||
0x56, 0x78, 0xd6, 0xc0, 0x52, 0x79, 0x65, 0x74, 0x2d, 0x9c, 0x7a, 0x9d,
|
||||
0x1d, 0xfc, 0x1a, 0x33, 0xf0, 0x9d, 0x93, 0x07, 0xe6, 0xd7, 0x8e, 0xee,
|
||||
0xcb, 0x3e, 0xe1, 0xec, 0xbe, 0xc3, 0x0f, 0x1c, 0x8e, 0x42, 0x47, 0x41,
|
||||
0xbe, 0xdd, 0x2b, 0x31, 0x2f, 0xe4, 0xbf, 0xeb, 0xc7, 0x98, 0xda, 0x53,
|
||||
0x06, 0x8d, 0xc3, 0xba, 0x20, 0x79, 0x74, 0xcf, 0x74, 0x85, 0x92, 0xe6,
|
||||
0xac, 0xcc, 0xee, 0xca, 0x34, 0x82, 0x73, 0xd4, 0x64, 0xde, 0xfc, 0x93,
|
||||
0x77, 0xf5, 0xdf, 0x18, 0xa4, 0xe5, 0x9c, 0x96, 0x7d, 0xc8, 0xfe, 0x37,
|
||||
0x6f, 0xa8, 0xc7, 0x9d, 0xcd, 0x68, 0x9e, 0x7e, 0x69, 0xf9, 0x11, 0x00,
|
||||
0x00, 0xff, 0xff, 0x0e, 0xa6, 0x2d, 0x81, 0xac, 0x03, 0x00, 0x00,
|
||||
},
|
||||
"register.html.tpl",
|
||||
)
|
||||
}
|
||||
|
||||
func register_html_tpl() (*asset, error) {
|
||||
bytes, err := register_html_tpl_bytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindata_file_info{name: "register.html.tpl", size: 940, mode: os.FileMode(438), modTime: time.Unix(1424982621, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
// Asset loads and returns the asset for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func Asset(name string) ([]byte, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.bytes, nil
|
||||
return f()
|
||||
}
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
|
||||
// AssetInfo loads and returns the asset info for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func AssetInfo(name string) (os.FileInfo, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.info, nil
|
||||
}
|
||||
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
||||
}
|
||||
|
||||
// AssetNames returns the names of the assets.
|
||||
func AssetNames() []string {
|
||||
names := make([]string, 0, len(_bindata))
|
||||
@ -261,7 +255,7 @@ func AssetNames() []string {
|
||||
}
|
||||
|
||||
// _bindata is a table, holding each asset generator, mapped to its name.
|
||||
var _bindata = map[string]func() (*asset, error){
|
||||
var _bindata = map[string]func() ([]byte, error){
|
||||
"confirm_email.html.tpl": confirm_email_html_tpl,
|
||||
"confirm_email.txt.tpl": confirm_email_txt_tpl,
|
||||
"login.html.tpl": login_html_tpl,
|
||||
@ -271,7 +265,6 @@ var _bindata = map[string]func() (*asset, error){
|
||||
"recover_email.txt.tpl": recover_email_txt_tpl,
|
||||
"register.html.tpl": register_html_tpl,
|
||||
}
|
||||
|
||||
// AssetDir returns the file names below a certain
|
||||
// directory embedded in the file by go-bindata.
|
||||
// For example if you run go-bindata on data/... and data contains the
|
||||
@ -308,7 +301,7 @@ func AssetDir(name string) ([]string, error) {
|
||||
}
|
||||
|
||||
type _bintree_t struct {
|
||||
Func func() (*asset, error)
|
||||
Func func() ([]byte, error)
|
||||
Children map[string]*_bintree_t
|
||||
}
|
||||
var _bintree = &_bintree_t{nil, map[string]*_bintree_t{
|
||||
@ -329,50 +322,3 @@ var _bintree = &_bintree_t{nil, map[string]*_bintree_t{
|
||||
"register.html.tpl": &_bintree_t{register_html_tpl, map[string]*_bintree_t{
|
||||
}},
|
||||
}}
|
||||
|
||||
// Restore an asset under the given directory
|
||||
func RestoreAsset(dir, name string) error {
|
||||
data, err := Asset(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info, err := AssetInfo(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.MkdirAll(_filePath(dir, path.Dir(name)), os.FileMode(0755))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Restore assets under the given directory recursively
|
||||
func RestoreAssets(dir, name string) error {
|
||||
children, err := AssetDir(name)
|
||||
if err != nil { // File
|
||||
return RestoreAsset(dir, name)
|
||||
} else { // Dir
|
||||
for _, child := range children {
|
||||
err = RestoreAssets(dir, path.Join(name, child))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func _filePath(dir, name string) string {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
||||
}
|
||||
|
||||
|
27
lock/lock.go
27
lock/lock.go
@ -8,6 +8,7 @@ import (
|
||||
"gopkg.in/authboss.v0"
|
||||
)
|
||||
|
||||
// Storage key constants
|
||||
const (
|
||||
StoreAttemptNumber = "attempt_number"
|
||||
StoreAttemptTime = "attempt_time"
|
||||
@ -22,27 +23,31 @@ func init() {
|
||||
authboss.RegisterModule("lock", &Lock{})
|
||||
}
|
||||
|
||||
// Lock module
|
||||
type Lock struct {
|
||||
}
|
||||
|
||||
// Initialize the module
|
||||
func (l *Lock) Initialize() error {
|
||||
if authboss.Cfg.Storer == nil {
|
||||
return errors.New("lock: Need a Storer.")
|
||||
return errors.New("lock: Need a Storer")
|
||||
}
|
||||
|
||||
// Events
|
||||
authboss.Cfg.Callbacks.Before(authboss.EventGet, l.BeforeAuth)
|
||||
authboss.Cfg.Callbacks.Before(authboss.EventAuth, l.BeforeAuth)
|
||||
authboss.Cfg.Callbacks.After(authboss.EventAuth, l.AfterAuth)
|
||||
authboss.Cfg.Callbacks.After(authboss.EventAuthFail, l.AfterAuthFail)
|
||||
authboss.Cfg.Callbacks.Before(authboss.EventGet, l.beforeAuth)
|
||||
authboss.Cfg.Callbacks.Before(authboss.EventAuth, l.beforeAuth)
|
||||
authboss.Cfg.Callbacks.After(authboss.EventAuth, l.afterAuth)
|
||||
authboss.Cfg.Callbacks.After(authboss.EventAuthFail, l.afterAuthFail)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Routes for the module
|
||||
func (l *Lock) Routes() authboss.RouteTable {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Storage requirements
|
||||
func (l *Lock) Storage() authboss.StorageOptions {
|
||||
return authboss.StorageOptions{
|
||||
StoreAttemptNumber: authboss.Integer,
|
||||
@ -51,8 +56,8 @@ func (l *Lock) Storage() authboss.StorageOptions {
|
||||
}
|
||||
}
|
||||
|
||||
// BeforeAuth ensures the account is not locked.
|
||||
func (l *Lock) BeforeAuth(ctx *authboss.Context) (authboss.Interrupt, error) {
|
||||
// beforeAuth ensures the account is not locked.
|
||||
func (l *Lock) beforeAuth(ctx *authboss.Context) (authboss.Interrupt, error) {
|
||||
if ctx.User == nil {
|
||||
return authboss.InterruptNone, errUserMissing
|
||||
}
|
||||
@ -64,8 +69,8 @@ func (l *Lock) BeforeAuth(ctx *authboss.Context) (authboss.Interrupt, error) {
|
||||
return authboss.InterruptNone, nil
|
||||
}
|
||||
|
||||
// AfterAuth resets the attempt number field.
|
||||
func (l *Lock) AfterAuth(ctx *authboss.Context) error {
|
||||
// afterAuth resets the attempt number field.
|
||||
func (l *Lock) afterAuth(ctx *authboss.Context) error {
|
||||
if ctx.User == nil {
|
||||
return errUserMissing
|
||||
}
|
||||
@ -80,8 +85,8 @@ func (l *Lock) AfterAuth(ctx *authboss.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// AfterAuthFail adjusts the attempt number and time.
|
||||
func (l *Lock) AfterAuthFail(ctx *authboss.Context) error {
|
||||
// afterAuthFail adjusts the attempt number and time.
|
||||
func (l *Lock) afterAuthFail(ctx *authboss.Context) error {
|
||||
if ctx.User == nil {
|
||||
return errUserMissing
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ func TestBeforeAuth(t *testing.T) {
|
||||
authboss.NewConfig()
|
||||
ctx := authboss.NewContext()
|
||||
|
||||
if interrupt, err := l.BeforeAuth(ctx); err != errUserMissing {
|
||||
if interrupt, err := l.beforeAuth(ctx); err != errUserMissing {
|
||||
t.Error("Expected an error because of missing user:", err)
|
||||
} else if interrupt != authboss.InterruptNone {
|
||||
t.Error("Interrupt should not be set:", interrupt)
|
||||
@ -36,7 +36,7 @@ func TestBeforeAuth(t *testing.T) {
|
||||
|
||||
ctx.User = authboss.Attributes{"locked": time.Now().Add(1 * time.Hour)}
|
||||
|
||||
if interrupt, err := l.BeforeAuth(ctx); err != nil {
|
||||
if interrupt, err := l.beforeAuth(ctx); err != nil {
|
||||
t.Error(err)
|
||||
} else if interrupt != authboss.InterruptAccountLocked {
|
||||
t.Error("Expected a locked interrupt:", interrupt)
|
||||
@ -48,7 +48,7 @@ func TestAfterAuth(t *testing.T) {
|
||||
lock := Lock{}
|
||||
ctx := authboss.NewContext()
|
||||
|
||||
if err := lock.AfterAuth(ctx); err != errUserMissing {
|
||||
if err := lock.afterAuth(ctx); err != errUserMissing {
|
||||
t.Error("Expected an error because of missing user:", err)
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ func TestAfterAuth(t *testing.T) {
|
||||
authboss.Cfg.Storer = storer
|
||||
ctx.User = authboss.Attributes{authboss.Cfg.PrimaryID: "john@john.com"}
|
||||
|
||||
if err := lock.AfterAuth(ctx); err != nil {
|
||||
if err := lock.afterAuth(ctx); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if storer.Users["john@john.com"][StoreAttemptNumber].(int64) != int64(0) {
|
||||
@ -91,7 +91,7 @@ func TestAfterAuthFail_Lock(t *testing.T) {
|
||||
t.Errorf("%d: User should not be locked.", i)
|
||||
}
|
||||
|
||||
if err := lock.AfterAuthFail(ctx); err != nil {
|
||||
if err := lock.afterAuthFail(ctx); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if val := storer.Users[email][StoreAttemptNumber].(int64); val != int64(i+1) {
|
||||
@ -136,7 +136,7 @@ func TestAfterAuthFail_Reset(t *testing.T) {
|
||||
StoreLocked: old,
|
||||
}
|
||||
|
||||
lock.AfterAuthFail(ctx)
|
||||
lock.afterAuthFail(ctx)
|
||||
if val := storer.Users[email][StoreAttemptNumber].(int64); val != int64(0) {
|
||||
t.Error("StoreAttemptNumber set incorrectly:", val)
|
||||
}
|
||||
@ -153,7 +153,7 @@ func TestAfterAuthFail_Errors(t *testing.T) {
|
||||
lock := Lock{}
|
||||
ctx := authboss.NewContext()
|
||||
|
||||
lock.AfterAuthFail(ctx)
|
||||
lock.afterAuthFail(ctx)
|
||||
if _, ok := ctx.User[StoreAttemptNumber]; ok {
|
||||
t.Error("Expected nothing to be set, missing user.")
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ func RegisterModule(name string, m Modularizer) {
|
||||
func LoadedModules() []string {
|
||||
mods := make([]string, len(modules))
|
||||
i := 0
|
||||
for k, _ := range modules {
|
||||
for k := range modules {
|
||||
mods[i] = k
|
||||
i++
|
||||
}
|
||||
|
@ -19,12 +19,14 @@ var (
|
||||
errOAuthStateValidation = errors.New("Could not validate oauth2 state param")
|
||||
)
|
||||
|
||||
// OAuth2 module
|
||||
type OAuth2 struct{}
|
||||
|
||||
func init() {
|
||||
authboss.RegisterModule("oauth2", &OAuth2{})
|
||||
}
|
||||
|
||||
// Initialize module
|
||||
func (o *OAuth2) Initialize() error {
|
||||
if authboss.Cfg.OAuth2Storer == nil {
|
||||
return errors.New("oauth2: need an OAuth2Storer")
|
||||
@ -32,6 +34,7 @@ func (o *OAuth2) Initialize() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Routes for module
|
||||
func (o *OAuth2) Routes() authboss.RouteTable {
|
||||
routes := make(authboss.RouteTable)
|
||||
|
||||
@ -54,6 +57,7 @@ func (o *OAuth2) Routes() authboss.RouteTable {
|
||||
return routes
|
||||
}
|
||||
|
||||
// Storage requirements
|
||||
func (o *OAuth2) Storage() authboss.StorageOptions {
|
||||
return authboss.StorageOptions{
|
||||
authboss.StoreEmail: authboss.String,
|
||||
|
@ -16,6 +16,12 @@ import (
|
||||
"gopkg.in/authboss.v0/internal/render"
|
||||
)
|
||||
|
||||
// Storage constants
|
||||
const (
|
||||
StoreRecoverToken = "recover_token"
|
||||
StoreRecoverTokenExpiry = "recover_token_expiry"
|
||||
)
|
||||
|
||||
const (
|
||||
methodGET = "GET"
|
||||
methodPOST = "POST"
|
||||
@ -26,9 +32,6 @@ const (
|
||||
tplInitHTMLEmail = "recover_email.html.tpl"
|
||||
tplInitTextEmail = "recover_email.txt.tpl"
|
||||
|
||||
StoreRecoverToken = "recover_token"
|
||||
StoreRecoverTokenExpiry = "recover_token_expiry"
|
||||
|
||||
recoverInitiateSuccessFlash = "An email has been sent with further instructions on how to reset your password"
|
||||
recoverTokenExpiredFlash = "Account recovery request has expired. Please try again."
|
||||
recoverFailedErrorFlash = "Account recovery has failed. Please contact tech support."
|
||||
@ -51,19 +54,21 @@ func init() {
|
||||
authboss.RegisterModule("recover", m)
|
||||
}
|
||||
|
||||
// Recover module
|
||||
type Recover struct {
|
||||
templates render.Templates
|
||||
emailHTMLTemplates render.Templates
|
||||
emailTextTemplates render.Templates
|
||||
}
|
||||
|
||||
// Initialize module
|
||||
func (r *Recover) Initialize() (err error) {
|
||||
if authboss.Cfg.Storer == nil {
|
||||
return errors.New("recover: Need a RecoverStorer.")
|
||||
return errors.New("recover: Need a RecoverStorer")
|
||||
}
|
||||
|
||||
if _, ok := authboss.Cfg.Storer.(RecoverStorer); !ok {
|
||||
return errors.New("recover: RecoverStorer required for recover functionality.")
|
||||
return errors.New("recover: RecoverStorer required for recover functionality")
|
||||
}
|
||||
|
||||
if len(authboss.Cfg.XSRFName) == 0 {
|
||||
@ -91,12 +96,15 @@ func (r *Recover) Initialize() (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Routes for module
|
||||
func (r *Recover) Routes() authboss.RouteTable {
|
||||
return authboss.RouteTable{
|
||||
"/recover": r.startHandlerFunc,
|
||||
"/recover/complete": r.completeHandlerFunc,
|
||||
}
|
||||
}
|
||||
|
||||
// Storage requirements
|
||||
func (r *Recover) Storage() authboss.StorageOptions {
|
||||
return authboss.StorageOptions{
|
||||
authboss.Cfg.PrimaryID: authboss.String,
|
||||
|
@ -17,7 +17,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
testUrlBase64Token = "MTIzNA=="
|
||||
testURLBase64Token = "MTIzNA=="
|
||||
testStdBase64Token = "gdyb21LQTcIANtvYMT7QVQ=="
|
||||
)
|
||||
|
||||
@ -277,7 +277,7 @@ func TestRecover_sendRecoverEmail(t *testing.T) {
|
||||
func TestRecover_completeHandlerFunc_GET_VerifyFails(t *testing.T) {
|
||||
rec, storer, _ := testSetup()
|
||||
|
||||
ctx, w, r, _ := testRequest("GET", "token", testUrlBase64Token)
|
||||
ctx, w, r, _ := testRequest("GET", "token", testURLBase64Token)
|
||||
|
||||
err := rec.completeHandlerFunc(ctx, w, r)
|
||||
rerr, ok := err.(authboss.ErrAndRedirect)
|
||||
@ -291,7 +291,7 @@ func TestRecover_completeHandlerFunc_GET_VerifyFails(t *testing.T) {
|
||||
var zeroTime time.Time
|
||||
storer.Users["john"] = authboss.Attributes{StoreRecoverToken: testStdBase64Token, StoreRecoverTokenExpiry: zeroTime}
|
||||
|
||||
ctx, w, r, _ = testRequest("GET", "token", testUrlBase64Token)
|
||||
ctx, w, r, _ = testRequest("GET", "token", testURLBase64Token)
|
||||
|
||||
err = rec.completeHandlerFunc(ctx, w, r)
|
||||
rerr, ok = err.(authboss.ErrAndRedirect)
|
||||
@ -309,9 +309,9 @@ func TestRecover_completeHandlerFunc_GET_VerifyFails(t *testing.T) {
|
||||
func TestRecover_completeHandlerFunc_GET(t *testing.T) {
|
||||
rec, storer, _ := testSetup()
|
||||
|
||||
storer.Users["john"] = authboss.Attributes{StoreRecoverToken: testStdBase64Token, StoreRecoverTokenExpiry: time.Now()}
|
||||
storer.Users["john"] = authboss.Attributes{StoreRecoverToken: testStdBase64Token, StoreRecoverTokenExpiry: time.Now().Add(1 * time.Hour)}
|
||||
|
||||
ctx, w, r, _ := testRequest("GET", "token", testUrlBase64Token)
|
||||
ctx, w, r, _ := testRequest("GET", "token", testURLBase64Token)
|
||||
|
||||
if err := rec.completeHandlerFunc(ctx, w, r); err != nil {
|
||||
t.Error("Unexpected error:", err)
|
||||
@ -336,7 +336,7 @@ func TestRecover_completeHandlerFunc_GET(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRecover_completeHanlderFunc_POST_TokenMissing(t *testing.T) {
|
||||
func TestRecover_completeHandlerFunc_POST_TokenMissing(t *testing.T) {
|
||||
rec, _, _ := testSetup()
|
||||
ctx, w, r, _ := testRequest("POST")
|
||||
|
||||
@ -347,9 +347,9 @@ func TestRecover_completeHanlderFunc_POST_TokenMissing(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestRecover_completeHanlderFunc_POST_ValidationFails(t *testing.T) {
|
||||
func TestRecover_completeHandlerFunc_POST_ValidationFails(t *testing.T) {
|
||||
rec, _, _ := testSetup()
|
||||
ctx, w, r, _ := testRequest("POST", "token", testUrlBase64Token)
|
||||
ctx, w, r, _ := testRequest("POST", "token", testURLBase64Token)
|
||||
|
||||
if err := rec.completeHandlerFunc(ctx, w, r); err != nil {
|
||||
t.Error("Unexpected error:", err)
|
||||
@ -364,9 +364,9 @@ func TestRecover_completeHanlderFunc_POST_ValidationFails(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRecover_completeHanlderFunc_POST_VerificationFails(t *testing.T) {
|
||||
func TestRecover_completeHandlerFunc_POST_VerificationFails(t *testing.T) {
|
||||
rec, _, _ := testSetup()
|
||||
ctx, w, r, _ := testRequest("POST", "token", testUrlBase64Token, authboss.StorePassword, "abcd", "confirm_"+authboss.StorePassword, "abcd")
|
||||
ctx, w, r, _ := testRequest("POST", "token", testURLBase64Token, authboss.StorePassword, "abcd", "confirm_"+authboss.StorePassword, "abcd")
|
||||
|
||||
if err := rec.completeHandlerFunc(ctx, w, r); err == nil {
|
||||
log.Println(w.Body.String())
|
||||
@ -374,10 +374,10 @@ func TestRecover_completeHanlderFunc_POST_VerificationFails(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRecover_completeHanlderFunc_POST(t *testing.T) {
|
||||
func TestRecover_completeHandlerFunc_POST(t *testing.T) {
|
||||
rec, storer, _ := testSetup()
|
||||
|
||||
storer.Users["john"] = authboss.Attributes{authboss.Cfg.PrimaryID: "john", StoreRecoverToken: testStdBase64Token, StoreRecoverTokenExpiry: time.Now(), authboss.StorePassword: "asdf"}
|
||||
storer.Users["john"] = authboss.Attributes{authboss.Cfg.PrimaryID: "john", StoreRecoverToken: testStdBase64Token, StoreRecoverTokenExpiry: time.Now().Add(1 * time.Hour), authboss.StorePassword: "asdf"}
|
||||
|
||||
cbCalled := false
|
||||
|
||||
@ -387,7 +387,7 @@ func TestRecover_completeHanlderFunc_POST(t *testing.T) {
|
||||
return nil
|
||||
})
|
||||
|
||||
ctx, w, r, sessionStorer := testRequest("POST", "token", testUrlBase64Token, authboss.StorePassword, "abcd", "confirm_"+authboss.StorePassword, "abcd")
|
||||
ctx, w, r, sessionStorer := testRequest("POST", "token", testURLBase64Token, authboss.StorePassword, "abcd", "confirm_"+authboss.StorePassword, "abcd")
|
||||
|
||||
if err := rec.completeHandlerFunc(ctx, w, r); err != nil {
|
||||
t.Error("Unexpected error:", err)
|
||||
@ -454,7 +454,7 @@ func Test_verifyToken_ExpiredToken(t *testing.T) {
|
||||
StoreRecoverTokenExpiry: time.Now().Add(time.Duration(-24) * time.Hour),
|
||||
}
|
||||
|
||||
ctx := mocks.MockRequestContext("token", testUrlBase64Token)
|
||||
ctx := mocks.MockRequestContext("token", testURLBase64Token)
|
||||
if _, err := verifyToken(ctx); err != errRecoveryTokenExpired {
|
||||
t.Error("Unexpected error:", err)
|
||||
}
|
||||
@ -467,7 +467,7 @@ func Test_verifyToken(t *testing.T) {
|
||||
StoreRecoverTokenExpiry: time.Now().Add(time.Duration(24) * time.Hour),
|
||||
}
|
||||
|
||||
ctx := mocks.MockRequestContext("token", testUrlBase64Token)
|
||||
ctx := mocks.MockRequestContext("token", testURLBase64Token)
|
||||
attrs, err := verifyToken(ctx)
|
||||
if err != nil {
|
||||
t.Error("Unexpected error:", err)
|
||||
|
@ -34,11 +34,11 @@ type Register struct {
|
||||
// Initialize the module.
|
||||
func (r *Register) Initialize() (err error) {
|
||||
if authboss.Cfg.Storer == nil {
|
||||
return errors.New("register: Need a RegisterStorer.")
|
||||
return errors.New("register: Need a RegisterStorer")
|
||||
}
|
||||
|
||||
if _, ok := authboss.Cfg.Storer.(RegisterStorer); !ok {
|
||||
return errors.New("register: RegisterStorer required for register functionality.")
|
||||
return errors.New("register: RegisterStorer required for register functionality")
|
||||
}
|
||||
|
||||
if r.templates, err = render.LoadTemplates(authboss.Cfg.Layout, authboss.Cfg.ViewsPath, tplRegister); err != nil {
|
||||
|
@ -42,8 +42,10 @@ func init() {
|
||||
authboss.RegisterModule("remember", &Remember{})
|
||||
}
|
||||
|
||||
// Remember module
|
||||
type Remember struct{}
|
||||
|
||||
// Initialize module
|
||||
func (r *Remember) Initialize() error {
|
||||
if authboss.Cfg.Storer == nil {
|
||||
return errors.New("remember: Need a RememberStorer")
|
||||
@ -61,10 +63,12 @@ func (r *Remember) Initialize() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Routes for module
|
||||
func (r *Remember) Routes() authboss.RouteTable {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Storage requirements
|
||||
func (r *Remember) Storage() authboss.StorageOptions {
|
||||
return nil
|
||||
}
|
||||
@ -205,7 +209,7 @@ func (r *Remember) auth(ctx *authboss.Context) (authboss.Interrupt, error) {
|
||||
|
||||
index := bytes.IndexByte(token, ';')
|
||||
if index < 0 {
|
||||
return authboss.InterruptNone, errors.New("remember: Invalid remember token.")
|
||||
return authboss.InterruptNone, errors.New("remember: Invalid remember token")
|
||||
}
|
||||
|
||||
// Get the key.
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"path"
|
||||
)
|
||||
|
||||
// Handler augments http.HandlerFunc with a context.
|
||||
// HandlerFunc augments http.HandlerFunc with a context and error handling.
|
||||
type HandlerFunc func(*Context, http.ResponseWriter, *http.Request) error
|
||||
|
||||
// RouteTable is a routing table from a path to a handlerfunc.
|
||||
|
2
rules.go
2
rules.go
@ -84,7 +84,7 @@ func (r Rules) IsValid(toValidate string) bool {
|
||||
|
||||
// Rules returns an array of strings describing the rules.
|
||||
func (r Rules) Rules() []string {
|
||||
rules := make([]string, 0)
|
||||
var rules []string
|
||||
|
||||
if r.MustMatch != nil {
|
||||
rules = append(rules, r.MatchError)
|
||||
|
13
storer.go
13
storer.go
@ -63,6 +63,7 @@ type OAuth2Storer interface {
|
||||
// DataType represents the various types that clients must be able to store.
|
||||
type DataType int
|
||||
|
||||
// DataType constants
|
||||
const (
|
||||
Integer DataType = iota
|
||||
String
|
||||
@ -95,7 +96,7 @@ type AttributeMeta map[string]DataType
|
||||
func (a AttributeMeta) Names() []string {
|
||||
names := make([]string, len(a))
|
||||
i := 0
|
||||
for n, _ := range a {
|
||||
for n := range a {
|
||||
names[i] = n
|
||||
i++
|
||||
}
|
||||
@ -109,7 +110,7 @@ type Attributes map[string]interface{}
|
||||
func (a Attributes) Names() []string {
|
||||
names := make([]string, len(a))
|
||||
i := 0
|
||||
for n, _ := range a {
|
||||
for n := range a {
|
||||
names[i] = n
|
||||
i++
|
||||
}
|
||||
@ -167,7 +168,7 @@ func (a Attributes) StringErr(key string) (val string, err error) {
|
||||
}
|
||||
val, ok = inter.(string)
|
||||
if !ok {
|
||||
return val, MakeAttributeErr(key, String, inter)
|
||||
return val, NewAttributeErr(key, String, inter)
|
||||
}
|
||||
return val, nil
|
||||
}
|
||||
@ -180,7 +181,7 @@ func (a Attributes) Int64Err(key string) (val int64, err error) {
|
||||
}
|
||||
val, ok = inter.(int64)
|
||||
if !ok {
|
||||
return val, MakeAttributeErr(key, Integer, inter)
|
||||
return val, NewAttributeErr(key, Integer, inter)
|
||||
}
|
||||
return val, nil
|
||||
}
|
||||
@ -193,7 +194,7 @@ func (a Attributes) BoolErr(key string) (val bool, err error) {
|
||||
}
|
||||
val, ok = inter.(bool)
|
||||
if !ok {
|
||||
return val, MakeAttributeErr(key, Integer, inter)
|
||||
return val, NewAttributeErr(key, Integer, inter)
|
||||
}
|
||||
return val, nil
|
||||
}
|
||||
@ -206,7 +207,7 @@ func (a Attributes) DateTimeErr(key string) (val time.Time, err error) {
|
||||
}
|
||||
val, ok = inter.(time.Time)
|
||||
if !ok {
|
||||
return val, MakeAttributeErr(key, DateTime, inter)
|
||||
return val, NewAttributeErr(key, DateTime, inter)
|
||||
}
|
||||
return val, nil
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ func TestCasingStyleConversions(t *testing.T) {
|
||||
}
|
||||
out = underToCamel(out)
|
||||
if out != test.In {
|
||||
t.Error("%d), Expected %q got %q", i, test.In, out)
|
||||
t.Errorf("%d), Expected %q got %q", i, test.In, out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ type Validator interface {
|
||||
Rules() []string
|
||||
}
|
||||
|
||||
// ErrorList is simply a slice of errors with helpers.
|
||||
type ErrorList []error
|
||||
|
||||
// Error satisfies the error interface.
|
||||
|
Loading…
x
Reference in New Issue
Block a user