Documentation ¶
Index ¶
- Variables
- func Cleanup() (err error)
- func GenNewClient(name, redirectURI string) *oauth.Client
- func GenNewIID() string
- func LoadArticle(id int) (*content.Article, error)
- func LoadArticles(limit, offset int) (data []*content.Article, err error)
- func LoadLink(id int) (*content.Link, error)
- func LoadLinks(limit, offset int) (data []*content.Link, err error)
- func NextStaffID() (eid int, err error)
- func SaveArticle(a *content.Article) error
- func SaveLink(l *content.Link) error
- func SetDSN(dsn string)
- func SetLDAP(c LDAPConfig)
- func SetPasswordSecret(s string)
- func StoreTeamAndStaffs(svc Servicer, team *team.Team, staffs models.Staffs) (err error)
- func WriteUserLog(uid, subject, message string) error
- type Client
- type ClientSpec
- type DbStorage
- func (s *DbStorage) Clone() osin.Storage
- func (s *DbStorage) Close()
- func (s *DbStorage) CountClients() (total uint)
- func (s *DbStorage) GetClient(id string) (c osin.Client, err error)
- func (s *DbStorage) IsAuthorized(clientID, username string) bool
- func (s *DbStorage) LoadAccess(code string) (*osin.AccessData, error)
- func (s *DbStorage) LoadAuthorize(code string) (*osin.AuthorizeData, error)
- func (s *DbStorage) LoadClient(id string) (*Client, error)
- func (s *DbStorage) LoadClients(spec *oauth.ClientSpec) (clients []oauth.Client, err error)
- func (s *DbStorage) LoadRefresh(code string) (*osin.AccessData, error)
- func (s *DbStorage) LoadScopes() (scopes []oauth.Scope, err error)
- func (s *DbStorage) RemoveAccess(code string) error
- func (s *DbStorage) RemoveAuthorize(code string) error
- func (s *DbStorage) RemoveClient(id string) error
- func (s *DbStorage) RemoveRefresh(code string) error
- func (s *DbStorage) SaveAccess(data *osin.AccessData) (err error)
- func (s *DbStorage) SaveAuthorize(data *osin.AuthorizeData) error
- func (s *DbStorage) SaveAuthorized(clientID, username string) error
- func (s *DbStorage) SaveClient(client *oauth.Client) error
- type Group
- type JSONKV
- type LDAPConfig
- type OSINStore
- type PoolStats
- type Servicer
- type Spec
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyVal = errors.New("empty value") ErrNotFound = errors.New("Not Found") ErrNoRows = sql.ErrNoRows )
View Source
var ( ErrInvalidResetToken = errors.New("invalid reset token or not found") ErrMailNotReady = errors.New("email system is not ready") ErrEmptyEmail = errors.New("email is empty") )
View Source
var (
BaseURL string
)
View Source
var (
ErrStoreNotFound = ldap.ErrNotFound
)
vars
View Source
var (
ToJSONKV = oauth.ToJSONKV
)
vars
Functions ¶
func GenNewClient ¶ added in v0.12.0
GenNewClient ...
func SaveArticle ¶
func SetPasswordSecret ¶ added in v0.10.0
func SetPasswordSecret(s string)
func StoreTeamAndStaffs ¶ added in v0.12.0
StoreTeamAndStaffs ...
func WriteUserLog ¶
Types ¶
type ClientSpec ¶ added in v0.12.0
type ClientSpec = oauth.ClientSpec
type DbStorage ¶
type DbStorage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage() *DbStorage
func (*DbStorage) CountClients ¶ added in v0.6.3
func (*DbStorage) IsAuthorized ¶ added in v0.6.3
func (*DbStorage) LoadAccess ¶
func (s *DbStorage) LoadAccess(code string) (*osin.AccessData, error)
func (*DbStorage) LoadAuthorize ¶
func (s *DbStorage) LoadAuthorize(code string) (*osin.AuthorizeData, error)
func (*DbStorage) LoadClient ¶ added in v0.12.0
func (*DbStorage) LoadClients ¶ added in v0.6.3
func (*DbStorage) LoadRefresh ¶
func (s *DbStorage) LoadRefresh(code string) (*osin.AccessData, error)
func (*DbStorage) LoadScopes ¶ added in v0.6.3
func (*DbStorage) RemoveAccess ¶
func (*DbStorage) RemoveAuthorize ¶
func (*DbStorage) RemoveClient ¶ added in v0.12.0
func (*DbStorage) RemoveRefresh ¶
func (*DbStorage) SaveAccess ¶
func (s *DbStorage) SaveAccess(data *osin.AccessData) (err error)
func (*DbStorage) SaveAuthorize ¶
func (s *DbStorage) SaveAuthorize(data *osin.AuthorizeData) error
func (*DbStorage) SaveAuthorized ¶ added in v0.6.3
type Servicer ¶ added in v0.6.3
type Servicer interface { schema.Authenticator schema.PeopleStore schema.PasswordStore schema.GroupStore cas.TicketStore OSIN() OSINStore Ready() error CloseAll() SaveStaff(staff *models.Staff) error InGroup(gn, uid string) bool InGroupAny(uid string, names ...string) bool ProfileModify(uid, password string, staff *models.Staff) error PasswordForgot(at common.AliasType, target, uid string) error PasswordResetTokenVerify(token string) (uid string, err error) PasswordResetWithToken(login, token, passwd string) (err error) Team() team.Store Watch() team.WatchStore Weekly() weekly.Store PoolStats() *PoolStats }
Servicer ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.