face

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: BSD-3-Clause Imports: 9 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 AccessTokenGen added in v0.1.9

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

func NewAccessDefaultTokenGen added in v0.1.9

func NewAccessDefaultTokenGen() AccessTokenGen

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 AuthorizeCodeGen added in v0.1.9

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

func NewAuthorizeDefaultCodeGen added in v0.1.9

func NewAuthorizeDefaultCodeGen() AuthorizeCodeGen

type Client

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

type PasswordGen added in v0.1.9

type PasswordGen interface {
	Salt() ([]byte, error)
	Generate(key []byte, salt []byte) []byte
	Compare(password string, salt []byte, data []byte) bool
}

func NewPasswordDefaultGen added in v0.1.9

func NewPasswordDefaultGen() PasswordGen

type User

type User interface {
	GetId() string
	GetUsername() string
	GetPassword() []byte
	GetSalt() []byte
	GetEmail() string
	GetMobile() string
}

Jump to

Keyboard shortcuts

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