v20200224

package
v1.0.931 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// 验证码签名错误。
	AUTHFAILURE_CAPSIGERROR = "AuthFailure.CapSigError"

	// 请求过期。
	AUTHFAILURE_EXPIRED = "AuthFailure.Expired"

	// 内部错误。
	INTERNALERROR = "InternalError"

	// 业务系统逻辑错误。
	INTERNALERROR_BACKENDLOGICERROR = "InternalError.BackendLogicError"

	// Sign后端错误。
	INTERNALERROR_SIGNBACKENDERROR = "InternalError.SignBackendError"

	// 验证码签名错误。
	INVALIDPARAMETER_CAPSIGERROR = "InvalidParameter.CapSigError"

	// 参数错误。
	INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError"

	// URL错误。
	INVALIDPARAMETER_URLERROR = "InvalidParameter.UrlError"

	// 版本错误。
	INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError"

	// BadBody。
	INVALIDPARAMETERVALUE_BADBODY = "InvalidParameterValue.BadBody"

	// 请求包过大。
	INVALIDPARAMETERVALUE_BODYTOOLARGE = "InvalidParameterValue.BodyTooLarge"

	// 验证码不匹配。
	INVALIDPARAMETERVALUE_CAPMISMATCH = "InvalidParameterValue.CapMisMatch"

	// HTTP方法错误。
	INVALIDPARAMETERVALUE_HTTPMETHODERROR = "InvalidParameterValue.HttpMethodError"

	// 超过配额。
	LIMITEXCEEDED_FREQCNT = "LimitExceeded.FreqCnt"

	// 超过配额(用户IP)。
	LIMITEXCEEDED_IPFREQCNT = "LimitExceeded.IpFreqCnt"

	// 关键词频控限制。
	LIMITEXCEEDED_KEYFREQCNT = "LimitExceeded.KeyFreqCnt"

	// 重放攻击。
	LIMITEXCEEDED_REPLAYATTACK = "LimitExceeded.ReplayAttack"

	// 接口不存在。
	RESOURCENOTFOUND_INTERFACENOTFOUND = "ResourceNotFound.InterfaceNotFound"

	// 未开通服务权限。
	RESOURCEUNAVAILABLE_PERMISSIONDENIED = "ResourceUnavailable.PermissionDenied"

	// 鉴权失败。
	UNAUTHORIZEDOPERATION_AUTHFAILED = "UnauthorizedOperation.AuthFailed"

	// 密钥不存在。
	UNKNOWNPARAMETER_SECRETIDNOTEXISTS = "UnknownParameter.SecretIdNotExists"
)
View Source
const APIVersion = "2020-02-24"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	common.Client
}

func NewClient

func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error)

func NewClientWithSecretId

func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error)

Deprecated

func (*Client) QueryLoginProtection

func (c *Client) QueryLoginProtection(request *QueryLoginProtectionRequest) (response *QueryLoginProtectionResponse, err error)

QueryLoginProtection 登录保护服务(LoginProtection,LP)针对网站和 APP 的用户登录场景,实时检测是否存在盗号、撞库等恶意登录行为,帮助开发者发现异常登录,降低恶意用户登录给业务带来的风险。

可能返回的错误码:

