o2r

package
v1.1.3-0...-e5dd412 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const RedisKeyOauth2Client = "oauth2_client"

Variables

This section is empty.

Functions

func NewTokenStore

func NewTokenStore(cfg *redis.Options) (ts oauth2.TokenStore, err error)

NewTokenStore Create a token store instance based on redis

Types

type ClientValue

type ClientValue struct {
	Secret string `bson:"secret" json:"secret"`
	Domain string `bson:"domain" json:"domain"`
	UserID string `bson:"user_id" json:"user_id"`
}

type RedisCaptchaStore

type RedisCaptchaStore struct {
	// contains filtered or unexported fields
}

func NewRedisCaptchaStore

func NewRedisCaptchaStore(cfg *redis.Options, expireDuration time.Duration) (cs *RedisCaptchaStore, err error)

func (*RedisCaptchaStore) Remove

func (cs *RedisCaptchaStore) Remove(mobile string) (err error)

func (*RedisCaptchaStore) Save

func (cs *RedisCaptchaStore) Save(mobile, captcha string) (err error)

func (*RedisCaptchaStore) Valid

func (cs *RedisCaptchaStore) Valid(mobile, captcha string) (valid bool, err error)

type RedisClientStore

type RedisClientStore struct {
	// contains filtered or unexported fields
}

RedisTokenStore redis token store

func NewClientStore

func NewClientStore(cfg *redis.Options) (clientStore *RedisClientStore, err error)

func (*RedisClientStore) GetByID

func (cs *RedisClientStore) GetByID(id string) (cli oauth2.ClientInfo, err error)

GetByID according to the ID for the client information

func (*RedisClientStore) Set

func (cs *RedisClientStore) Set(id string, cli oauth2.ClientInfo) (err error)

Set set client information

type RedisTokenStore

type RedisTokenStore struct {
	// contains filtered or unexported fields
}

RedisTokenStore redis token store

func (*RedisTokenStore) Create

func (rs *RedisTokenStore) Create(info oauth2.TokenInfo) (err error)

Create Create and store the new token information

func (*RedisTokenStore) GetByAccess

func (rs *RedisTokenStore) GetByAccess(access string) (ti oauth2.TokenInfo, err error)

GetByAccess Use the access token for token information data

func (*RedisTokenStore) GetByCode

func (rs *RedisTokenStore) GetByCode(code string) (ti oauth2.TokenInfo, err error)

GetByCode Use the authorization code for token information data

func (*RedisTokenStore) GetByRefresh

func (rs *RedisTokenStore) GetByRefresh(refresh string) (ti oauth2.TokenInfo, err error)

GetByRefresh Use the refresh token for token information data

func (*RedisTokenStore) RemoveByAccess

func (rs *RedisTokenStore) RemoveByAccess(access string) (err error)

RemoveByAccess Use the access token to delete the token information

func (*RedisTokenStore) RemoveByCode

func (rs *RedisTokenStore) RemoveByCode(code string) (err error)

RemoveByCode Use the authorization code to delete the token information

func (*RedisTokenStore) RemoveByRefresh

func (rs *RedisTokenStore) RemoveByRefresh(refresh string) (err error)

RemoveByRefresh Use the refresh token to delete the token information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL