google-cloud-recaptcha_enterprise-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module RecaptchaEnterprise
24
+ module V1
25
+ module RecaptchaEnterpriseService
26
+ # Credentials for the RecaptchaEnterpriseService API.
27
+ class Credentials < Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "RECAPTCHA_ENTERPRISE_CREDENTIALS",
33
+ "RECAPTCHA_ENTERPRISE_KEYFILE",
34
+ "GOOGLE_CLOUD_CREDENTIALS",
35
+ "GOOGLE_CLOUD_KEYFILE",
36
+ "GCLOUD_KEYFILE",
37
+ "RECAPTCHA_ENTERPRISE_CREDENTIALS_JSON",
38
+ "RECAPTCHA_ENTERPRISE_KEYFILE_JSON",
39
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
40
+ "GOOGLE_CLOUD_KEYFILE_JSON",
41
+ "GCLOUD_KEYFILE_JSON"
42
+ ]
43
+ self.paths = [
44
+ "~/.config/google_cloud/application_default_credentials.json"
45
+ ]
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module RecaptchaEnterprise
23
+ module V1
24
+ module RecaptchaEnterpriseService
25
+ # Path helper methods for the RecaptchaEnterpriseService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Assessment resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/assessments/{assessment}`
33
+ #
34
+ # @param project [String]
35
+ # @param assessment [String]
36
+ #
37
+ # @return [String]
38
+ def assessment_path project:, assessment:
39
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
40
+
41
+ "projects/#{project}/assessments/#{assessment}"
42
+ end
43
+
44
+ ##
45
+ # Create a fully-qualified Key resource string.
46
+ #
47
+ # The resource will be in the following format:
48
+ #
49
+ # `projects/{project}/keys/{key}`
50
+ #
51
+ # @param project [String]
52
+ # @param key [String]
53
+ #
54
+ # @return [String]
55
+ def key_path project:, key:
56
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
57
+
58
+ "projects/#{project}/keys/#{key}"
59
+ end
60
+
61
+ ##
62
+ # Create a fully-qualified Project resource string.
63
+ #
64
+ # The resource will be in the following format:
65
+ #
66
+ # `projects/{project}`
67
+ #
68
+ # @param project [String]
69
+ #
70
+ # @return [String]
71
+ def project_path project:
72
+ "projects/#{project}"
73
+ end
74
+
75
+ extend self
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module RecaptchaEnterprise
23
+ module V1
24
+ VERSION = "0.1.0"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,163 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/api/client_pb'
8
+ require 'google/api/field_behavior_pb'
9
+ require 'google/api/resource_pb'
10
+ require 'google/protobuf/empty_pb'
11
+ require 'google/protobuf/field_mask_pb'
12
+ require 'google/protobuf/timestamp_pb'
13
+ Google::Protobuf::DescriptorPool.generated_pool.build do
14
+ add_file("google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto", :syntax => :proto3) do
15
+ add_message "google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest" do
16
+ optional :parent, :string, 1
17
+ optional :assessment, :message, 2, "google.cloud.recaptchaenterprise.v1.Assessment"
18
+ end
19
+ add_message "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest" do
20
+ optional :name, :string, 1
21
+ optional :annotation, :enum, 2, "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation"
22
+ end
23
+ add_enum "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation" do
24
+ value :ANNOTATION_UNSPECIFIED, 0
25
+ value :LEGITIMATE, 1
26
+ value :FRAUDULENT, 2
27
+ value :PASSWORD_CORRECT, 3
28
+ value :PASSWORD_INCORRECT, 4
29
+ end
30
+ add_message "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse" do
31
+ end
32
+ add_message "google.cloud.recaptchaenterprise.v1.Assessment" do
33
+ optional :name, :string, 1
34
+ optional :event, :message, 2, "google.cloud.recaptchaenterprise.v1.Event"
35
+ optional :risk_analysis, :message, 3, "google.cloud.recaptchaenterprise.v1.RiskAnalysis"
36
+ optional :token_properties, :message, 4, "google.cloud.recaptchaenterprise.v1.TokenProperties"
37
+ end
38
+ add_message "google.cloud.recaptchaenterprise.v1.Event" do
39
+ optional :token, :string, 1
40
+ optional :site_key, :string, 2
41
+ optional :user_agent, :string, 3
42
+ optional :user_ip_address, :string, 4
43
+ optional :expected_action, :string, 5
44
+ end
45
+ add_message "google.cloud.recaptchaenterprise.v1.RiskAnalysis" do
46
+ optional :score, :float, 1
47
+ repeated :reasons, :enum, 2, "google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason"
48
+ end
49
+ add_enum "google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason" do
50
+ value :CLASSIFICATION_REASON_UNSPECIFIED, 0
51
+ value :AUTOMATION, 1
52
+ value :UNEXPECTED_ENVIRONMENT, 2
53
+ value :TOO_MUCH_TRAFFIC, 3
54
+ value :UNEXPECTED_USAGE_PATTERNS, 4
55
+ value :LOW_CONFIDENCE_SCORE, 5
56
+ end
57
+ add_message "google.cloud.recaptchaenterprise.v1.TokenProperties" do
58
+ optional :valid, :bool, 1
59
+ optional :invalid_reason, :enum, 2, "google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason"
60
+ optional :create_time, :message, 3, "google.protobuf.Timestamp"
61
+ optional :hostname, :string, 4
62
+ optional :action, :string, 5
63
+ end
64
+ add_enum "google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason" do
65
+ value :INVALID_REASON_UNSPECIFIED, 0
66
+ value :UNKNOWN_INVALID_REASON, 1
67
+ value :MALFORMED, 2
68
+ value :EXPIRED, 3
69
+ value :DUPE, 4
70
+ value :MISSING, 5
71
+ end
72
+ add_message "google.cloud.recaptchaenterprise.v1.CreateKeyRequest" do
73
+ optional :parent, :string, 1
74
+ optional :key, :message, 2, "google.cloud.recaptchaenterprise.v1.Key"
75
+ end
76
+ add_message "google.cloud.recaptchaenterprise.v1.ListKeysRequest" do
77
+ optional :parent, :string, 1
78
+ optional :page_size, :int32, 2
79
+ optional :page_token, :string, 3
80
+ end
81
+ add_message "google.cloud.recaptchaenterprise.v1.ListKeysResponse" do
82
+ repeated :keys, :message, 1, "google.cloud.recaptchaenterprise.v1.Key"
83
+ optional :next_page_token, :string, 2
84
+ end
85
+ add_message "google.cloud.recaptchaenterprise.v1.GetKeyRequest" do
86
+ optional :name, :string, 1
87
+ end
88
+ add_message "google.cloud.recaptchaenterprise.v1.UpdateKeyRequest" do
89
+ optional :key, :message, 1, "google.cloud.recaptchaenterprise.v1.Key"
90
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
91
+ end
92
+ add_message "google.cloud.recaptchaenterprise.v1.DeleteKeyRequest" do
93
+ optional :name, :string, 1
94
+ end
95
+ add_message "google.cloud.recaptchaenterprise.v1.Key" do
96
+ optional :name, :string, 1
97
+ optional :display_name, :string, 2
98
+ map :labels, :string, :string, 6
99
+ optional :create_time, :message, 7, "google.protobuf.Timestamp"
100
+ oneof :platform_settings do
101
+ optional :web_settings, :message, 3, "google.cloud.recaptchaenterprise.v1.WebKeySettings"
102
+ optional :android_settings, :message, 4, "google.cloud.recaptchaenterprise.v1.AndroidKeySettings"
103
+ optional :ios_settings, :message, 5, "google.cloud.recaptchaenterprise.v1.IOSKeySettings"
104
+ end
105
+ end
106
+ add_message "google.cloud.recaptchaenterprise.v1.WebKeySettings" do
107
+ optional :allow_all_domains, :bool, 3
108
+ repeated :allowed_domains, :string, 1
109
+ optional :allow_amp_traffic, :bool, 2
110
+ optional :integration_type, :enum, 4, "google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType"
111
+ optional :challenge_security_preference, :enum, 5, "google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference"
112
+ end
113
+ add_enum "google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType" do
114
+ value :INTEGRATION_TYPE_UNSPECIFIED, 0
115
+ value :SCORE, 1
116
+ value :CHECKBOX, 2
117
+ value :INVISIBLE, 3
118
+ end
119
+ add_enum "google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference" do
120
+ value :CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED, 0
121
+ value :USABILITY, 1
122
+ value :BALANCE, 2
123
+ value :SECURITY, 3
124
+ end
125
+ add_message "google.cloud.recaptchaenterprise.v1.AndroidKeySettings" do
126
+ repeated :allowed_package_names, :string, 1
127
+ end
128
+ add_message "google.cloud.recaptchaenterprise.v1.IOSKeySettings" do
129
+ repeated :allowed_bundle_ids, :string, 1
130
+ end
131
+ end
132
+ end
133
+
134
+ module Google
135
+ module Cloud
136
+ module RecaptchaEnterprise
137
+ module V1
138
+ CreateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest").msgclass
139
+ AnnotateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest").msgclass
140
+ AnnotateAssessmentRequest::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation").enummodule
141
+ AnnotateAssessmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse").msgclass
142
+ Assessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Assessment").msgclass
143
+ Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Event").msgclass
144
+ RiskAnalysis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RiskAnalysis").msgclass
145
+ RiskAnalysis::ClassificationReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason").enummodule
146
+ TokenProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TokenProperties").msgclass
147
+ TokenProperties::InvalidReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason").enummodule
148
+ CreateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.CreateKeyRequest").msgclass
149
+ ListKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListKeysRequest").msgclass
150
+ ListKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListKeysResponse").msgclass
151
+ GetKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.GetKeyRequest").msgclass
152
+ UpdateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.UpdateKeyRequest").msgclass
153
+ DeleteKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.DeleteKeyRequest").msgclass
154
+ Key = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Key").msgclass
155
+ WebKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings").msgclass
156
+ WebKeySettings::IntegrationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType").enummodule
157
+ WebKeySettings::ChallengeSecurityPreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference").enummodule
158
+ AndroidKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AndroidKeySettings").msgclass
159
+ IOSKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.IOSKeySettings").msgclass
160
+ end
161
+ end
162
+ end
163
+ end
@@ -0,0 +1,58 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto for package 'Google.Cloud.RecaptchaEnterprise.V1'
3
+ # Original file comments:
4
+ # Copyright 2020 Google LLC
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'grpc'
20
+ require 'google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module RecaptchaEnterprise
25
+ module V1
26
+ module RecaptchaEnterpriseService
27
+ # Service to determine the likelihood an event is legitimate.
28
+ class Service
29
+
30
+ include GRPC::GenericService
31
+
32
+ self.marshal_class_method = :encode
33
+ self.unmarshal_class_method = :decode
34
+ self.service_name = 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService'
35
+
36
+ # Creates an Assessment of the likelihood an event is legitimate.
37
+ rpc :CreateAssessment, Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest, Google::Cloud::RecaptchaEnterprise::V1::Assessment
38
+ # Annotates a previously created Assessment to provide additional information
39
+ # on whether the event turned out to be authentic or fradulent.
40
+ rpc :AnnotateAssessment, Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest, Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse
41
+ # Creates a new reCAPTCHA Enterprise key.
42
+ rpc :CreateKey, Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest, Google::Cloud::RecaptchaEnterprise::V1::Key
43
+ # Returns the list of all keys that belong to a project.
44
+ rpc :ListKeys, Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest, Google::Cloud::RecaptchaEnterprise::V1::ListKeysResponse
45
+ # Returns the specified key.
46
+ rpc :GetKey, Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest, Google::Cloud::RecaptchaEnterprise::V1::Key
47
+ # Updates the specified key.
48
+ rpc :UpdateKey, Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest, Google::Cloud::RecaptchaEnterprise::V1::Key
49
+ # Deletes the specified key.
50
+ rpc :DeleteKey, Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest, Google::Protobuf::Empty
51
+ end
52
+
53
+ Stub = Service.rpc_stub_class
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,4 @@
1
+ # reCAPTCHA Enterprise V1 Protocol Buffer Documentation
2
+
3
+ These files are for the YARD documentation of the generated protobuf files.
4
+ They are not intended to be required or loaded at runtime.
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Api
22
+ # An indicator of the behavior of a given field (for example, that a field
23
+ # is required in requests, or given as output but ignored as input).
24
+ # This **does not** change the behavior in protocol buffers itself; it only
25
+ # denotes the behavior and may affect how API tooling handles the field.
26
+ #
27
+ # Note: This enum **may** receive new values in the future.
28
+ module FieldBehavior
29
+ # Conventional default for enums. Do not use this.
30
+ FIELD_BEHAVIOR_UNSPECIFIED = 0
31
+
32
+ # Specifically denotes a field as optional.
33
+ # While all fields in protocol buffers are optional, this may be specified
34
+ # for emphasis if appropriate.
35
+ OPTIONAL = 1
36
+
37
+ # Denotes a field as required.
38
+ # This indicates that the field **must** be provided as part of the request,
39
+ # and failure to do so will cause an error (usually `INVALID_ARGUMENT`).
40
+ REQUIRED = 2
41
+
42
+ # Denotes a field as output only.
43
+ # This indicates that the field is provided in responses, but including the
44
+ # field in a request does nothing (the server *must* ignore it and
45
+ # *must not* throw an error as a result of the field's presence).
46
+ OUTPUT_ONLY = 3
47
+
48
+ # Denotes a field as input only.
49
+ # This indicates that the field is provided in requests, and the
50
+ # corresponding field is not included in output.
51
+ INPUT_ONLY = 4
52
+
53
+ # Denotes a field as immutable.
54
+ # This indicates that the field may be set once in a request to create a
55
+ # resource, but may not be changed thereafter.
56
+ IMMUTABLE = 5
57
+ end
58
+ end
59
+ end