Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) QueryRegisterProtection(request *QueryRegisterProtectionRequest) (response *QueryRegisterProtectionResponse, err error)
- func (c *Client) QueryRegisterProtectionWithContext(ctx context.Context, request *QueryRegisterProtectionRequest) (response *QueryRegisterProtectionResponse, err error)
- type QueryRegisterProtectionRequest
- type QueryRegisterProtectionRequestParams
- type QueryRegisterProtectionResponse
- type QueryRegisterProtectionResponseParams
Constants ¶
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" )
const APIVersion = "2020-02-24"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewClient ¶
func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error)
func NewClientWithSecretId ¶
Deprecated
func (*Client) QueryRegisterProtection ¶
func (c *Client) QueryRegisterProtection(request *QueryRegisterProtectionRequest) (response *QueryRegisterProtectionResponse, err error)
QueryRegisterProtection 注册保护服务(RegisterProtection,RP)针对网站、APP 的线上注册场景,遇到 “恶意注册” 、“小号注册” 、“注册器注册” 等恶意行为,提供基于天御 DNA 算法的恶意防护引擎,从账号、设备、行为三个维度有效识别 “恶意注册”,从“源头”上防范业务风险。
可能返回的错误码:
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) QueryRegisterProtectionWithContext ¶ added in v1.0.324
func (c *Client) QueryRegisterProtectionWithContext(ctx context.Context, request *QueryRegisterProtectionRequest) (response *QueryRegisterProtectionResponse, err error)
QueryRegisterProtection 注册保护服务(RegisterProtection,RP)针对网站、APP 的线上注册场景,遇到 “恶意注册” 、“小号注册” 、“注册器注册” 等恶意行为,提供基于天御 DNA 算法的恶意防护引擎,从账号、设备、行为三个维度有效识别 “恶意注册”,从“源头”上防范业务风险。
可能返回的错误码:
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 QueryRegisterProtectionRequest ¶
type QueryRegisterProtectionRequest struct { *tchttp.BaseRequest // 注册来源的外网 IP。 RegisterIp *string `json:"RegisterIp,omitnil,omitempty" name:"RegisterIp"` // 用户 ID 不同的 accountType 对应不同的用户 ID。如果是 QQ,则填入对应的 openid,微信用户则填入对应的 openid/unionid,手机号则填入对应真实用户手机号(如13123456789)。 Uid *string `json:"Uid,omitnil,omitempty" name:"Uid"` // 注册时间戳,单位:秒。 RegisterTime *string `json:"RegisterTime,omitnil,omitempty" name:"RegisterTime"` // 用户账号类型(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"` // 地址。 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:微信公众号。 RegisterSource *string `json:"RegisterSource,omitnil,omitempty" name:"RegisterSource"` // 用户 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"` // 登录耗时,单位:秒。 RegisterSpend *string `json:"RegisterSpend,omitnil,omitempty" name:"RegisterSpend"` // 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 NewQueryRegisterProtectionRequest ¶
func NewQueryRegisterProtectionRequest() (request *QueryRegisterProtectionRequest)
func (*QueryRegisterProtectionRequest) FromJsonString ¶
func (r *QueryRegisterProtectionRequest) 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 (*QueryRegisterProtectionRequest) ToJsonString ¶
func (r *QueryRegisterProtectionRequest) ToJsonString() string
type QueryRegisterProtectionRequestParams ¶ added in v1.0.426
type QueryRegisterProtectionRequestParams struct { // 注册来源的外网 IP。 RegisterIp *string `json:"RegisterIp,omitnil,omitempty" name:"RegisterIp"` // 用户 ID 不同的 accountType 对应不同的用户 ID。如果是 QQ,则填入对应的 openid,微信用户则填入对应的 openid/unionid,手机号则填入对应真实用户手机号(如13123456789)。 Uid *string `json:"Uid,omitnil,omitempty" name:"Uid"` // 注册时间戳,单位:秒。 RegisterTime *string `json:"RegisterTime,omitnil,omitempty" name:"RegisterTime"` // 用户账号类型(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"` // 地址。 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:微信公众号。 RegisterSource *string `json:"RegisterSource,omitnil,omitempty" name:"RegisterSource"` // 用户 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"` // 登录耗时,单位:秒。 RegisterSpend *string `json:"RegisterSpend,omitnil,omitempty" name:"RegisterSpend"` // 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 QueryRegisterProtectionResponse ¶
type QueryRegisterProtectionResponse struct { *tchttp.BaseResponse Response *QueryRegisterProtectionResponseParams `json:"Response"` }
func NewQueryRegisterProtectionResponse ¶
func NewQueryRegisterProtectionResponse() (response *QueryRegisterProtectionResponse)
func (*QueryRegisterProtectionResponse) FromJsonString ¶
func (r *QueryRegisterProtectionResponse) 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 (*QueryRegisterProtectionResponse) ToJsonString ¶
func (r *QueryRegisterProtectionResponse) ToJsonString() string
type QueryRegisterProtectionResponseParams ¶ added in v1.0.426
type QueryRegisterProtectionResponseParams struct { // 业务侧错误码,成功时返回 Success,错误时返回具体业务错误原因。 // 注意:此字段可能返回 null,表示取不到有效值。 CodeDesc *string `json:"CodeDesc,omitnil,omitempty" name:"CodeDesc"` // accountType 是 QQ 或微信开放账号时,用于标识 QQ 或微信用户登录后关联业务自身的账号 ID。 // 注意:此字段可能返回 null,表示取不到有效值。 AssociateAccount *string `json:"AssociateAccount,omitnil,omitempty" name:"AssociateAccount"` // 注册时间戳,单位:秒。 // 注意:此字段可能返回 null,表示取不到有效值。 RegisterTime *string `json:"RegisterTime,omitnil,omitempty" name:"RegisterTime"` // 用户 ID 不同的 accountType 对应不同的用户 ID。如果是 QQ,则填入对应的 openid,微信用户则填入对应的 openid/unionid,手机号则填入对应真实用户手机号(如13123456789)。 // 注意:此字段可能返回 null,表示取不到有效值。 Uid *string `json:"Uid,omitnil,omitempty" name:"Uid"` // 注册来源的外网 IP。 // 注意:此字段可能返回 null,表示取不到有效值。 RegisterIp *string `json:"RegisterIp,omitnil,omitempty" name:"RegisterIp"` // 0:表示无恶意。 // 1 - 4:恶意等级由低到高。 Level *int64 `json:"Level,omitnil,omitempty" name:"Level"` // 风险类型。 RiskType []*int64 `json:"RiskType,omitnil,omitempty" name:"RiskType"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` }
Predefined struct for user