Skip to content

Commit 3413c93

Browse files
Google APIscopybara-github
authored andcommitted
feat: added AnnotateAssessmentRequest.account_id
feat: added Event.user_info docs: updated comments PiperOrigin-RevId: 584376490
1 parent ad35fda commit 3413c93

1 file changed

Lines changed: 58 additions & 12 deletions

File tree

google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -451,15 +451,18 @@ message AnnotateAssessmentRequest {
451451
// whether the event is legitimate or fraudulent.
452452
Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL];
453453

454-
// Optional. Optional reasons for the annotation that will be assigned to the
455-
// Event.
454+
// Optional. Reasons for the annotation that are assigned to the event.
456455
repeated Reason reasons = 3 [(google.api.field_behavior) = OPTIONAL];
457456

458-
// Optional. Unique stable hashed user identifier to apply to the assessment.
459-
// This is an alternative to setting the hashed_account_id in
460-
// CreateAssessment, for example when the account identifier is not yet known
461-
// in the initial request. It is recommended that the identifier is hashed
462-
// using hmac-sha256 with stable secret.
457+
// Optional. A stable account identifier to apply to the assessment. This is
458+
// an alternative to setting `account_id` in `CreateAssessment`, for example
459+
// when a stable account identifier is not yet known in the initial request.
460+
string account_id = 7 [(google.api.field_behavior) = OPTIONAL];
461+
462+
// Optional. A stable hashed account identifier to apply to the assessment.
463+
// This is an alternative to setting `hashed_account_id` in
464+
// `CreateAssessment`, for example when a stable account identifier is not yet
465+
// known in the initial request.
463466
bytes hashed_account_id = 4 [(google.api.field_behavior) = OPTIONAL];
464467

465468
// Optional. If the assessment is part of a payment transaction, provide
@@ -606,8 +609,8 @@ message Assessment {
606609
AccountVerificationInfo account_verification = 5
607610
[(google.api.field_behavior) = OPTIONAL];
608611

609-
// Output only. Assessment returned by account defender when a
610-
// hashed_account_id is provided.
612+
// Output only. Assessment returned by account defender when an account
613+
// identifier is provided.
611614
AccountDefenderAssessment account_defender_assessment = 6
612615
[(google.api.field_behavior) = OUTPUT_ONLY];
613616

@@ -655,9 +658,11 @@ message Event {
655658
// already integrated with recaptcha enterprise.
656659
string expected_action = 5 [(google.api.field_behavior) = OPTIONAL];
657660

658-
// Optional. Unique stable hashed user identifier for the request. The
659-
// identifier must be hashed using hmac-sha256 with stable secret.
660-
bytes hashed_account_id = 6 [(google.api.field_behavior) = OPTIONAL];
661+
// Optional. Deprecated: use `user_info.account_id` instead.
662+
// Unique stable hashed user identifier for the request. The identifier must
663+
// be hashed using hmac-sha256 with stable secret.
664+
bytes hashed_account_id = 6
665+
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
661666

662667
// Optional. Flag for a reCAPTCHA express request for an assessment without a
663668
// token. If enabled, `site_key` must reference a SCORE key with WAF feature
@@ -688,6 +693,12 @@ message Event {
688693
// FraudPreventionAssessment component in the response.
689694
TransactionData transaction_data = 13
690695
[(google.api.field_behavior) = OPTIONAL];
696+
697+
// Optional. Information about the user that generates this event, when they
698+
// can be identified. They are often identified through the use of an account
699+
// for logged-in requests or login/registration requests, or by providing user
700+
// identifiers for guest actions like checkout.
701+
UserInfo user_info = 15 [(google.api.field_behavior) = OPTIONAL];
691702
}
692703

693704
// Transaction data associated with a payment protected by reCAPTCHA Enterprise.
@@ -832,6 +843,41 @@ message TransactionData {
832843
GatewayInfo gateway_info = 10 [(google.api.field_behavior) = OPTIONAL];
833844
}
834845

846+
// User information associated with a request protected by reCAPTCHA Enterprise.
847+
message UserInfo {
848+
// Optional. Creation time for this account associated with this user. Leave
849+
// blank for non logged-in actions, guest checkout, or when there is no
850+
// account associated with the current user.
851+
google.protobuf.Timestamp create_account_time = 1
852+
[(google.api.field_behavior) = OPTIONAL];
853+
854+
// Optional. For logged-in requests or login/registration requests, the unique
855+
// account identifier associated with this user. You can use the username if
856+
// it is stable (meaning it is the same for every request associated with the
857+
// same user), or any stable user ID of your choice. Leave blank for non
858+
// logged-in actions or guest checkout.
859+
string account_id = 2 [(google.api.field_behavior) = OPTIONAL];
860+
861+
// Optional. Identifiers associated with this user or request.
862+
repeated UserId user_ids = 3 [(google.api.field_behavior) = OPTIONAL];
863+
}
864+
865+
// An identifier associated with a user.
866+
message UserId {
867+
oneof id_oneof {
868+
// Optional. An email address.
869+
string email = 1 [(google.api.field_behavior) = OPTIONAL];
870+
871+
// Optional. A phone number. Should use the E.164 format.
872+
string phone_number = 2 [(google.api.field_behavior) = OPTIONAL];
873+
874+
// Optional. A unique username, if different from all the other identifiers
875+
// and `account_id` that are provided. Can be a unique login handle or
876+
// display name for a user.
877+
string username = 3 [(google.api.field_behavior) = OPTIONAL];
878+
}
879+
}
880+
835881
// Risk analysis result for an event.
836882
message RiskAnalysis {
837883
// Reasons contributing to the risk analysis verdict.

0 commit comments

Comments
 (0)