google-cloud-recaptcha_enterprise-v1 0.4.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c9ea5260c755afca31b18d99b08fabab0c114e71e18f1de5fad5871457ac29b
4
- data.tar.gz: 0ffe08204473a050d0aa30c4592c83b694ac75ba054969c20ce2cd5cb20eb488
3
+ metadata.gz: 80ac614deb6f19fdc91502ed03f14857e6b153008254cc22a61c9105fb3f4e0f
4
+ data.tar.gz: c8177212bb19aba5bf7242281e60fa07abbe5c3895392be2b1d1d479bb75e9ee
5
5
  SHA512:
6
- metadata.gz: 2ae6854aff84657d175233d264e98fb47514d305e4222680b037b58c80132f87628611c560c4556177a73de4799237f4203786074ca8c2c3be2a9c3c841d0476
7
- data.tar.gz: b8fbb86cefebc19eee4ac16adcf0ac65e8bbf641a9608355c6cedbf123a16dd22ab3e9031bfe9e16fc8f0d9d4e68f3e2db61621c3f607a81e4a3264309e928ee
6
+ metadata.gz: eef410de801d8f28db19ec486243bdc9a1bef11770039e7198e1a957d3e34834f10ef067f5fc5a996e7c9bb82498d775e825325a88045f17fa6d8a84e5d5d12c
7
+ data.tar.gz: 6fcbd07ca6d8aaeb7f3c287353485b4da686d4c30ea91e3d82bc667457f179053b7fc4c3410b617495199ed1fb1a2ff1772c26bbe6b630fca8c7fa98a98ad96f
@@ -231,7 +231,7 @@ module Google
231
231
 
232
232
  ##
233
233
  # Annotates a previously created Assessment to provide additional information
234
- # on whether the event turned out to be authentic or fradulent.
234
+ # on whether the event turned out to be authentic or fraudulent.
235
235
  #
236
236
  # @overload annotate_assessment(request, options = nil)
237
237
  # Pass arguments to `annotate_assessment` via a request object, either of type
@@ -243,7 +243,7 @@ module Google
243
243
  # @param options [::Gapic::CallOptions, ::Hash]
244
244
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
245
245
  #
246
- # @overload annotate_assessment(name: nil, annotation: nil)
246
+ # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil)
247
247
  # Pass arguments to `annotate_assessment` via keyword arguments. Note that at
248
248
  # least one keyword argument is required. To specify no parameters, or to keep all
249
249
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -252,7 +252,11 @@ module Google
252
252
  # Required. The resource name of the Assessment, in the format
253
253
  # "projects/\\{project}/assessments/\\{assessment}".
254
254
  # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Annotation]
255
- # Required. The annotation that will be assigned to the Event.
255
+ # Optional. The annotation that will be assigned to the Event. This field can be left
256
+ # empty to provide reasons that apply to an event without concluding whether
257
+ # the event is legitimate or fraudulent.
258
+ # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Reason>]
259
+ # Optional. Optional reasons for the annotation that will be assigned to the Event.
256
260
  #
257
261
  # @yield [response, operation] Access the result along with the RPC operation
258
262
  # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse]
@@ -538,7 +542,7 @@ module Google
538
542
  # @param key [::Google::Cloud::RecaptchaEnterprise::V1::Key, ::Hash]
539
543
  # Required. The key to update.
540
544
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
541
- # Optional. The mask to control which field of the key get updated. If the mask is not
545
+ # Optional. The mask to control which fields of the key get updated. If the mask is not
542
546
  # present, all fields will be updated.
543
547
  #
544
548
  # @yield [response, operation] Access the result along with the RPC operation
@@ -657,6 +661,150 @@ module Google
657
661
  raise ::Google::Cloud::Error.from_error(e)
658
662
  end
659
663
 
