auth

package
v0.0.0-...-d9311aa Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoginTypeUin = uint32(1)
	LoginTypeSMS = uint32(3)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Username string
	Password [16]byte
	Generate bool
}

type CaptchaSign

type CaptchaSign struct {
	Ticket string `json:"ticket"`
	Random string `json:"random"`
	Return string `json:"return"`
	AppID  uint64 `json:"app_id"`
}

type Daemon

type Daemon interface {
	Call(serviceMethod string, args *rpc.Args, reply *rpc.Reply) error
}

type ExtraData

type ExtraData struct {
	Login []byte `json:"login,omitempty"`
	T16A  []byte `json:"t16a,omitempty"`
	T172  []byte `json:"t172,omitempty"`

	SessionAuth  []byte `json:"session_auth,omitempty"`
	PictureSign  []byte `json:"picture_sign,omitempty"`
	PictureData  []byte `json:"picture_data,omitempty"`
	CaptchaSign  string `json:"captcha_sign,omitempty"`
	ErrorCode    uint32 `json:"error_code,omitempty"`
	ErrorTitle   string `json:"error_title,omitempty"`
	ErrorMessage string `json:"error_message,omitempty"`
	Message      string `json:"message,omitempty"`
	SMSMobile    string `json:"sms_mobile,omitempty"`

	Salt uint64 `json:"salt,omitempty"`

	SignInCodeSign []byte                     `json:"signin_code_sign,omitempty"`
	ThirdPartLogin *pb.ThirdPartLogin_RspBody `json:"third_part_login,omitempty"`

	T119 []byte          `json:"t119,omitempty"`
	T150 []byte          `json:"t150,omitempty"`
	T161 []byte          `json:"t161,omitempty"`
	T174 []byte          `json:"t174,omitempty"`
	T17B []byte          `json:"t17b,omitempty"`
	T182 []byte          `json:"t182,omitempty"`
	T401 *rpc.Key16Bytes `json:"t401,omitempty"`
	T402 []byte          `json:"t402,omitempty"`
	T403 []byte          `json:"t403,omitempty"`
	T542 []byte          `json:"t542,omitempty"`
	T546 []byte          `json:"t546,omitempty"`
	T547 []byte          `json:"t547,omitempty"`
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(ctx context.Context, c rpc.Client, d Daemon) *Manager

func (*Manager) GetAccount

func (m *Manager) GetAccount(username string) (oldAccount *Account)

func (*Manager) GetExtraData

func (m *Manager) GetExtraData(uin int64) *ExtraData

func (*Manager) SetAccount

func (m *Manager) SetAccount(username, password string) (oldAccount *Account)

func (*Manager) SignIn

func (m *Manager) SignIn(username, password string) (*Response, error)

func (*Manager) SignInCreateToken

func (m *Manager) SignInCreateToken(username string, uin int64) (*Response, error)

func (*Manager) SignInUpdateToken

func (m *Manager) SignInUpdateToken(username string, changeD2 ...bool) (*Response, error)

func (*Manager) VerifyCaptcha

func (m *Manager) VerifyCaptcha(uin int64, code []byte, sign ...[]byte) (*Response, error)

func (*Manager) VerifySMSCode

func (m *Manager) VerifySMSCode(uin int64, code []byte) (*Response, error)

func (*Manager) VerifySignInCode

func (m *Manager) VerifySignInCode(code []byte) (*Response, error)

type Request

type Request struct {
	ServiceMethod string     `json:"service_method,omitempty"`
	Seq           int32      `json:"seq,omitempty"`
	Data          *oicq.Data `json:"data,omitempty"`
}

type Response

type Response struct {
	ServiceMethod string     `json:"service_method,omitempty"`
	Seq           int32      `json:"seq,omitempty"`
	Data          *oicq.Data `json:"data,omitempty"`
	ExtraData     *ExtraData `json:"extra_data,omitempty"`
}

func (*Response) SetExtraData

func (resp *Response) SetExtraData(tlvs map[uint16]tlv.Codec) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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