face

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: BSD-3-Clause Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access interface {
	GetAccessToken() string
	GetRefreshToken() string
	GetClient() Client
	GetUser() User
	GetExpiresIn() int32
	GetScope() string
	GetCreatedAt() time.Time
	GetDeletedAt() time.Time
	IsExpired() bool
	IsExpiredAt(t time.Time) bool
	ExpireAt() time.Time
}

type AccessToken

type AccessToken interface {
	GenerateAccessToken(data Access, generaterefresh bool) (accesstoken string, refreshtoken string, err error)
	VerifyToken(code string) (Access, error)
}

type AccessTokenDefault

type AccessTokenDefault struct {
}

AccessTokenGenDefault is the default authorization token generator

func (*AccessTokenDefault) GenerateAccessToken

func (a *AccessTokenDefault) GenerateAccessToken(data Access, generaterefresh bool) (accesstoken string, refreshtoken string, err error)

GenerateAccessToken generates base64-encoded UUID access and refresh tokens

func (*AccessTokenDefault) VerifyToken

func (a *AccessTokenDefault) VerifyToken(code string) (Access, error)

type Authorize

type Authorize interface {
	GetCode() string
	GetClient() Client
	GetUser() User
	GetState() string
	GetExpiresIn() int32
	GetScope() string
	GetRedirectUri() string
	GetCodeChallenge() string
	GetCodeChallengeMethod() string
	GetCreatedAt() time.Time
	GetDeletedAt() time.Time
	IsExpired() bool
	IsExpiredAt(t time.Time) bool
	ExpireAt() time.Time
}

type AuthorizeCode

type AuthorizeCode interface {
	GenerateCode(req *request.AuthorizeRequest) (accesstoken string, err error)
}

type AuthorizeCodeDefault

type AuthorizeCodeDefault struct {
}

AuthorizeTokenGenDefault is the default authorization token generator

func (*AuthorizeCodeDefault) GenerateCode

func (a *AuthorizeCodeDefault) GenerateCode(req *request.AuthorizeRequest) (token string, err error)

GenerateAuthorizeToken generates a base64-encoded UUID code

type Client

type Client interface {
	GetId() string
	GetNeedLogin() bool
	GetRedirectUri() string
	GetSecret() string
	GetNeedRefresh() bool
}

type User

type User interface {
	GetId() string
	GetUsername() string
	GetPassword() string
	GetEmail() string
	GetMobile() string
}

Jump to

Keyboard shortcuts

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