664
+ ##
665
+ # Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
666
+ # Once a key is migrated, it can be used from either product. SiteVerify
667
+ # requests are billed as CreateAssessment calls. You must be
668
+ # authenticated as one of the current owners of the reCAPTCHA Site Key, and
669
+ # your user must have the reCAPTCHA Enterprise Admin IAM role in the
670
+ # destination project.
671
+ #
672
+ # @overload migrate_key(request, options = nil)
673
+ # Pass arguments to `migrate_key` via a request object, either of type
674
+ # {::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest} or an equivalent Hash.
675
+ #
676
+ # @param request [::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest, ::Hash]
677
+ # A request object representing the call parameters. Required. To specify no
678
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
679
+ # @param options [::Gapic::CallOptions, ::Hash]
680
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
681
+ #
682
+ # @overload migrate_key(name: nil)
683
+ # Pass arguments to `migrate_key` via keyword arguments. Note that at
684
+ # least one keyword argument is required. To specify no parameters, or to keep all
685
+ # the default parameter values, pass an empty Hash as a request object (see above).
686
+ #
687
+ # @param name [::String]
688
+ # Required. The name of the key to be migrated, in the format
689
+ # "projects/\\{project}/keys/\\{key}".
690
+ #
691
+ # @yield [response, operation] Access the result along with the RPC operation
692
+ # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Key]
693
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
694
+ #
695
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key]
696
+ #
697
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
698
+ #
699
+ def migrate_key request, options = nil
700
+ raise ::ArgumentError, "request must be provided" if request.nil?
701
+
702
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest
703
+
704
+ # Converts hash and nil to an options object
705
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
706
+
707
+ # Customize the options with defaults
708
+ metadata = @config.rpcs.migrate_key.metadata.to_h
709
+
710
+ # Set x-goog-api-client and x-goog-user-project headers
711
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
712
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
713
+ gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
714
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
715
+
716
+ header_params = {
717
+ "name" => request.name
718
+ }
719
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
720
+ metadata[:"x-goog-request-params"] ||= request_params_header
721
+
722
+ options.apply_defaults timeout: @config.rpcs.migrate_key.timeout,
723
+ metadata: metadata,
724
+ retry_policy: @config.rpcs.migrate_key.retry_policy
725
+
726
+ options.apply_defaults timeout: @config.timeout,
727
+ metadata: @config.metadata,
728
+ retry_policy: @config.retry_policy
729
+
730
+ @recaptcha_enterprise_service_stub.call_rpc :migrate_key, request, options: options do |response, operation|
731
+ yield response, operation if block_given?
732
+ return response
733
+ end
734
+ rescue ::GRPC::BadStatus => e
735
+ raise ::Google::Cloud::Error.from_error(e)
736
+ end
737
+
738
+ ##
739
+ # Get some aggregated metrics for a Key. This data can be used to build
740
+ # dashboards.
741
+ #
742
+ # @overload get_metrics(request, options = nil)
743
+ # Pass arguments to `get_metrics` via a request object, either of type
744
+ # {::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest} or an equivalent Hash.
745
+ #
746
+ # @param request [::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest, ::Hash]
747
+ # A request object representing the call parameters. Required. To specify no
748
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
749
+ # @param options [::Gapic::CallOptions, ::Hash]
750
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
751
+ #
752
+ # @overload get_metrics(name: nil)
753
+ # Pass arguments to `get_metrics` via keyword arguments. Note that at
754
+ # least one keyword argument is required. To specify no parameters, or to keep all
755
+ # the default parameter values, pass an empty Hash as a request object (see above).
756
+ #
757
+ # @param name [::String]
758
+ # Required. The name of the requested metrics, in the format
759
+ # "projects/\\{project}/keys/\\{key}/metrics".
760
+ #
761
+ # @yield [response, operation] Access the result along with the RPC operation
762
+ # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Metrics]
763
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
764
+ #
765
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::Metrics]
766
+ #
767
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
768
+ #
769
+ def get_metrics request, options = nil
770
+ raise ::ArgumentError, "request must be provided" if request.nil?
771
+
772
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest
773
+
774
+ # Converts hash and nil to an options object
775
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
776
+
777
+ # Customize the options with defaults
778
+ metadata = @config.rpcs.get_metrics.metadata.to_h
779
+
780
+ # Set x-goog-api-client and x-goog-user-project headers
781
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
782
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
783
+ gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
784
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
785
+
786
+ header_params = {
787
+ "name" => request.name
788
+ }
789
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
790
+ metadata[:"x-goog-request-params"] ||= request_params_header
791
+
792
+ options.apply_defaults timeout: @config.rpcs.get_metrics.timeout,
793
+ metadata: metadata,
794
+ retry_policy: @config.rpcs.get_metrics.retry_policy
795
+
796
+ options.apply_defaults timeout: @config.timeout,
797
+ metadata: @config.metadata,
798
+ retry_policy: @config.retry_policy
799
+
800
+ @recaptcha_enterprise_service_stub.call_rpc :get_metrics, request, options: options do |response, operation|
801
+ yield response, operation if block_given?
802
+ return response
803
+ end
804
+ rescue ::GRPC::BadStatus => e
805
+ raise ::Google::Cloud::Error.from_error(e)
806
+ end
807
+
660
808
  ##
