Skip to content

Commit

Permalink
docs(samples): updated comments in create assessment (#641)
Browse files Browse the repository at this point in the history
* docs(samples): updated comments

Updated comments to clarify create assessment similarity for both score and checkbox based site keys.

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
Sita04 and gcf-owl-bot[bot] committed Nov 15, 2022
1 parent fd40fe6 commit ed4d1b8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ public static void main(String[] args) throws IOException {
}

/**
* Create an assessment to analyze the risk of an UI action.
* Create an assessment to analyze the risk of an UI action. Assessment approach is the same for
* both 'score' and 'checkbox' type recaptcha site keys.
*
* @param projectID : GCloud Project ID
* @param recaptchaSiteKey : Site key obtained by registering a domain/app to use recaptcha
* services.
* services. (score/ checkbox type)
* @param token : The token obtained from the client on passing the recaptchaSiteKey.
* @param recaptchaAction : Action name corresponding to the token.
*/
Expand Down Expand Up @@ -77,6 +78,7 @@ public static void createAssessment(
}

// Check if the expected action was executed.
// (If the key is checkbox type and 'action' attribute wasn't set, skip this check.)
if (!response.getTokenProperties().getAction().equals(recaptchaAction)) {
System.out.println(
"The action attribute in reCAPTCHA tag is: "
Expand Down

0 comments on commit ed4d1b8

Please sign in to comment.