AUTHFAILURE_CAPSIGERROR = "AuthFailure.CapSigError"
AUTHFAILURE_EXPIRED = "AuthFailure.Expired"
INTERNALERROR = "InternalError"
INTERNALERROR_BACKENDLOGICERROR = "InternalError.BackendLogicError"
INTERNALERROR_SIGNBACKENDERROR = "InternalError.SignBackendError"
INVALIDPARAMETER_CAPSIGERROR = "InvalidParameter.CapSigError"
INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError"
INVALIDPARAMETER_URLERROR = "InvalidParameter.UrlError"
INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError"
INVALIDPARAMETERVALUE_BADBODY = "InvalidParameterValue.BadBody"
INVALIDPARAMETERVALUE_BODYTOOLARGE = "InvalidParameterValue.BodyTooLarge"
INVALIDPARAMETERVALUE_CAPMISMATCH = "InvalidParameterValue.CapMisMatch"
INVALIDPARAMETERVALUE_HTTPMETHODERROR = "InvalidParameterValue.HttpMethodError"
LIMITEXCEEDED_FREQCNT = "LimitExceeded.FreqCnt"
LIMITEXCEEDED_IPFREQCNT = "LimitExceeded.IpFreqCnt"
LIMITEXCEEDED_KEYFREQCNT = "LimitExceeded.KeyFreqCnt"
LIMITEXCEEDED_REPLAYATTACK = "LimitExceeded.ReplayAttack"
RESOURCENOTFOUND_INTERFACENOTFOUND = "ResourceNotFound.InterfaceNotFound"
RESOURCEUNAVAILABLE_PERMISSIONDENIED = "ResourceUnavailable.PermissionDenied"
UNAUTHORIZEDOPERATION_AUTHFAILED = "UnauthorizedOperation.AuthFailed"
UNKNOWNPARAMETER_SECRETIDNOTEXISTS = "UnknownParameter.SecretIdNotExists"

func (*Client) QueryLoginProtectionWithContext added in v1.0.324

func (c *Client) QueryLoginProtectionWithContext(ctx context.Context, request *QueryLoginProtectionRequest) (response *QueryLoginProtectionResponse, err error)

QueryLoginProtection 登录保护服务(LoginProtection,LP)针对网站和 APP 的用户登录场景,实时检测是否存在盗号、撞库等恶意登录行为,帮助开发者发现异常登录,降低恶意用户登录给业务带来的风险。

可能返回的错误码:

AUTHFAILURE_CAPSIGERROR = "AuthFailure.CapSigError"
AUTHFAILURE_EXPIRED = "AuthFailure.Expired"
INTERNALERROR = "InternalError"
INTERNALERROR_BACKENDLOGICERROR = "InternalError.BackendLogicError"
INTERNALERROR_SIGNBACKENDERROR = "InternalError.SignBackendError"
INVALIDPARAMETER_CAPSIGERROR = "InvalidParameter.CapSigError"
INVALIDPARAMETER_PARAMERROR = "InvalidParameter.ParamError"
INVALIDPARAMETER_URLERROR = "InvalidParameter.UrlError"
INVALIDPARAMETER_VERSIONERROR = "InvalidParameter.VersionError"
INVALIDPARAMETERVALUE_BADBODY = "InvalidParameterValue.BadBody"
INVALIDPARAMETERVALUE_BODYTOOLARGE = "InvalidParameterValue.BodyTooLarge"
INVALIDPARAMETERVALUE_CAPMISMATCH = "InvalidParameterValue.CapMisMatch"
INVALIDPARAMETERVALUE_HTTPMETHODERROR = "InvalidParameterValue.HttpMethodError"
LIMITEXCEEDED_FREQCNT = "LimitExceeded.FreqCnt"
LIMITEXCEEDED_IPFREQCNT = "LimitExceeded.IpFreqCnt"
LIMITEXCEEDED_KEYFREQCNT = "LimitExceeded.KeyFreqCnt"
LIMITEXCEEDED_REPLAYATTACK = "LimitExceeded.ReplayAttack"
RESOURCENOTFOUND_INTERFACENOTFOUND = "ResourceNotFound.InterfaceNotFound"
RESOURCEUNAVAILABLE_PERMISSIONDENIED = "ResourceUnavailable.PermissionDenied"
UNAUTHORIZEDOPERATION_AUTHFAILED = "UnauthorizedOperation.AuthFailed"
UNKNOWNPARAMETER_SECRETIDNOTEXISTS = "UnknownParameter.SecretIdNotExists"

type QueryLoginProtectionRequest

type QueryLoginProtectionRequest struct {
	*tchttp.BaseRequest

	// 登录来源的外网 IP。
	LoginIp *string `json:"LoginIp,omitnil,omitempty" name:"LoginIp"`

	// 用户 ID 不同的 accountType 对应不同的用户 ID。如果是 QQ,则填入对应的 openid,微信用户则填入对应的 openid/unionid,手机号则填入对应真实用户手机号(如13123456789)。
	Uid *string `json:"Uid,omitnil,omitempty" name:"Uid"`

	// 登录时间戳,单位:秒。
	LoginTime *string `json:"LoginTime,omitnil,omitempty" name:"LoginTime"`

	// 用户账号类型(QQ 开放帐号、微信开放账号需要 提交工单 由腾讯云进行资格审核):
	// 1:QQ 开放帐号。
	// 2:微信开放账号。
	// 4:手机号。
	// 0:其他。
	// 10004:手机号 MD5。
	AccountType *string `json:"AccountType,omitnil,omitempty" name:"AccountType"`

	// accountType 是 QQ 或微信开放账号时,该参数必填,表示 QQ 或微信分配给网站或应用的 AppID,用来唯一标识网站或应用。
	AppIdU *string `json:"AppIdU,omitnil,omitempty" name:"AppIdU"`

	// accountType 是 QQ 或微信开放账号时,用于标识 QQ 或微信用户登录后关联业务自身的账号 ID。
	AssociateAccount *string `json:"AssociateAccount,omitnil,omitempty" name:"AssociateAccount"`

	// 昵称,UTF-8 编码。
	NickName *string `json:"NickName,omitnil,omitempty" name:"NickName"`

	// 手机号:国家代码-手机号, 如0086-15912345687(0086前不需要+号)。
	PhoneNumber *string `json:"PhoneNumber,omitnil,omitempty" name:"PhoneNumber"`

	// 用户邮箱地址(非系统自动生成)。
	EmailAddress *string `json:"EmailAddress,omitnil,omitempty" name:"EmailAddress"`

	// 注册来源的外网 IP。
	RegisterTime *string `json:"RegisterTime,omitnil,omitempty" name:"RegisterTime"`

	// 地址。
	Address *string `json:"Address,omitnil,omitempty" name:"Address"`

	// 用户 HTTP 请求中的 cookie 进行2次 hash 的值,只要保证相同 cookie 的 hash 值一致即可。
	CookieHash *string `json:"CookieHash,omitnil,omitempty" name:"CookieHash"`

	// 登录来源:
	// 0:其他
	// 1:PC 网页
	// 2:移动页面
	// 3:App
	// 4:微信公众号
	LoginSource *string `json:"LoginSource,omitnil,omitempty" name:"LoginSource"`

	// 登录方式:
	// 0:其他
	// 1:手动帐号密码输入
	// 2:动态短信密码登录
	// 3:二维码扫描登录
	LoginType *string `json:"LoginType,omitnil,omitempty" name:"LoginType"`

	// 用户 HTTP 请求的 referer 值。
	Referer *string `json:"Referer,omitnil,omitempty" name:"Referer"`

	// 登录成功后跳转页面。
	JumpUrl *string `json:"JumpUrl,omitnil,omitempty" name:"JumpUrl"`

	// 用户 HTTP 请求的 userAgent。
	UserAgent *string `json:"UserAgent,omitnil,omitempty" name:"UserAgent"`

	// 用户 HTTP 请求中的 x_forward_for。
	XForwardedFor *string `json:"XForwardedFor,omitnil,omitempty" name:"XForwardedFor"`

	// 用户操作过程中鼠标单击次数。
	MouseClickCount *string `json:"MouseClickCount,omitnil,omitempty" name:"MouseClickCount"`

	// 用户操作过程中键盘单击次数。
	KeyboardClickCount *string `json:"KeyboardClickCount,omitnil,omitempty" name:"KeyboardClickCount"`

	// 注册结果:
	// 0:失败
	// 1:成功
	Result *string `json:"Result,omitnil,omitempty" name:"Result"`

	// 失败原因:
	// 0:其他
	// 1:参数错误
	// 2:帐号冲突
	// 3:验证错误
	Reason *string `json:"Reason,omitnil,omitempty" name:"Reason"`

	// 登录耗时,单位:秒。
	LoginSpend *string `json:"LoginSpend,omitnil,omitempty" name:"LoginSpend"`

	// MAC 地址或设备唯一标识。
	MacAddress *string `json:"MacAddress,omitnil,omitempty" name:"MacAddress"`

	// 手机制造商 ID,如果手机注册,请带上此信息。
	VendorId *string `json:"VendorId,omitnil,omitempty" name:"VendorId"`

	// App 客户端版本。
	AppVersion *string `json:"AppVersion,omitnil,omitempty" name:"AppVersion"`

	// 手机设备号。
	Imei *string `json:"Imei,omitnil,omitempty" name:"Imei"`

	// 业务 ID 网站或应用在多个业务中使用此服务,通过此 ID 区分统计数据。
	BusinessId *string `json:"BusinessId,omitnil,omitempty" name:"BusinessId"`

	// 1:微信公众号
	// 2:微信小程序
	WxSubType *string `json:"WxSubType,omitnil,omitempty" name:"WxSubType"`

	// Token 签名随机数,微信小程序必填,建议16个字符。
	RandNum *string `json:"RandNum,omitnil,omitempty" name:"RandNum"`

	// 如果是微信小程序,该字段为以 ssesion_key 为 key 去签名随机数radnNum得到的值(hmac_sha256 签名算法)。
	// 如果是微信公众号或第三方登录,则为授权的 access_token(注意:不是普通 access_token,具体看 微信官方文档)。
	WxToken *string `json:"WxToken,omitnil,omitempty" name:"WxToken"`
}

