From c0c9453b971aef2c9f9e75dea5d1d057819942aa Mon Sep 17 00:00:00 2001 From: Sita Lakshmi Sangameswaran Date: Thu, 25 Nov 2021 01:10:30 +0530 Subject: [PATCH] docs(samples): updated comments in create assessment (#641) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- .../src/main/java/recaptcha/CreateAssessment.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/snippets/cloud-client/src/main/java/recaptcha/CreateAssessment.java b/samples/snippets/cloud-client/src/main/java/recaptcha/CreateAssessment.java index a62bea55..8fed3a1c 100644 --- a/samples/snippets/cloud-client/src/main/java/recaptcha/CreateAssessment.java +++ b/samples/snippets/cloud-client/src/main/java/recaptcha/CreateAssessment.java @@ -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. */ @@ -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: "