Skip to content

Commit 7c1583c

Browse files
feat: Add support for Password Check through the private_password_leak_verification field in the reCAPTCHA Assessment (googleapis#376)
* feat: Add support for Password Check through the private_password_leak_verification field in the reCAPTCHA Assessment PiperOrigin-RevId: 449202953 Source-Link: googleapis/googleapis@e2ed48f Source-Link: https://github.com/googleapis/googleapis-gen/commit/82f55ea1435da6d69c8ceb0a33f863d1fd6a484e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODJmNTVlYTE0MzVkYTZkNjljOGNlYjBhMzNmODYzZDFmZDZhNDg0ZSJ9 * 🦉 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 4042ae2 commit 7c1583c

11 files changed

+662
-154
lines changed

protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto

+86-51
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ option ruby_package = "Google::Cloud::RecaptchaEnterprise::V1";
3636
// Service to determine the likelihood an event is legitimate.
3737
service RecaptchaEnterpriseService {
3838
option (google.api.default_host) = "recaptchaenterprise.googleapis.com";
39-
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
39+
option (google.api.oauth_scopes) =
40+
"https://www.googleapis.com/auth/cloud-platform";
4041

4142
// Creates an Assessment of the likelihood an event is legitimate.
4243
rpc CreateAssessment(CreateAssessmentRequest) returns (Assessment) {
@@ -49,7 +50,8 @@ service RecaptchaEnterpriseService {
4950

5051
// Annotates a previously created Assessment to provide additional information
5152
// on whether the event turned out to be authentic or fraudulent.
52-
rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) {
53+
rpc AnnotateAssessment(AnnotateAssessmentRequest)
54+
returns (AnnotateAssessmentResponse) {
5355
option (google.api.http) = {
5456
post: "/v1/{name=projects/*/assessments/*}:annotate"
5557
body: "*"
@@ -117,23 +119,28 @@ service RecaptchaEnterpriseService {
117119
}
118120

119121
// List groups of related accounts.
120-
rpc ListRelatedAccountGroups(ListRelatedAccountGroupsRequest) returns (ListRelatedAccountGroupsResponse) {
122+
rpc ListRelatedAccountGroups(ListRelatedAccountGroupsRequest)
123+
returns (ListRelatedAccountGroupsResponse) {
121124
option (google.api.http) = {
122125
get: "/v1/{parent=projects/*}/relatedaccountgroups"
123126
};
124127
option (google.api.method_signature) = "parent";
125128
}
126129

127130
// Get the memberships in a group of related accounts.
128-
rpc ListRelatedAccountGroupMemberships(ListRelatedAccountGroupMembershipsRequest) returns (ListRelatedAccountGroupMembershipsResponse) {
131+
rpc ListRelatedAccountGroupMemberships(
132+
ListRelatedAccountGroupMembershipsRequest)
133+
returns (ListRelatedAccountGroupMembershipsResponse) {
129134
option (google.api.http) = {
130135
get: "/v1/{parent=projects/*/relatedaccountgroups/*}/memberships"
131136
};
132137
option (google.api.method_signature) = "parent";
133138
}
134139

135140
// Search group memberships related to a given account.
136-
rpc SearchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest) returns (SearchRelatedAccountGroupMembershipsResponse) {
141+
rpc SearchRelatedAccountGroupMemberships(
142+
SearchRelatedAccountGroupMembershipsRequest)
143+
returns (SearchRelatedAccountGroupMembershipsResponse) {
137144
option (google.api.http) = {
138145
post: "/v1/{project=projects/*}/relatedaccountgroupmemberships:search"
139146
body: "*"
@@ -234,26 +241,25 @@ message AnnotateAssessmentRequest {
234241
}
235242
];
236243

237-
// Optional. The annotation that will be assigned to the Event. This field can be left
238-
// empty to provide reasons that apply to an event without concluding whether
239-
// the event is legitimate or fraudulent.
244+
// Optional. The annotation that will be assigned to the Event. This field can
245+
// be left empty to provide reasons that apply to an event without concluding
246+
// whether the event is legitimate or fraudulent.
240247
Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL];
241248

242-
// Optional. Optional reasons for the annotation that will be assigned to the Event.
249+
// Optional. Optional reasons for the annotation that will be assigned to the
250+
// Event.
243251
repeated Reason reasons = 3 [(google.api.field_behavior) = OPTIONAL];
244252

245-
// Optional. Optional unique stable hashed user identifier to apply to the assessment.
246-
// This is an alternative to setting the hashed_account_id in
253+
// Optional. Optional unique stable hashed user identifier to apply to the
254+
// assessment. This is an alternative to setting the hashed_account_id in
247255
// CreateAssessment, for example when the account identifier is not yet known
248256
// in the initial request. It is recommended that the identifier is hashed
249257
// using hmac-sha256 with stable secret.
250258
bytes hashed_account_id = 4 [(google.api.field_behavior) = OPTIONAL];
251259
}
252260

253261
// Empty response for AnnotateAssessment.
254-
message AnnotateAssessmentResponse {
255-
256-
}
262+
message AnnotateAssessmentResponse {}
257263

258264
// A recaptcha assessment resource.
259265
message Assessment {
@@ -273,36 +279,41 @@ message Assessment {
273279
RiskAnalysis risk_analysis = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
274280

275281
// Output only. Properties of the provided event token.
276-
TokenProperties token_properties = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
282+
TokenProperties token_properties = 4
283+
[(google.api.field_behavior) = OUTPUT_ONLY];
277284

278285
// Assessment returned by Account Defender when a hashed_account_id is
279286
// provided.
280287
AccountDefenderAssessment account_defender_assessment = 6;
288+
289+
// Password leak verification info.
290+
PrivatePasswordLeakVerification private_password_leak_verification = 7;
281291
}
282292

283293
message Event {
284-
// Optional. The user response token provided by the reCAPTCHA client-side integration
285-
// on your site.
294+
// Optional. The user response token provided by the reCAPTCHA client-side
295+
// integration on your site.
286296
string token = 1 [(google.api.field_behavior) = OPTIONAL];
287297

288-
// Optional. The site key that was used to invoke reCAPTCHA on your site and generate
289-
// the token.
298+
// Optional. The site key that was used to invoke reCAPTCHA on your site and
299+
// generate the token.
290300
string site_key = 2 [(google.api.field_behavior) = OPTIONAL];
291301

292-
// Optional. The user agent present in the request from the user's device related to
293-
// this event.
302+
// Optional. The user agent present in the request from the user's device
303+
// related to this event.
294304
string user_agent = 3 [(google.api.field_behavior) = OPTIONAL];
295305

296-
// Optional. The IP address in the request from the user's device related to this event.
306+
// Optional. The IP address in the request from the user's device related to
307+
// this event.
297308
string user_ip_address = 4 [(google.api.field_behavior) = OPTIONAL];
298309

299-
// Optional. The expected action for this type of event. This should be the same action
300-
// provided at token generation time on client-side platforms already
301-
// integrated with recaptcha enterprise.
310+
// Optional. The expected action for this type of event. This should be the
311+
// same action provided at token generation time on client-side platforms
312+
// already integrated with recaptcha enterprise.
302313
string expected_action = 5 [(google.api.field_behavior) = OPTIONAL];
303314

304-
// Optional. Optional unique stable hashed user identifier for the request. The
305-
// identifier should ideally be hashed using sha256 with stable secret.
315+
// Optional. Optional unique stable hashed user identifier for the request.
316+
// The identifier should ideally be hashed using sha256 with stable secret.
306317
bytes hashed_account_id = 6 [(google.api.field_behavior) = OPTIONAL];
307318
}
308319

@@ -414,6 +425,31 @@ message AccountDefenderAssessment {
414425
repeated AccountDefenderLabel labels = 1;
415426
}
416427

428+
// Private password leak verification info.
429+
message PrivatePasswordLeakVerification {
430+
// Exactly 26-bit prefix of the SHA-256 hash of the canonicalized username. It
431+
// is used to look up password leaks associated with that hash prefix.
432+
bytes lookup_hash_prefix = 1 [(google.api.field_behavior) = OPTIONAL];
433+
434+
// Encrypted Scrypt hash of the canonicalized username+password. It is
435+
// re-encrypted by the server and returned through
436+
// `reencrypted_user_credentials_hash`.
437+
bytes encrypted_user_credentials_hash = 2
438+
[(google.api.field_behavior) = OPTIONAL];
439+
440+
// List of prefixes of the encrypted potential password leaks that matched the
441+
// given parameters. They should be compared with the client-side decryption
442+
// prefix of `reencrypted_user_credentials_hash`
443+
repeated bytes encrypted_leak_match_prefixes = 3
444+
[(google.api.field_behavior) = OUTPUT_ONLY];
445+
446+
// Corresponds to the re-encryption of the `encrypted_user_credentials_hash`
447+
// field. Used to match potential password leaks within
448+
// `encrypted_leak_match_prefixes`.
449+
bytes reencrypted_user_credentials_hash = 4
450+
[(google.api.field_behavior) = OUTPUT_ONLY];
451+
}
452+
417453
// The create key request message.
418454
message CreateKeyRequest {
419455
// Required. The name of the project in which the key will be created, in the
@@ -476,9 +512,10 @@ message UpdateKeyRequest {
476512
// Required. The key to update.
477513
Key key = 1 [(google.api.field_behavior) = REQUIRED];
478514

479-
// Optional. The mask to control which fields of the key get updated. If the mask is not
480-
// present, all fields will be updated.
481-
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
515+
// Optional. The mask to control which fields of the key get updated. If the
516+
// mask is not present, all fields will be updated.
517+
google.protobuf.FieldMask update_mask = 2
518+
[(google.api.field_behavior) = OPTIONAL];
482519
}
483520

484521
// The delete key request message.
@@ -740,14 +777,14 @@ message ListRelatedAccountGroupMembershipsRequest {
740777
}
741778
];
742779

743-
// Optional. The maximum number of accounts to return. The service may return fewer than
744-
// this value.
745-
// If unspecified, at most 50 accounts will be returned.
746-
// The maximum value is 1000; values above 1000 will be coerced to 1000.
780+
// Optional. The maximum number of accounts to return. The service may return
781+
// fewer than this value. If unspecified, at most 50 accounts will be
782+
// returned. The maximum value is 1000; values above 1000 will be coerced to
783+
// 1000.
747784
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
748785

749-
// Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships`
750-
// call.
786+
// Optional. A page token, received from a previous
787+
// `ListRelatedAccountGroupMemberships` call.
751788
//
752789
// When paginating, all other parameters provided to
753790
// `ListRelatedAccountGroupMemberships` must match the call that provided the
@@ -767,23 +804,22 @@ message ListRelatedAccountGroupMembershipsResponse {
767804

768805
// The request message to list related account groups.
769806
message ListRelatedAccountGroupsRequest {
770-
// Required. The name of the project to list related account groups from, in the format
771-
// "projects/{project}".
807+
// Required. The name of the project to list related account groups from, in
808+
// the format "projects/{project}".
772809
string parent = 1 [
773810
(google.api.field_behavior) = REQUIRED,
774811
(google.api.resource_reference) = {
775812
child_type: "recaptchaenterprise.googleapis.com/RelatedAccountGroup"
776813
}
777814
];
778815

779-
// Optional. The maximum number of groups to return. The service may return fewer than
780-
// this value.
781-
// If unspecified, at most 50 groups will be returned.
816+
// Optional. The maximum number of groups to return. The service may return
817+
// fewer than this value. If unspecified, at most 50 groups will be returned.
782818
// The maximum value is 1000; values above 1000 will be coerced to 1000.
783819
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
784820

785-
// Optional. A page token, received from a previous `ListRelatedAccountGroups` call.
786-
// Provide this to retrieve the subsequent page.
821+
// Optional. A page token, received from a previous `ListRelatedAccountGroups`
822+
// call. Provide this to retrieve the subsequent page.
787823
//
788824
// When paginating, all other parameters provided to
789825
// `ListRelatedAccountGroups` must match the call that provided the page
@@ -803,23 +839,22 @@ message ListRelatedAccountGroupsResponse {
803839

804840
// The request message to search related account group memberships.
805841
message SearchRelatedAccountGroupMembershipsRequest {
806-
// Required. The name of the project to search related account group memberships from,
807-
// in the format "projects/{project}".
842+
// Required. The name of the project to search related account group
843+
// memberships from, in the format "projects/{project}".
808844
string project = 1 [
809845
(google.api.field_behavior) = REQUIRED,
810846
(google.api.resource_reference) = {
811847
child_type: "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership"
812848
}
813849
];
814850

815-
// Optional. The unique stable hashed user identifier we should search connections to.
816-
// The identifier should correspond to a `hashed_account_id` provided in a
817-
// previous CreateAssessment or AnnotateAssessment call.
851+
// Optional. The unique stable hashed user identifier we should search
852+
// connections to. The identifier should correspond to a `hashed_account_id`
853+
// provided in a previous CreateAssessment or AnnotateAssessment call.
818854
bytes hashed_account_id = 2 [(google.api.field_behavior) = OPTIONAL];
819855

820-
// Optional. The maximum number of groups to return. The service may return fewer than
821-
// this value.
822-
// If unspecified, at most 50 groups will be returned.
856+
// Optional. The maximum number of groups to return. The service may return
857+
// fewer than this value. If unspecified, at most 50 groups will be returned.
823858
// The maximum value is 1000; values above 1000 will be coerced to 1000.
824859
int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
825860

0 commit comments

Comments
 (0)