|
35 | 35 | "Assessment", |
36 | 36 | "Event", |
37 | 37 | "TransactionData", |
| 38 | + "UserInfo", |
| 39 | + "UserId", |
38 | 40 | "RiskAnalysis", |
39 | 41 | "TokenProperties", |
40 | 42 | "FraudPreventionAssessment", |
@@ -277,15 +279,19 @@ class AnnotateAssessmentRequest(proto.Message): |
277 | 279 | without concluding whether the event is |
278 | 280 | legitimate or fraudulent. |
279 | 281 | reasons (MutableSequence[google.cloud.recaptchaenterprise_v1.types.AnnotateAssessmentRequest.Reason]): |
280 | | - Optional. Optional reasons for the annotation |
281 | | - that will be assigned to the Event. |
| 282 | + Optional. Reasons for the annotation that are |
| 283 | + assigned to the event. |
| 284 | + account_id (str): |
| 285 | + Optional. A stable account identifier to apply to the |
| 286 | + assessment. This is an alternative to setting ``account_id`` |
| 287 | + in ``CreateAssessment``, for example when a stable account |
| 288 | + identifier is not yet known in the initial request. |
282 | 289 | hashed_account_id (bytes): |
283 | | - Optional. Unique stable hashed user identifier to apply to |
284 | | - the assessment. This is an alternative to setting the |
285 | | - hashed_account_id in CreateAssessment, for example when the |
286 | | - account identifier is not yet known in the initial request. |
287 | | - It is recommended that the identifier is hashed using |
288 | | - hmac-sha256 with stable secret. |
| 290 | + Optional. A stable hashed account identifier to apply to the |
| 291 | + assessment. This is an alternative to setting |
| 292 | + ``hashed_account_id`` in ``CreateAssessment``, for example |
| 293 | + when a stable account identifier is not yet known in the |
| 294 | + initial request. |
289 | 295 | transaction_event (google.cloud.recaptchaenterprise_v1.types.TransactionEvent): |
290 | 296 | Optional. If the assessment is part of a |
291 | 297 | payment transaction, provide details on payment |
@@ -420,6 +426,10 @@ class Reason(proto.Enum): |
420 | 426 | number=3, |
421 | 427 | enum=Reason, |
422 | 428 | ) |
| 429 | + account_id: str = proto.Field( |
| 430 | + proto.STRING, |
| 431 | + number=7, |
| 432 | + ) |
423 | 433 | hashed_account_id: bytes = proto.Field( |
424 | 434 | proto.BYTES, |
425 | 435 | number=4, |
@@ -644,8 +654,8 @@ class Assessment(proto.Message): |
644 | 654 | must include a token and site key to use this |
645 | 655 | feature. |
646 | 656 | account_defender_assessment (google.cloud.recaptchaenterprise_v1.types.AccountDefenderAssessment): |
647 | | - Output only. Assessment returned by account defender when a |
648 | | - hashed_account_id is provided. |
| 657 | + Output only. Assessment returned by account |
| 658 | + defender when an account identifier is provided. |
649 | 659 | private_password_leak_verification (google.cloud.recaptchaenterprise_v1.types.PrivatePasswordLeakVerification): |
650 | 660 | Optional. The private password leak |
651 | 661 | verification field contains the parameters that |
@@ -740,9 +750,10 @@ class Event(proto.Message): |
740 | 750 | platforms already integrated with recaptcha |
741 | 751 | enterprise. |
742 | 752 | hashed_account_id (bytes): |
743 | | - Optional. Unique stable hashed user |
744 | | - identifier for the request. The identifier must |
745 | | - be hashed using hmac-sha256 with stable secret. |
| 753 | + Optional. Deprecated: use ``user_info.account_id`` instead. |
| 754 | + Unique stable hashed user identifier for the request. The |
| 755 | + identifier must be hashed using hmac-sha256 with stable |
| 756 | + secret. |
746 | 757 | express (bool): |
747 | 758 | Optional. Flag for a reCAPTCHA express request for an |
748 | 759 | assessment without a token. If enabled, ``site_key`` must |
@@ -772,6 +783,14 @@ class Event(proto.Message): |
772 | 783 | enables reCAPTCHA Enterprise Fraud Prevention |
773 | 784 | and the FraudPreventionAssessment component in |
774 | 785 | the response. |
| 786 | + user_info (google.cloud.recaptchaenterprise_v1.types.UserInfo): |
| 787 | + Optional. Information about the user that |
| 788 | + generates this event, when they can be |
| 789 | + identified. They are often identified through |
| 790 | + the use of an account for logged-in requests or |
| 791 | + login/registration requests, or by providing |
| 792 | + user identifiers for guest actions like |
| 793 | + checkout. |
775 | 794 | """ |
776 | 795 |
|
777 | 796 | token: str = proto.Field( |
@@ -827,6 +846,11 @@ class Event(proto.Message): |
827 | 846 | number=13, |
828 | 847 | message="TransactionData", |
829 | 848 | ) |
| 849 | + user_info: "UserInfo" = proto.Field( |
| 850 | + proto.MESSAGE, |
| 851 | + number=15, |
| 852 | + message="UserInfo", |
| 853 | + ) |
830 | 854 |
|
831 | 855 |
|
832 | 856 | class TransactionData(proto.Message): |
@@ -1126,6 +1150,91 @@ class GatewayInfo(proto.Message): |
1126 | 1150 | ) |
1127 | 1151 |
|
1128 | 1152 |
|
| 1153 | +class UserInfo(proto.Message): |
| 1154 | + r"""User information associated with a request protected by |
| 1155 | + reCAPTCHA Enterprise. |
| 1156 | +
|
| 1157 | + Attributes: |
| 1158 | + create_account_time (google.protobuf.timestamp_pb2.Timestamp): |
| 1159 | + Optional. Creation time for this account |
| 1160 | + associated with this user. Leave blank for non |
| 1161 | + logged-in actions, guest checkout, or when there |
| 1162 | + is no account associated with the current user. |
| 1163 | + account_id (str): |
| 1164 | + Optional. For logged-in requests or |
| 1165 | + login/registration requests, the unique account |
| 1166 | + identifier associated with this user. You can |
| 1167 | + use the username if it is stable (meaning it is |
| 1168 | + the same for every request associated with the |
| 1169 | + same user), or any stable user ID of your |
| 1170 | + choice. Leave blank for non logged-in actions or |
| 1171 | + guest checkout. |
| 1172 | + user_ids (MutableSequence[google.cloud.recaptchaenterprise_v1.types.UserId]): |
| 1173 | + Optional. Identifiers associated with this |
| 1174 | + user or request. |
| 1175 | + """ |
| 1176 | + |
| 1177 | + create_account_time: timestamp_pb2.Timestamp = proto.Field( |
| 1178 | + proto.MESSAGE, |
| 1179 | + number=1, |
| 1180 | + message=timestamp_pb2.Timestamp, |
| 1181 | + ) |
| 1182 | + account_id: str = proto.Field( |
| 1183 | + proto.STRING, |
| 1184 | + number=2, |
| 1185 | + ) |
| 1186 | + user_ids: MutableSequence["UserId"] = proto.RepeatedField( |
| 1187 | + proto.MESSAGE, |
| 1188 | + number=3, |
| 1189 | + message="UserId", |
| 1190 | + ) |
| 1191 | + |
| 1192 | + |
| 1193 | +class UserId(proto.Message): |
| 1194 | + r"""An identifier associated with a user. |
| 1195 | +
|
| 1196 | + This message has `oneof`_ fields (mutually exclusive fields). |
| 1197 | + For each oneof, at most one member field can be set at the same time. |
| 1198 | + Setting any member of the oneof automatically clears all other |
| 1199 | + members. |
| 1200 | +
|
| 1201 | + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields |
| 1202 | +
|
| 1203 | + Attributes: |
| 1204 | + email (str): |
| 1205 | + Optional. An email address. |
| 1206 | +
|
| 1207 | + This field is a member of `oneof`_ ``id_oneof``. |
| 1208 | + phone_number (str): |
| 1209 | + Optional. A phone number. Should use the |
| 1210 | + E.164 format. |
| 1211 | +
|
| 1212 | + This field is a member of `oneof`_ ``id_oneof``. |
| 1213 | + username (str): |
| 1214 | + Optional. A unique username, if different from all the other |
| 1215 | + identifiers and ``account_id`` that are provided. Can be a |
| 1216 | + unique login handle or display name for a user. |
| 1217 | +
|
| 1218 | + This field is a member of `oneof`_ ``id_oneof``. |
| 1219 | + """ |
| 1220 | + |
| 1221 | + email: str = proto.Field( |
| 1222 | + proto.STRING, |
| 1223 | + number=1, |
| 1224 | + oneof="id_oneof", |
| 1225 | + ) |
| 1226 | + phone_number: str = proto.Field( |
| 1227 | + proto.STRING, |
| 1228 | + number=2, |
| 1229 | + oneof="id_oneof", |
| 1230 | + ) |
| 1231 | + username: str = proto.Field( |
| 1232 | + proto.STRING, |
| 1233 | + number=3, |
| 1234 | + oneof="id_oneof", |
| 1235 | + ) |
| 1236 | + |
| 1237 | + |
1129 | 1238 | class RiskAnalysis(proto.Message): |
1130 | 1239 | r"""Risk analysis result for an event. |
1131 | 1240 |
|
|
0 commit comments