Documentation ¶
Index ¶
- Constants
- type Client
- type Flow
- type FlowHandler
- type FlowOptions
- type Handler
- func (h *Handler) AuthGetSessionTicketsWithQRSignature(ctx context.Context, req *getSessionTicketsWithQRSignatureRequest) (*Response, error)
- func (h *Handler) CheckCaptcha(ctx context.Context, username string, code []byte) (*Response, error)
- func (h *Handler) CheckPassword(ctx context.Context, username, password string) (*Response, error)
- func (h *Handler) CheckPicture(ctx context.Context, username string, code, sign []byte) (*Response, error)
- func (h *Handler) CheckSMSCode(ctx context.Context, username string, code []byte) (*Response, error)
- func (h *Handler) GetNextSeq() uint32
- func (h *Handler) GetUserSignature(username string) *rpc.UserSignature
- func (h *Handler) SendSMSCode(ctx context.Context, username string) (*Response, error)
- func (h *Handler) SignIn(ctx context.Context, username, password string) (*Response, error)
- type HandlerOptions
- type Request
- type Response
- type SendSMSCodeRequest
- func (req *SendSMSCodeRequest) GetSeq() uint32
- func (req *SendSMSCodeRequest) GetServiceMethod() string
- func (req *SendSMSCodeRequest) GetType() uint16
- func (req *SendSMSCodeRequest) GetUin() uint64
- func (req *SendSMSCodeRequest) GetUsername() string
- func (req *SendSMSCodeRequest) MustGetTLVs(ctx context.Context) map[uint16]tlv.TLVCodec
- func (req *SendSMSCodeRequest) SetSeq(seq uint32)
- func (req *SendSMSCodeRequest) SetServiceMethod(service string)
- func (req *SendSMSCodeRequest) SetType(typ uint16)
- func (req *SendSMSCodeRequest) SetUin(uin uint64)
- func (req *SendSMSCodeRequest) SetUsername(username string)
Constants ¶
View Source
const ( ServiceMethodAuthLogin = "wtlogin.login" ServiceMethodAuthExchange = "wtlogin.exchange" ServiceMethodAuthExchangeAccount = "wtlogin.exchange_emp" ServiceMethodAuthUsernameToUin = "wtlogin.name2uin" ServiceMethodAuthTransportAccount = "wtlogin.trans_emp" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Call( serviceMethod string, c2s *codec.ClientToServerMessage, s2c *codec.ServerToClientMessage, ) error GetNextSeq() uint32 GetUserSignature(username string) *rpc.UserSignature SetUserSignature( ctx context.Context, username string, tlvs map[uint16]tlv.TLVCodec, ) SetUserAuthSession(username string, session []byte) SetUserKSIDSession(username string, ksid []byte) SaveUserSignatures(file string) error }
type Flow ¶
type Flow struct {
// contains filtered or unexported fields
}
func NewFlow ¶
func NewFlow(opt *FlowOptions, h FlowHandler) *Flow
type FlowHandler ¶
type FlowHandler interface { CheckCaptcha(ctx context.Context, username string, code []byte) (*Response, error) CheckPassword(ctx context.Context, username, password string) (*Response, error) CheckPicture(ctx context.Context, username string, code, sign []byte) (*Response, error) CheckSMSCode(ctx context.Context, username string, code []byte) (*Response, error) SendSMSCode(ctx context.Context, username string) (*Response, error) SignIn(ctx context.Context, username, password string) (*Response, error) GetUserSignature(username string) *rpc.UserSignature }
type FlowOptions ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(opt *HandlerOptions, client Client) *Handler
func (*Handler) AuthGetSessionTicketsWithQRSignature ¶
func (*Handler) CheckCaptcha ¶
func (*Handler) CheckPassword ¶
func (*Handler) CheckPicture ¶
func (*Handler) CheckSMSCode ¶
func (*Handler) GetNextSeq ¶
func (*Handler) GetUserSignature ¶
func (h *Handler) GetUserSignature(username string) *rpc.UserSignature
func (*Handler) SendSMSCode ¶
type HandlerOptions ¶
type HandlerOptions struct { BaseDir string Client *config.ClientConfig Device *config.DeviceConfig }
type Response ¶
type Response struct { Code uint8 Uin uint64 Username string PictureSign []byte PictureData []byte CaptchaSign string ErrorCode uint32 ErrorTitle string ErrorMessage string Message string SMSMobile string AuthSession []byte T119 []byte T150 []byte T161 []byte T174 []byte T17B []byte T401 [16]byte T402 []byte T403 []byte T546 []byte LoginExtraData []byte }
type SendSMSCodeRequest ¶
type SendSMSCodeRequest struct { SMSAppID uint64 SubSigMap uint32 SubAppIDList []uint64 // contains filtered or unexported fields }
func (*SendSMSCodeRequest) GetServiceMethod ¶
func (req *SendSMSCodeRequest) GetServiceMethod() string
func (*SendSMSCodeRequest) GetUsername ¶
func (req *SendSMSCodeRequest) GetUsername() string
func (*SendSMSCodeRequest) MustGetTLVs ¶
func (*SendSMSCodeRequest) SetServiceMethod ¶
func (req *SendSMSCodeRequest) SetServiceMethod(service string)
func (*SendSMSCodeRequest) SetUsername ¶
func (req *SendSMSCodeRequest) SetUsername(username string)
Source Files ¶
- auth.go
- auth_crypto.go
- auth_flow.go
- auth_handler.go
- check_captcha_and_get_session_tickets.go
- check_picture_and_get_session_tickets.go
- check_sms_code_and_get_session_tickets.go
- get_session_tickets.go
- get_session_tickets_with_password.go
- get_session_tickets_with_qr_signature.go
- get_session_tickets_without_password.go
- send_sms_code.go
- unlock_device.go
Click to show internal directories.
Click to hide internal directories.