661
809
  # Configuration class for the RecaptchaEnterpriseService API.
662
810
  #
@@ -827,6 +975,16 @@ module Google
827
975
  # @return [::Gapic::Config::Method]
828
976
  #
829
977
  attr_reader :delete_key
978
+ ##
979
+ # RPC-specific configuration for `migrate_key`
980
+ # @return [::Gapic::Config::Method]
981
+ #
982
+ attr_reader :migrate_key
983
+ ##
984
+ # RPC-specific configuration for `get_metrics`
985
+ # @return [::Gapic::Config::Method]
986
+ #
987
+ attr_reader :get_metrics
830
988
 
831
989
  # @private
832
990
  def initialize parent_rpcs = nil
@@ -844,6 +1002,10 @@ module Google
844
1002
  @update_key = ::Gapic::Config::Method.new update_key_config
845
1003
  delete_key_config = parent_rpcs.delete_key if parent_rpcs.respond_to? :delete_key
846
1004
  @delete_key = ::Gapic::Config::Method.new delete_key_config
1005
+ migrate_key_config = parent_rpcs.migrate_key if parent_rpcs.respond_to? :migrate_key
1006
+ @migrate_key = ::Gapic::Config::Method.new migrate_key_config
1007
+ get_metrics_config = parent_rpcs.get_metrics if parent_rpcs.respond_to? :get_metrics
1008
+ @get_metrics = ::Gapic::Config::Method.new get_metrics_config
847
1009
 
848
1010
  yield self if block_given?
849
1011
  end
@@ -58,6 +58,23 @@ module Google
58
58
  "projects/#{project}/keys/#{key}"
59
59
  end
60
60
 
61
+ ##
62
+ # Create a fully-qualified Metrics resource string.
63
+ #
64
+ # The resource will be in the following format:
65
+ #
66
+ # `projects/{project}/keys/{key}/metrics`
67
+ #
68
+ # @param project [String]
69
+ # @param key [String]
70
+ #
71
+ # @return [::String]
72
+ def metrics_path project:, key:
73
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
74
+
75
+ "projects/#{project}/keys/#{key}/metrics"
76
+ end
77
+
61
78
  ##
62
79
  # Create a fully-qualified Project resource string.
63
80
  #
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module RecaptchaEnterprise
23
23
  module V1
24
- VERSION = "0.4.3"
24
+ VERSION = "0.5.0"
25
25
  end
26
26
  end
27
27
  end
@@ -19,6 +19,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
19
19
  add_message "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest" do
20
20
  optional :name, :string, 1
21
21
  optional :annotation, :enum, 2, "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation"
22
+ repeated :reasons, :enum, 3, "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason"
22
23
  end
23
24
  add_enum "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation" do
24
25
  value :ANNOTATION_UNSPECIFIED, 0
@@ -27,6 +28,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
27
28
  value :PASSWORD_CORRECT, 3
28
29
  value :PASSWORD_INCORRECT, 4
29
30
  end
31
+ add_enum "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason" do
32
+ value :REASON_UNSPECIFIED, 0
33
+ value :CHARGEBACK, 1
34
+ value :PAYMENT_HEURISTICS, 2
35
+ value :INITIATED_TWO_FACTOR, 7
36
+ value :PASSED_TWO_FACTOR, 3
37
+ value :FAILED_TWO_FACTOR, 4
38
+ value :CORRECT_PASSWORD, 5
39
+ value :INCORRECT_PASSWORD, 6
40
+ end
30
41
  add_message "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse" do
31
42
  end
32
43
  add_message "google.cloud.recaptchaenterprise.v1.Assessment" do
@@ -68,6 +79,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
68
79
  value :EXPIRED, 3
69
80
  value :DUPE, 4
70
81
  value :MISSING, 5
82
+ value :BROWSER_ERROR, 6
71
83
  end
72
84
  add_message "google.cloud.recaptchaenterprise.v1.CreateKeyRequest" do
73
85
  optional :parent, :string, 1
@@ -92,17 +104,39 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
92
104
  add_message "google.cloud.recaptchaenterprise.v1.DeleteKeyRequest" do
93
105
  optional :name, :string, 1
94
106
  end
107
+ add_message "google.cloud.recaptchaenterprise.v1.MigrateKeyRequest" do
108
+ optional :name, :string, 1
109
+ end
110
+ add_message "google.cloud.recaptchaenterprise.v1.GetMetricsRequest" do
111
+ optional :name, :string, 1
112
+ end
113
+ add_message "google.cloud.recaptchaenterprise.v1.Metrics" do
114
+ optional :name, :string, 4
115
+ optional :start_time, :message, 1, "google.protobuf.Timestamp"
116
+ repeated :score_metrics, :message, 2, "google.cloud.recaptchaenterprise.v1.ScoreMetrics"
117
+ repeated :challenge_metrics, :message, 3, "google.cloud.recaptchaenterprise.v1.ChallengeMetrics"
118
+ end
95
119
  add_message "google.cloud.recaptchaenterprise.v1.Key" do
96
120
  optional :name, :string, 1
97
121
  optional :display_name, :string, 2
98
122
  map :labels, :string, :string, 6
99
123
  optional :create_time, :message, 7, "google.protobuf.Timestamp"
124
+ optional :testing_options, :message, 9, "google.cloud.recaptchaenterprise.v1.TestingOptions"
100
125
  oneof :platform_settings do
101
126
  optional :web_settings, :message, 3, "google.cloud.recaptchaenterprise.v1.WebKeySettings"
102
127
  optional :android_settings, :message, 4, "google.cloud.recaptchaenterprise.v1.AndroidKeySettings"
103
128
  optional :ios_settings, :message, 5, "google.cloud.recaptchaenterprise.v1.IOSKeySettings"
104
129
  end
105
130
  end
131
+ add_message "google.cloud.recaptchaenterprise.v1.TestingOptions" do
132
+ optional :testing_score, :float, 1
133
+ optional :testing_challenge, :enum, 2, "google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge"
134
+ end
135
+ add_enum "google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge" do
136
+ value :TESTING_CHALLENGE_UNSPECIFIED, 0
137
+ value :NOCAPTCHA, 1
138
+ value :UNSOLVABLE_CHALLENGE, 2
139
+ end
106
140
  add_message "google.cloud.recaptchaenterprise.v1.WebKeySettings" do
107
141
  optional :allow_all_domains, :bool, 3
108
142
  repeated :allowed_domains, :string, 1
@@ -123,11 +157,26 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
123
157
  value :SECURITY, 3
124
158
  end
125
159
  add_message "google.cloud.recaptchaenterprise.v1.AndroidKeySettings" do
160
+ optional :allow_all_package_names, :bool, 2
126
161
  repeated :allowed_package_names, :string, 1
127
162
  end
128
163
  add_message "google.cloud.recaptchaenterprise.v1.IOSKeySettings" do
164
+ optional :allow_all_bundle_ids, :bool, 2
129
165
  repeated :allowed_bundle_ids, :string, 1
130
166
  end
167
+ add_message "google.cloud.recaptchaenterprise.v1.ScoreDistribution" do
168
+ map :score_buckets, :int32, :int64, 1
169
+ end
170
+ add_message "google.cloud.recaptchaenterprise.v1.ScoreMetrics" do
171
+ optional :overall_metrics, :message, 1, "google.cloud.recaptchaenterprise.v1.ScoreDistribution"
172
+ map :action_metrics, :string, :message, 2, "google.cloud.recaptchaenterprise.v1.ScoreDistribution"
173
+ end
174
+ add_message "google.cloud.recaptchaenterprise.v1.ChallengeMetrics" do
175
+ optional :pageload_count, :int64, 1
176
+ optional :nocaptcha_count, :int64, 2
177
+ optional :failed_count, :int64, 3
178
+ optional :passed_count, :int64, 4
179
+ end
131
180
  end
