# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module RecaptchaEnterprise module V1beta1 # The create assessment request message. # @!attribute [rw] parent # @return [::String] # Required. The name of the project in which the assessment will be created, # in the format "projects/\\{project_number}". # @!attribute [rw] assessment # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] # Required. The assessment details. class CreateAssessmentRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The request message to annotate an Assessment. # @!attribute [rw] name # @return [::String] # Required. The resource name of the Assessment, in the format # "projects/\\{project_number}/assessments/\\{assessment_id}". # @!attribute [rw] annotation # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation] # Optional. The annotation that will be assigned to the Event. This field can be left # empty to provide reasons that apply to an event without concluding whether # the event is legitimate or fraudulent. # @!attribute [rw] reasons # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>] # Optional. Optional reasons for the annotation that will be assigned to the Event. # @!attribute [rw] hashed_account_id # @return [::String] # 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. class AnnotateAssessmentRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Enum that represents the types of annotations. module Annotation # Default unspecified type. ANNOTATION_UNSPECIFIED = 0 # Provides information that the event turned out to be legitimate. LEGITIMATE = 1 # Provides information that the event turned out to be fraudulent. FRAUDULENT = 2 # Provides information that the event was related to a login event in which # the user typed the correct password. Deprecated, prefer indicating # CORRECT_PASSWORD through the reasons field instead. PASSWORD_CORRECT = 3 # Provides information that the event was related to a login event in which # the user typed the incorrect password. Deprecated, prefer indicating # INCORRECT_PASSWORD through the reasons field instead. PASSWORD_INCORRECT = 4 end # Enum that represents potential reasons for annotating an assessment. module Reason # Default unspecified reason. REASON_UNSPECIFIED = 0 # Indicates a chargeback issued for the transaction with no other details. # When possible, specify the type by using CHARGEBACK_FRAUD or # CHARGEBACK_DISPUTE instead. CHARGEBACK = 1 # Indicates a chargeback related to an alleged unauthorized transaction # from the cardholder's perspective (for example, the card number was # stolen). CHARGEBACK_FRAUD = 8 # Indicates a chargeback related to the cardholder having provided their # card details but allegedly not being satisfied with the purchase # (for example, misrepresentation, attempted cancellation). CHARGEBACK_DISPUTE = 9 # Indicates the transaction associated with the assessment is suspected of # being fraudulent based on the payment method, billing details, shipping # address or other transaction information. PAYMENT_HEURISTICS = 2 # Indicates that the user was served a 2FA challenge. An old assessment # with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been # overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow. # This is equivalent to `FAILED_TWO_FACTOR`. INITIATED_TWO_FACTOR = 7 # Indicates that the user passed a 2FA challenge. PASSED_TWO_FACTOR = 3 # Indicates that the user failed a 2FA challenge. FAILED_TWO_FACTOR = 4 # Indicates the user provided the correct password. CORRECT_PASSWORD = 5 # Indicates the user provided an incorrect password. INCORRECT_PASSWORD = 6 end end # Empty response for AnnotateAssessment. class AnnotateAssessmentResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Password leak verification info. # @!attribute [rw] hashed_user_credentials # @return [::String] # Optional. Scrypt hash of the username+password that the customer wants to verify # against a known password leak. # @!attribute [r] credentials_leaked # @return [::Boolean] # Output only. Whether or not the user's credentials are present in a known leak. # @!attribute [rw] canonicalized_username # @return [::String] # Optional. The username part of the user credentials for which we want to trigger a # leak check in canonicalized form. This is the same data used to create the # hashed_user_credentials on the customer side. class PasswordLeakVerification include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # A recaptcha assessment resource. # @!attribute [r] name # @return [::String] # Output only. The resource name for the Assessment in the format # "projects/\\{project_number}/assessments/\\{assessment_id}". # @!attribute [rw] event # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Event] # The event being assessed. # @!attribute [r] score # @return [::Float] # Output only. Legitimate event score from 0.0 to 1.0. # (1.0 means very likely legitimate traffic while 0.0 means very likely # non-legitimate traffic). # @!attribute [r] token_properties # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TokenProperties] # Output only. Properties of the provided event token. # @!attribute [r] reasons # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment::ClassificationReason>] # Output only. Reasons contributing to the risk analysis verdict. # @!attribute [rw] password_leak_verification # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::PasswordLeakVerification] # Information about the user's credentials used to check for leaks. # This feature is part of the Early Access Program (EAP). Exercise caution, # and do not deploy integrations based on this feature in a production # environment. # @!attribute [rw] account_defender_assessment # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AccountDefenderAssessment] # Assessment returned by Account Defender when a hashed_account_id is # provided. class Assessment include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Reasons contributing to the risk analysis verdict. module ClassificationReason # Default unspecified type. CLASSIFICATION_REASON_UNSPECIFIED = 0 # Interactions matched the behavior of an automated agent. AUTOMATION = 1 # The event originated from an illegitimate environment. UNEXPECTED_ENVIRONMENT = 2 # Traffic volume from the event source is higher than normal. TOO_MUCH_TRAFFIC = 3 # Interactions with the site were significantly different than expected # patterns. UNEXPECTED_USAGE_PATTERNS = 4 # Too little traffic has been received from this site thus far to generate # quality risk analysis. LOW_CONFIDENCE_SCORE = 5 end end # @!attribute [rw] token # @return [::String] # Optional. The user response token provided by the reCAPTCHA client-side integration # on your site. # @!attribute [rw] site_key # @return [::String] # Optional. The site key that was used to invoke reCAPTCHA on your site and generate # the token. # @!attribute [rw] user_agent # @return [::String] # Optional. The user agent present in the request from the user's device related to # this event. # @!attribute [rw] user_ip_address # @return [::String] # Optional. The IP address in the request from the user's device related to this event. # @!attribute [rw] expected_action # @return [::String] # Optional. The expected action for this type of event. This should be the same action # provided at token generation time on client-side platforms already # integrated with recaptcha enterprise. # @!attribute [rw] hashed_account_id # @return [::String] # Optional. Optional unique stable hashed user identifier for the request. The # identifier should ideally be hashed using sha256 with stable secret. class Event include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # @!attribute [rw] valid # @return [::Boolean] # Whether the provided user response token is valid. When valid = false, the # reason could be specified in invalid_reason or it could also be due to # a user failing to solve a challenge or a sitekey mismatch (i.e the sitekey # used to generate the token was different than the one specified in the # assessment). # @!attribute [rw] invalid_reason # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TokenProperties::InvalidReason] # Reason associated with the response when valid = false. # @!attribute [rw] create_time # @return [::Google::Protobuf::Timestamp] # The timestamp corresponding to the generation of the token. # @!attribute [rw] hostname # @return [::String] # The hostname of the page on which the token was generated. # @!attribute [rw] action # @return [::String] # Action name provided at token generation. class TokenProperties include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Enum that represents the types of invalid token reasons. module InvalidReason # Default unspecified type. INVALID_REASON_UNSPECIFIED = 0 # If the failure reason was not accounted for. UNKNOWN_INVALID_REASON = 1 # The provided user verification token was malformed. MALFORMED = 2 # The user verification token had expired. EXPIRED = 3 # The user verification had already been seen. DUPE = 4 # The user verification token did not match the provided site key. # This may be a configuration error (e.g. development keys used in # production) or end users trying to use verification tokens from other # sites. SITE_MISMATCH = 5 # The user verification token was not present. It is a required input. MISSING = 6 # A retriable error (such as network failure) occurred on the browser. # Could easily be simulated by an attacker. BROWSER_ERROR = 7 end end # Account Defender risk assessment. # @!attribute [rw] labels # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AccountDefenderAssessment::AccountDefenderLabel>] # Labels for this request. class AccountDefenderAssessment include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Labels returned by Account Defender for this request. module AccountDefenderLabel # Default unspecified type. ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0 # The request matches a known good profile for the user. PROFILE_MATCH = 1 # The request is potentially a suspicious login event and should be further # verified either via multi-factor authentication or another system. SUSPICIOUS_LOGIN_ACTIVITY = 2 # The request matched a profile that previously had suspicious account # creation behavior. This could mean this is a fake account. SUSPICIOUS_ACCOUNT_CREATION = 3 # The account in the request has a high number of related accounts. It does # not necessarily imply that the account is bad but could require # investigating. RELATED_ACCOUNTS_NUMBER_HIGH = 4 end end end end end end