加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
store.go 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
Kaczanowski Mateusz 提交于 2020-05-15 17:07 . add context support
package oauth2
import "context"
type (
// ClientStore the client information storage interface
ClientStore interface {
// according to the ID for the client information
GetByID(ctx context.Context, id string) (ClientInfo, error)
}
// TokenStore the token information storage interface
TokenStore interface {
// create and store the new token information
Create(ctx context.Context, info TokenInfo) error
// delete the authorization code
RemoveByCode(ctx context.Context, code string) error
// use the access token to delete the token information
RemoveByAccess(ctx context.Context, access string) error
// use the refresh token to delete the token information
RemoveByRefresh(ctx context.Context, refresh string) error
// use the authorization code for token information data
GetByCode(ctx context.Context, code string) (TokenInfo, error)
// use the access token for token information data
GetByAccess(ctx context.Context, access string) (TokenInfo, error)
// use the refresh token for token information data
GetByRefresh(ctx context.Context, refresh string) (TokenInfo, error)
}
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化