132
181
  end
133
182
 
@@ -138,6 +187,7 @@ module Google
138
187
  CreateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest").msgclass
139
188
  AnnotateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest").msgclass
140
189
  AnnotateAssessmentRequest::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation").enummodule
190
+ AnnotateAssessmentRequest::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason").enummodule
141
191
  AnnotateAssessmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse").msgclass
142
192
  Assessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Assessment").msgclass
143
193
  Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Event").msgclass
@@ -151,12 +201,20 @@ module Google
151
201
  GetKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.GetKeyRequest").msgclass
152
202
  UpdateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.UpdateKeyRequest").msgclass
153
203
  DeleteKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.DeleteKeyRequest").msgclass
204
+ MigrateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.MigrateKeyRequest").msgclass
205
+ GetMetricsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.GetMetricsRequest").msgclass
206
+ Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Metrics").msgclass
154
207
  Key = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Key").msgclass
208
+ TestingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TestingOptions").msgclass
209
+ TestingOptions::TestingChallenge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge").enummodule
155
210
  WebKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings").msgclass
156
211
  WebKeySettings::IntegrationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType").enummodule
157
212
  WebKeySettings::ChallengeSecurityPreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference").enummodule
158
213
  AndroidKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AndroidKeySettings").msgclass
159
214
  IOSKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.IOSKeySettings").msgclass
215
+ ScoreDistribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ScoreDistribution").msgclass
216
+ ScoreMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ScoreMetrics").msgclass
217
+ ChallengeMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ChallengeMetrics").msgclass
160
218
  end
161
219
  end
162
220
  end
@@ -36,7 +36,7 @@ module Google
36
36
  # Creates an Assessment of the likelihood an event is legitimate.
37
37
  rpc :CreateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Assessment
38
38
  # Annotates a previously created Assessment to provide additional information
39
- # on whether the event turned out to be authentic or fradulent.
39
+ # on whether the event turned out to be authentic or fraudulent.
40
40
  rpc :AnnotateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse
41
41
  # Creates a new reCAPTCHA Enterprise key.
42
42
  rpc :CreateKey, ::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key
@@ -48,6 +48,16 @@ module Google
48
48
  rpc :UpdateKey, ::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key
49
49
  # Deletes the specified key.
50
50
  rpc :DeleteKey, ::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest, ::Google::Protobuf::Empty
51
+ # Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
52
+ # Once a key is migrated, it can be used from either product. SiteVerify
53
+ # requests are billed as CreateAssessment calls. You must be
54
+ # authenticated as one of the current owners of the reCAPTCHA Site Key, and
55
+ # your user must have the reCAPTCHA Enterprise Admin IAM role in the
56
+ # destination project.
57
+ rpc :MigrateKey, ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key
58
+ # Get some aggregated metrics for a Key. This data can be used to build
59
+ # dashboards.
60
+ rpc :GetMetrics, ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Metrics
51
61
  end
52
62
 
53
63
  Stub = Service.rpc_stub_class
@@ -41,12 +41,17 @@ module Google
41
41
  # "projects/\\{project}/assessments/\\{assessment}".
42
42
  # @!attribute [rw] annotation
43
43
  # @return [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Annotation]
44
- # Required. The annotation that will be assigned to the Event.
44
+ # Optional. The annotation that will be assigned to the Event. This field can be left
45
+ # empty to provide reasons that apply to an event without concluding whether
46
+ # the event is legitimate or fraudulent.
47
+ # @!attribute [rw] reasons
48
+ # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Reason>]
49
+ # Optional. Optional reasons for the annotation that will be assigned to the Event.
45
50
  class AnnotateAssessmentRequest
46
51
  include ::Google::Protobuf::MessageExts
47
52
  extend ::Google::Protobuf::MessageExts::ClassMethods
48
53
 
49
- # Enum that reprensents the types of annotations.
54
+ # Enum that represents the types of annotations.
50
55
  module Annotation
51
56
  # Default unspecified type.
52
57
  ANNOTATION_UNSPECIFIED = 0
@@ -58,13 +63,48 @@ module Google
58
63
  FRAUDULENT = 2
59
64
 