func NewQueryLoginProtectionRequest

func NewQueryLoginProtectionRequest() (request *QueryLoginProtectionRequest)

func (*QueryLoginProtectionRequest) FromJsonString

func (r *QueryLoginProtectionRequest) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*QueryLoginProtectionRequest) ToJsonString

func (r *QueryLoginProtectionRequest) ToJsonString() string

type QueryLoginProtectionRequestParams added in v1.0.426

type QueryLoginProtectionRequestParams struct {
	// 登录来源的外网 IP。
	LoginIp *string `json:"LoginIp,omitnil,omitempty" name:"LoginIp"`

	// 用户 ID 不同的 accountType 对应不同的用户 ID。如果是 QQ,则填入对应的 openid,微信用户则填入对应的 openid/unionid,手机号则填入对应真实用户手机号(如13123456789)。
	Uid *string `json:"Uid,omitnil,omitempty" name:"Uid"`

	// 登录时间戳,单位:秒。
	LoginTime *string `json:"LoginTime,omitnil,omitempty" name:"LoginTime"`

	// 用户账号类型(QQ 开放帐号、微信开放账号需要 提交工单 由腾讯云进行资格审核):
	// 1:QQ 开放帐号。
	// 2:微信开放账号。
	// 4:手机号。
	// 0:其他。
	// 10004:手机号 MD5。
	AccountType *string `json:"AccountType,omitnil,omitempty" name:"AccountType"`

	// accountType 是 QQ 或微信开放账号时,该参数必填,表示 QQ 或微信分配给网站或应用的 AppID,用来唯一标识网站或应用。
	AppIdU *string `json:"AppIdU,omitnil,omitempty" name:"AppIdU"`

	// accountType 是 QQ 或微信开放账号时,用于标识 QQ 或微信用户登录后关联业务自身的账号 ID。
	AssociateAccount *string `json:"AssociateAccount,omitnil,omitempty" name:"AssociateAccount"`

	// 昵称,UTF-8 编码。
	NickName *string `json:"NickName,omitnil,omitempty" name:"NickName"`

	// 手机号:国家代码-手机号, 如0086-15912345687(0086前不需要+号)。
	PhoneNumber *string `json:"PhoneNumber,omitnil,omitempty" name:"PhoneNumber"`

	// 用户邮箱地址(非系统自动生成)。
	EmailAddress *string `json:"EmailAddress,omitnil,omitempty" name:"EmailAddress"`

	// 注册来源的外网 IP。
	RegisterTime *string `json:"RegisterTime,omitnil,omitempty" name:"RegisterTime"`

	// 地址。
	Address *string `json:"Address,omitnil,omitempty" name:"Address"`

	// 用户 HTTP 请求中的 cookie 进行2次 hash 的值,只要保证相同 cookie 的 hash 值一致即可。
	CookieHash *string `json:"CookieHash,omitnil,omitempty" name:"CookieHash"`

	// 登录来源:
	// 0:其他
	// 1:PC 网页
	// 2:移动页面
	// 3:App
	// 4:微信公众号
	LoginSource *string `json:"LoginSource,omitnil,omitempty" name:"LoginSource"`

	// 登录方式:
	// 0:其他
	// 1:手动帐号密码输入
	// 2:动态短信密码登录
	// 3:二维码扫描登录
	LoginType *string `json:"LoginType,omitnil,omitempty" name:"LoginType"`

	// 用户 HTTP 请求的 referer 值。
	Referer *string `json:"Referer,omitnil,omitempty" name:"Referer"`

	// 登录成功后跳转页面。
	JumpUrl *string `json:"JumpUrl,omitnil,omitempty" name:"JumpUrl"`

	// 用户 HTTP 请求的 userAgent。
	UserAgent *string `json:"UserAgent,omitnil,omitempty" name:"UserAgent"`

	// 用户 HTTP 请求中的 x_forward_for。
	XForwardedFor *string `json:"XForwardedFor,omitnil,omitempty" name:"XForwardedFor"`

	// 用户操作过程中鼠标单击次数。
	MouseClickCount *string `json:"MouseClickCount,omitnil,omitempty" name:"MouseClickCount"`

	// 用户操作过程中键盘单击次数。
	KeyboardClickCount *string `json:"KeyboardClickCount,omitnil,omitempty" name:"KeyboardClickCount"`

	// 注册结果:
	// 0:失败
	// 1:成功
	Result *string `json:"Result,omitnil,omitempty" name:"Result"`

	// 失败原因:
	// 0:其他
	// 1:参数错误
	// 2:帐号冲突
	// 3:验证错误
	Reason *string `json:"Reason,omitnil,omitempty" name:"Reason"`

	// 登录耗时,单位:秒。
	LoginSpend *string `json:"LoginSpend,omitnil,omitempty" name:"LoginSpend"`

	// MAC 地址或设备唯一标识。
	MacAddress *string `json:"MacAddress,omitnil,omitempty" name:"MacAddress"`

	// 手机制造商 ID,如果手机注册,请带上此信息。
	VendorId *string `json:"VendorId,omitnil,omitempty" name:"VendorId"`

	// App 客户端版本。
	AppVersion *string `json:"AppVersion,omitnil,omitempty" name:"AppVersion"`

	// 手机设备号。
	Imei *string `json:"Imei,omitnil,omitempty" name:"Imei"`

	// 业务 ID 网站或应用在多个业务中使用此服务,通过此 ID 区分统计数据。
	BusinessId *string `json:"BusinessId,omitnil,omitempty" name:"BusinessId"`

	// 1:微信公众号
	// 2:微信小程序
	WxSubType *string `json:"WxSubType,omitnil,omitempty" name:"WxSubType"`

	// Token 签名随机数,微信小程序必填,建议16个字符。
	RandNum *string `json:"RandNum,omitnil,omitempty" name:"RandNum"`

	// 如果是微信小程序,该字段为以 ssesion_key 为 key 去签名随机数radnNum得到的值(hmac_sha256 签名算法)。
	// 如果是微信公众号或第三方登录,则为授权的 access_token(注意:不是普通 access_token,具体看 微信官方文档)。
	WxToken *string `json:"WxToken,omitnil,omitempty" name:"WxToken"`
}

Predefined struct for user

type QueryLoginProtectionResponse

type QueryLoginProtectionResponse struct {
	*tchttp.BaseResponse
	Response *QueryLoginProtectionResponseParams `json:"Response"`
}

func NewQueryLoginProtectionResponse

func NewQueryLoginProtectionResponse() (response *QueryLoginProtectionResponse)

func (*QueryLoginProtectionResponse) FromJsonString

func (r *QueryLoginProtectionResponse) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*QueryLoginProtectionResponse) ToJsonString

func (r *QueryLoginProtectionResponse) ToJsonString() string

type QueryLoginProtectionResponseParams added in v1.0.426

type QueryLoginProtectionResponseParams struct {
	// AssociateAccount
	//
	// accountType 是 QQ 或微信开放账号时,用于标识 QQ 或微信用户登录后关联业务自身的账号 ID。
	// LoginTime
	//
	// 操作时间。
	// Uid
	//
	// 用户 ID 不同的 accountType 对应不同的用户 ID。如果是 QQ,则填入对应的 openid,微信用户则填入对应的 openid/unionid,手机号则填入对应真实用户手机号(如13123456789)。
	// LoginIp
	//
	// 登录 IP。
	// Level
	//
	// 0:表示无恶意。
	// 1 - 4:恶意等级由低到高。
	// RiskType
	//
	// 风险类型。
	// 出参不用填"Req业务侧错误码。成功时返回 Success,错误时返回具体业务错误原因。uestId"等公共出参, 详细解释>>>
	// 注意:此字段可能返回 null,表示取不到有效值。
	CodeDesc *string `json:"CodeDesc,omitnil,omitempty" name:"CodeDesc"`

	// accountType 是 QQ 或微信开放账号时,用于标识 QQ 或微信用户登录后关联业务自身的账号 ID。
	// 注意:此字段可能返回 null,表示取不到有效值。
	AssociateAccount *string `json:"AssociateAccount,omitnil,omitempty" name:"AssociateAccount"`

	// 操作时间。
	// 注意:此字段可能返回 null,表示取不到有效值。
	LoginTime *string `json:"LoginTime,omitnil,omitempty" name:"LoginTime"`

	// 用户 ID 不同的 accountType 对应不同的用户 ID。如果是 QQ,则填入对应的 openid,微信用户则填入对应的 openid/unionid,手机号则填入对应真实用户手机号(如13123456789)。
	// 注意:此字段可能返回 null,表示取不到有效值。
	Uid *string `json:"Uid,omitnil,omitempty" name:"Uid"`

	// 登录 IP。
	// 注意:此字段可能返回 null,表示取不到有效值。
	LoginIp *string `json:"LoginIp,omitnil,omitempty" name:"LoginIp"`

	// 0:表示无恶意。
	// 1 - 4:恶意等级由低到高。
	Level *int64 `json:"Level,omitnil,omitempty" name:"Level"`

	// 风险类型。
	RiskType []*int64 `json:"RiskType,omitnil,omitempty" name:"RiskType"`

	// accountType 是 QQ 或微信开放账号时,用于标识 QQ 或微信用户登录后关联业务自身的账号 ID。
	// 注意:此字段可能返回 null,表示取不到有效值。
	RootId *string `json:"RootId,omitnil,omitempty" name:"RootId"`

	// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

Predefined struct for user

Jump to

Keyboard shortcuts

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