authorizer

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer interface {
	Name() string
	GetAccessToken(kratosx.Context, GetAccessTokenRequest) (*GetAccessTokenReply, error)
	GetAuthInfo(kratosx.Context, GetAuthInfoRequest) (*GetAuthInfoReply, error)
}

type Config

type Config struct {
	Ak       string
	Sk       string
	Code     string
	Redirect string
	Platform string
}

type GetAccessTokenReply

type GetAccessTokenReply struct {
	Token  string
	Expire time.Duration
}

type GetAccessTokenRequest

type GetAccessTokenRequest struct {
	Ak   string
	Sk   string
	Code string
}

type GetAuthInfoReply

type GetAuthInfoReply struct {
	AuthId  string
	UnionId *string
}

type GetAuthInfoRequest

type GetAuthInfoRequest struct {
	Token string
	Code  string
}

type Interface

type Interface interface {
	GetAuthorizers() map[string]Authorizer
	GetToken(ctx kratosx.Context) (*GetAccessTokenReply, error)
	GetAuthInfo(ctx kratosx.Context, token string) (*GetAuthInfoReply, error)
}

func New

func New(config *Config) Interface

Jump to

Keyboard shortcuts

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