60
65
  # Provides information that the event was related to a login event in which
61
- # the user typed the correct password.
66
+ # the user typed the correct password. Deprecated, prefer indicating
67
+ # CORRECT_PASSWORD through the reasons field instead.
62
68
  PASSWORD_CORRECT = 3
63
69
 
64
70
  # Provides information that the event was related to a login event in which
65
- # the user typed the incorrect password.
71
+ # the user typed the incorrect password. Deprecated, prefer indicating
72
+ # INCORRECT_PASSWORD through the reasons field instead.
66
73
  PASSWORD_INCORRECT = 4
67
74
  end
75
+
76
+ # Enum that represents potential reasons for annotating an assessment.
77
+ module Reason
78
+ # Default unspecified reason.
79
+ REASON_UNSPECIFIED = 0
80
+
81
+ # Indicates a chargeback for fraud was issued for the transaction
82
+ # associated with the assessment.
83
+ CHARGEBACK = 1
84
+
85
+ # Indicates the transaction associated with the assessment is suspected of
86
+ # being fraudulent based on the payment method, billing details, shipping
87
+ # address or other transaction information.
88
+ PAYMENT_HEURISTICS = 2
89
+
90
+ # Indicates that the user was served a 2FA challenge. An old assessment
91
+ # with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been
92
+ # overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow.
93
+ # This is equivalent to `FAILED_TWO_FACTOR`.
94
+ INITIATED_TWO_FACTOR = 7
95
+
96
+ # Indicates that the user passed a 2FA challenge.
97
+ PASSED_TWO_FACTOR = 3
98
+
99
+ # Indicates that the user failed a 2FA challenge.
100
+ FAILED_TWO_FACTOR = 4
101
+
102
+ # Indicates the user provided the correct password.
103
+ CORRECT_PASSWORD = 5
104
+
105
+ # Indicates the user provided an incorrect password.
106
+ INCORRECT_PASSWORD = 6
107
+ end
68
108
  end
69
109
 
70
110
  # Empty response for AnnotateAssessment.
@@ -130,7 +170,6 @@ module Google
130
170
  include ::Google::Protobuf::MessageExts
131
171
  extend ::Google::Protobuf::MessageExts::ClassMethods
132
172
 
133
- # LINT.IfChange(classification_reason)
134
173
  # Reasons contributing to the risk analysis verdict.
135
174
  module ClassificationReason
136
175
  # Default unspecified type.
@@ -178,7 +217,6 @@ module Google
178
217
  include ::Google::Protobuf::MessageExts
179
218
  extend ::Google::Protobuf::MessageExts::ClassMethods
180
219
 
181
- # LINT.IfChange
182
220
  # Enum that represents the types of invalid token reasons.
183
221
  module InvalidReason
184
222
  # Default unspecified type.
@@ -198,6 +236,10 @@ module Google
198
236
 
199
237
  # The user verification token was not present.
200
238
  MISSING = 5
239
+
240
+ # A retriable error (such as network failure) occurred on the browser.
241
+ # Could easily be simulated by an attacker.
242
+ BROWSER_ERROR = 6
201
243
  end
202
244
  end
203
245
 
@@ -261,7 +303,7 @@ module Google
261
303
  # Required. The key to update.
262
304
  # @!attribute [rw] update_mask
263
305
  # @return [::Google::Protobuf::FieldMask]
264
- # Optional. The mask to control which field of the key get updated. If the mask is not
306
+ # Optional. The mask to control which fields of the key get updated. If the mask is not
265
307
  # present, all fields will be updated.
266
308
  class UpdateKeyRequest
267
309
  include ::Google::Protobuf::MessageExts
@@ -278,6 +320,48 @@ module Google
278
320
  extend ::Google::Protobuf::MessageExts::ClassMethods
279
321
  end
280
322
 
323
+ # The migrate key request message.
324
+ # @!attribute [rw] name
325
+ # @return [::String]
326
+ # Required. The name of the key to be migrated, in the format
327
+ # "projects/\\{project}/keys/\\{key}".
328
+ class MigrateKeyRequest
329
+ include ::Google::Protobuf::MessageExts
330
+ extend ::Google::Protobuf::MessageExts::ClassMethods
331
+ end
332
+
333
+ # The get metrics request message.
334
+ # @!attribute [rw] name
335
+ # @return [::String]
336
+ # Required. The name of the requested metrics, in the format
337
+ # "projects/\\{project}/keys/\\{key}/metrics".
338
+ class GetMetricsRequest
339
+ include ::Google::Protobuf::MessageExts
340
+ extend ::Google::Protobuf::MessageExts::ClassMethods
341
+ end
342
+
343
+ # Metrics for a single Key.
344
+ # @!attribute [r] name
345
+ # @return [::String]
346
+ # Output only. The name of the metrics, in the format
347
+ # "projects/\\{project}/keys/\\{key}/metrics".
348
+ # @!attribute [rw] start_time
349
+ # @return [::Google::Protobuf::Timestamp]
350
+ # Inclusive start time aligned to a day (UTC).
351
+ # @!attribute [rw] score_metrics
352
+ # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::ScoreMetrics>]
353
+ # Metrics will be continuous and in order by dates, and in the granularity
354
+ # of day. All Key types should have score-based data.
355
+ # @!attribute [rw] challenge_metrics
356
+ # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::ChallengeMetrics>]
357
+ # Metrics will be continuous and in order by dates, and in the granularity
358
+ # of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
359
+ # challenge-based data.
360
+ class Metrics
361
+ include ::Google::Protobuf::MessageExts
362
+ extend ::Google::Protobuf::MessageExts::ClassMethods
363
+ end
364
+
281
365
  # A key used to identify and configure applications (web and/or mobile) that
282
366
  # use reCAPTCHA Enterprise.
283
367
  # @!attribute [rw] name
@@ -298,11 +382,14 @@ module Google
298
382
  # Settings for keys that can be used by iOS apps.
299
383
  # @!attribute [rw] labels
300
384
  # @return [::Google::Protobuf::Map{::String => ::String}]
301
- # Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
385
+ # See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
302
386
  # Creating and managing labels</a>.
303
387
  # @!attribute [rw] create_time
304
388
  # @return [::Google::Protobuf::Timestamp]
305
389
  # The timestamp corresponding to the creation of this Key.
390
+ # @!attribute [rw] testing_options
391
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::TestingOptions]
392
+ # Options for user acceptance testing.
306
393
  class Key
307
394
  include ::Google::Protobuf::MessageExts
308
395
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -317,6 +404,37 @@ module Google
317
404
  end
318
405
  end
319
406
 
407
+ # Options for user acceptance testing.
408
+ # @!attribute [rw] testing_score
409
+ # @return [::Float]
410
+ # All assessments for this Key will return this score. Must be between 0
411
+ # (likely not legitimate) and 1 (likely legitimate) inclusive.
412
+ # @!attribute [rw] testing_challenge
413
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::TestingOptions::TestingChallenge]
414
+ # For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
415
+ # for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
416
+ # challenge if CHALLENGE.
417
+ class TestingOptions
418
+ include ::Google::Protobuf::MessageExts
419
+ extend ::Google::Protobuf::MessageExts::ClassMethods
420
+
421
+ # Enum that represents the challenge option for challenge-based (CHECKBOX,
422
+ # INVISIBLE) testing keys.
423
+ module TestingChallenge
424
+ # Perform the normal risk analysis and return either nocaptcha or a
425
+ # challenge depending on risk and trust factors.
426
+ TESTING_CHALLENGE_UNSPECIFIED = 0
427
+
428
+ # Challenge requests for this key will always return a nocaptcha, which
429
+ # does not require a solution.
430
+ NOCAPTCHA = 1
431
+
432
+ # Challenge requests for this key will always return an unsolvable
433
+ # challenge.
434
+ UNSOLVABLE_CHALLENGE = 2
435
+ end
436
+ end
437
+
320
438
  # Settings specific to keys that can be used by websites.
321
439
  # @!attribute [rw] allow_all_domains
322
440
  # @return [::Boolean]
@@ -330,6 +448,7 @@ module Google
330
448
  # @!attribute [rw] allow_amp_traffic
331
449
  # @return [::Boolean]
332
450
  # Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
451
+ # This can only be set for the SCORE integration type.
333
452
  # @!attribute [rw] integration_type
334
453
  # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::IntegrationType]
335
454
  # Required. Describes how this key is integrated with the website.
@@ -380,6 +499,9 @@ module Google
380
499
  end
381
500
 
382
501
  # Settings specific to keys that can be used by Android apps.
502
+ # @!attribute [rw] allow_all_package_names
503
+ # @return [::Boolean]
504
+ # If set to true, it means allowed_package_names will not be enforced.
383
505
  # @!attribute [rw] allowed_package_names
384
506
  # @return [::Array<::String>]
385
507
  # Android package names of apps allowed to use the key.
@@ -390,6 +512,9 @@ module Google
390
512
  end
391
513
 
392
514
  # Settings specific to keys that can be used by iOS apps.
515
+ # @!attribute [rw] allow_all_bundle_ids
516
+ # @return [::Boolean]
517
+ # If set to true, it means allowed_bundle_ids will not be enforced.
393
518
  # @!attribute [rw] allowed_bundle_ids
394
519
  # @return [::Array<::String>]
395
520
  # iOS bundle ids of apps allowed to use the key.
@@ -398,6 +523,71 @@ module Google
398
523
  include ::Google::Protobuf::MessageExts
399
524
  extend ::Google::Protobuf::MessageExts::ClassMethods
400
525
  end
526
+
527
+ # Score distribution.
528
+ # @!attribute [rw] score_buckets
529
+ # @return [::Google::Protobuf::Map{::Integer => ::Integer}]
530
+ # Map key is score value multiplied by 100. The scores are discrete values
531
+ # between [0, 1]. The maximum number of buckets is on order of a few dozen,
532
+ # but typically much lower (ie. 10).
533
+ class ScoreDistribution
534
+ include ::Google::Protobuf::MessageExts
535
+ extend ::Google::Protobuf::MessageExts::ClassMethods
536
+
537
+ # @!attribute [rw] key
538
+ # @return [::Integer]
539
+ # @!attribute [rw] value
540
+ # @return [::Integer]
541
+ class ScoreBucketsEntry
542
+ include ::Google::Protobuf::MessageExts
543
+ extend ::Google::Protobuf::MessageExts::ClassMethods
544
+ end
545
+ end
546
+
547
+ # Metrics related to scoring.
548
+ # @!attribute [rw] overall_metrics
549
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution]
550
+ # Aggregated score metrics for all traffic.
551
+ # @!attribute [rw] action_metrics
552
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution}]
553
+ # Action-based metrics. The map key is the action name which specified by the
554
+ # site owners at time of the "execute" client-side call.
555
+ # Populated only for SCORE keys.
556
+ class ScoreMetrics
557
+ include ::Google::Protobuf::MessageExts
558
+ extend ::Google::Protobuf::MessageExts::ClassMethods
559
+
560
+ # @!attribute [rw] key
561
+ # @return [::String]
562
+ # @!attribute [rw] value
563
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution]
564
+ class ActionMetricsEntry
565
+ include ::Google::Protobuf::MessageExts
566
+ extend ::Google::Protobuf::MessageExts::ClassMethods
567
+ end
568
+ end
569
+
570
+ # Metrics related to challenges.
571
+ # @!attribute [rw] pageload_count
572
+ # @return [::Integer]
573
+ # Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent
574
+ # to a count of pageloads for pages that include reCAPTCHA.
575
+ # @!attribute [rw] nocaptcha_count
576
+ # @return [::Integer]
577
+ # Count of nocaptchas (successful verification without a challenge) issued.
578
+ # @!attribute [rw] failed_count
579
+ # @return [::Integer]
580
+ # Count of submitted challenge solutions that were incorrect or otherwise
581
+ # deemed suspicious such that a subsequent challenge was triggered.
582
+ # @!attribute [rw] passed_count
583
+ # @return [::Integer]
584
+ # Count of nocaptchas (successful verification without a challenge) plus
585
+ # submitted challenge solutions that were correct and resulted in
586
+ # verification.
587
+ class ChallengeMetrics
588
+ include ::Google::Protobuf::MessageExts
589
+ extend ::Google::Protobuf::MessageExts::ClassMethods
590
+ end
401
591
  end
402
592
  end
403
593
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-recaptcha_enterprise-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-11 00:00:00.000000000 Z
11
+ date: 2021-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common