Documentation ¶
Index ¶
- type ClientStore
- type DBTokenStore
- func (dts *DBTokenStore) Create(ctx context.Context, info oauth2.TokenInfo) error
- func (dts *DBTokenStore) GetByAccess(ctx context.Context, access string) (oauth2.TokenInfo, error)
- func (dts *DBTokenStore) GetByCode(ctx context.Context, code string) (oauth2.TokenInfo, error)
- func (dts *DBTokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)
- func (dts *DBTokenStore) RemoveByAccess(ctx context.Context, access string) error
- func (dts *DBTokenStore) RemoveByCode(ctx context.Context, code string) error
- func (dts *DBTokenStore) RemoveByRefresh(ctx context.Context, refresh string) error
- type DbUserStore
- func (ds *DbUserStore) GetClaims(account string, scope string) (interface{}, error)
- func (ds *DbUserStore) GetUserByAccount(account string) (*models.User, error)
- func (ds *DbUserStore) GetUserByID(id string) (*models.User, error)
- func (ds *DbUserStore) GetUserPasswordHash(account string) (string, error)
- type UserStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientStore ¶
type ClientStore struct { DB *gorm.DB Cache cache.ICacheProvider // contains filtered or unexported fields }
ClientStore 用于存储Client信息的
func NewClientStore ¶
func NewClientStore(db *gorm.DB) *ClientStore
func (*ClientStore) GetByID ¶
func (cs *ClientStore) GetByID(ctx context.Context, id string) (oauth2.ClientInfo, error)
GetByID 通过ID获取Client信息
func (*ClientStore) ValidateSecret ¶
func (cs *ClientStore) ValidateSecret(clientId, secret string) error
type DBTokenStore ¶
DBTokenStore 存储于数据库的Token
func (*DBTokenStore) GetByAccess ¶
GetByAccess use the access token for token information data
func (*DBTokenStore) GetByRefresh ¶
func (dts *DBTokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)
GetByRefresh use the refresh token for token information data
func (*DBTokenStore) RemoveByAccess ¶
func (dts *DBTokenStore) RemoveByAccess(ctx context.Context, access string) error
RemoveByAccess use the access token to delete the token information
func (*DBTokenStore) RemoveByCode ¶
func (dts *DBTokenStore) RemoveByCode(ctx context.Context, code string) error
RemoveByCode delete the authorization code
func (*DBTokenStore) RemoveByRefresh ¶
func (dts *DBTokenStore) RemoveByRefresh(ctx context.Context, refresh string) error
RemoveByRefresh use the refresh token to delete the token information
type DbUserStore ¶
type DbUserStore struct {
// contains filtered or unexported fields
}
func NewDbUserStore ¶
func NewDbUserStore(db *gorm.DB) *DbUserStore
func (*DbUserStore) GetClaims ¶
func (ds *DbUserStore) GetClaims(account string, scope string) (interface{}, error)
func (*DbUserStore) GetUserByAccount ¶
func (ds *DbUserStore) GetUserByAccount(account string) (*models.User, error)
func (*DbUserStore) GetUserByID ¶
func (ds *DbUserStore) GetUserByID(id string) (*models.User, error)
func (*DbUserStore) GetUserPasswordHash ¶
func (ds *DbUserStore) GetUserPasswordHash(account string) (string, error)
Click to show internal directories.
Click to hide internal directories.