Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typings for Amazon WAF CAPTCHA request/response incorrect #5

Open
alexanderroidl opened this issue Jun 18, 2024 · 2 comments
Open

Typings for Amazon WAF CAPTCHA request/response incorrect #5

alexanderroidl opened this issue Jun 18, 2024 · 2 comments

Comments

@alexanderroidl
Copy link

As seen in the 2Captcha documentation for Amazon WAF CAPTCHAs, challengeScript and captchaScript are missing in the type definition paramsAmazonWAF entirely:

export interface paramsAmazonWAF {
pageurl: string,
sitekey: string,
iv: string
context: string,
header_acao?: boolean,
pingback?: string,
soft_id?: number,
proxy?: string,
proxytype?: string,
}

Also the response typing is incorrect. For Amazon WAF it's actually structured like this:

interface CaptchaAnswerAmazonWAF {
  data: {
    captcha_voucher: string,
    existing_token: string
  },
  id: string
};

But it's implemented like this (data is NOT a string!!!):

interface CaptchaAnswer {
/** The solution to the captcha */
data: string,
/** The ID of the captcha solve */
id: string
}

I suspect many more typings will be incorrect as well.

@dzmitry-duboyski
Copy link
Collaborator

challengeScript and captchaScript are missing in the type definition paramsAmazonWAF entirely

2captcha API has two versions v1 and v2, this repository uses API v1. The correct parameter names for API v1 are described here https://2captcha.com/2captcha-api#amazon-waf-captcha. The link you provided will not be correct, as it describes API v2.

@alexanderroidl Can you create a PR with the addition of challenge_script and captcha_script params for paramsAmazonWAF.

Screenshot - Request body example for send Amazon WAF to API v1:
image

@alexanderroidl
Copy link
Author

Thank you for the hint @dzmitry-duboyski!

I will be happy to create a PR but only if you actually approve it once it meets the project's needs. I do not want to code, have my PR closed and have the code re-done by somebody else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants