Skip to content

Commit 0ac4e5e

Browse files
chore(deps): update dependency google-cloud-recaptcha-enterprise to v1.22.1 (GoogleCloudPlatform#12651)
* chore(deps): update dependency google-cloud-recaptcha-enterprise to v1.22.1 * 🦉 Updates from OwlBot post-processor 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>
1 parent 137b5e8 commit 0ac4e5e

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Flask==3.0.3
22
gunicorn==22.0.0
3-
google-cloud-recaptcha-enterprise==1.18.1
3+
google-cloud-recaptcha-enterprise==1.22.1
44
Werkzeug==3.0.3

recaptcha_enterprise/snippets/create_assessment.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222

2323

2424
def create_assessment(
25-
project_id: str, recaptcha_site_key: str, token: str, recaptcha_action: str, user_ip_address: str, user_agent: str, ja3: str
25+
project_id: str,
26+
recaptcha_site_key: str,
27+
token: str,
28+
recaptcha_action: str,
29+
user_ip_address: str,
30+
user_agent: str,
31+
ja3: str,
2632
) -> Assessment:
2733
"""Create an assessment to analyze the risk of a UI action.
2834
Args:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-recaptcha-enterprise==1.22.0
1+
google-cloud-recaptcha-enterprise==1.22.1

recaptcha_enterprise/snippets/test_create_assessment.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,14 @@ def test_assessment(
9393
# Get token.
9494
token, action = get_token(recaptcha_site_key, browser)
9595
# Create assessment.
96-
assessment_response = assess_token(recaptcha_site_key, token=token, action=action, user_ip_address="", user_agent="", ja3="")
96+
assessment_response = assess_token(
97+
recaptcha_site_key,
98+
token=token,
99+
action=action,
100+
user_ip_address="",
101+
user_agent="",
102+
ja3="",
103+
)
97104
score = str(assessment_response.risk_analysis.score)
98105
client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient()
99106
# Parse the assessment_response.name which is of the format:
@@ -152,15 +159,22 @@ def get_token(recaptcha_site_key: str, browser: WebDriver) -> tuple:
152159
return token, action
153160

154161

155-
def assess_token(recaptcha_site_key: str, token: str, action: str, user_ip_address: str, user_agent: str, ja3: str) -> Assessment:
162+
def assess_token(
163+
recaptcha_site_key: str,
164+
token: str,
165+
action: str,
166+
user_ip_address: str,
167+
user_agent: str,
168+
ja3: str,
169+
) -> Assessment:
156170
return create_assessment(
157171
project_id=GOOGLE_CLOUD_PROJECT,
158172
recaptcha_site_key=recaptcha_site_key,
159173
token=token,
160174
recaptcha_action=action,
161175
user_ip_address=user_ip_address,
162176
user_agent=user_agent,
163-
ja3=ja3
177+
ja3=ja3,
164178
)
165179

166180

0 commit comments

Comments
 (0)