authorizer

package
v1.0.33 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 8 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
	Extra    string
	Platform string
}

type GetAccessTokenReply

type GetAccessTokenReply struct {
	Token  string
	Expire int64
}

type GetAccessTokenRequest

type GetAccessTokenRequest struct {
	Ak    string
	Sk    string
	Extra string
	Code  string
}

type GetAuthInfoReply

type GetAuthInfoReply struct {
	AuthId  string
	UnionId *string
}

type GetAuthInfoRequest

type GetAuthInfoRequest struct {
	Ak    string
	Sk    string
	Extra string
	Code  string
	Token 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