auth

package
v0.0.0-...-3596c24 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAllowAuthMethod = errors.New("not allow auth method")
	ErrAuthFail           = errors.New("auth fail")
)

Functions

This section is empty.

Types

type Acl

type Acl interface {
	Sub(cid string, sub topic.Sub) bool
	Pub(cid string, msg message.Message) bool
}

type Auth

type Auth interface {
	// Verify 普通校验
	Verify(name string, cred interface{}) error

	PlusVerify(method string) (PlusVerify, bool)
}

type Manager

type Manager interface {
	Auth
	Acl
}

type PlusVerify

type PlusVerify interface {
	Should(method string) bool
	// Verify
	// param: authData 认证数据
	// return:
	//        d: 继续校验的认证数据
	//        continueAuth:true:成功,false:继续校验
	//        err != nil: 校验失败
	Verify(authData []byte) (d []byte, continueAuth bool, err error) // 客户端自己验证时,忽略continueAuth
}

Jump to

Keyboard shortcuts

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