Skip to content

Commit

Permalink
feat: added AnnotateAssessmentRequest.account_id
Browse files Browse the repository at this point in the history
feat: added Event.user_info
docs: updated comments

PiperOrigin-RevId: 584376490
  • Loading branch information
Google APIs authored and Copybara-Service committed Nov 21, 2023
1 parent ad35fda commit 3413c93
Showing 1 changed file with 58 additions and 12 deletions.
70 changes: 58 additions & 12 deletions google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto
Original file line number Diff line number Diff line change
Expand Up @@ -451,15 +451,18 @@ message AnnotateAssessmentRequest {
// whether the event is legitimate or fraudulent.
Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL];

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

// Optional. Unique stable hashed user identifier to apply to the assessment.
// This is an alternative to setting the hashed_account_id in
// CreateAssessment, for example when the account identifier is not yet known
// in the initial request. It is recommended that the identifier is hashed
// using hmac-sha256 with stable secret.
// Optional. A stable account identifier to apply to the assessment. This is
// an alternative to setting `account_id` in `CreateAssessment`, for example
// when a stable account identifier is not yet known in the initial request.
string account_id = 7 [(google.api.field_behavior) = OPTIONAL];

// Optional. A stable hashed account identifier to apply to the assessment.
// This is an alternative to setting `hashed_account_id` in
// `CreateAssessment`, for example when a stable account identifier is not yet
// known in the initial request.
bytes hashed_account_id = 4 [(google.api.field_behavior) = OPTIONAL];

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

// Output only. Assessment returned by account defender when a
// hashed_account_id is provided.
// Output only. Assessment returned by account defender when an account
// identifier is provided.
AccountDefenderAssessment account_defender_assessment = 6
[(google.api.field_behavior) = OUTPUT_ONLY];

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

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

// Optional. Flag for a reCAPTCHA express request for an assessment without a
// token. If enabled, `site_key` must reference a SCORE key with WAF feature
Expand Down Expand Up @@ -688,6 +693,12 @@ message Event {
// FraudPreventionAssessment component in the response.
TransactionData transaction_data = 13
[(google.api.field_behavior) = OPTIONAL];

// Optional. Information about the user that generates this event, when they
// can be identified. They are often identified through the use of an account
// for logged-in requests or login/registration requests, or by providing user
// identifiers for guest actions like checkout.
UserInfo user_info = 15 [(google.api.field_behavior) = OPTIONAL];
}

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

// User information associated with a request protected by reCAPTCHA Enterprise.
message UserInfo {
// Optional. Creation time for this account associated with this user. Leave
// blank for non logged-in actions, guest checkout, or when there is no
// account associated with the current user.
google.protobuf.Timestamp create_account_time = 1
[(google.api.field_behavior) = OPTIONAL];

// Optional. For logged-in requests or login/registration requests, the unique
// account identifier associated with this user. You can use the username if
// it is stable (meaning it is the same for every request associated with the
// same user), or any stable user ID of your choice. Leave blank for non
// logged-in actions or guest checkout.
string account_id = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. Identifiers associated with this user or request.
repeated UserId user_ids = 3 [(google.api.field_behavior) = OPTIONAL];
}

// An identifier associated with a user.
message UserId {
oneof id_oneof {
// Optional. An email address.
string email = 1 [(google.api.field_behavior) = OPTIONAL];

// Optional. A phone number. Should use the E.164 format.
string phone_number = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. A unique username, if different from all the other identifiers
// and `account_id` that are provided. Can be a unique login handle or
// display name for a user.
string username = 3 [(google.api.field_behavior) = OPTIONAL];
}
}

// Risk analysis result for an event.
message RiskAnalysis {
// Reasons contributing to the risk analysis verdict.
Expand Down

0 comments on commit 3413c93

Please sign in to comment.