@@ -18,6 +18,9 @@ syntax = "proto3";
18
18
package google.cloud.recaptchaenterprise.v1beta1 ;
19
19
20
20
import "google/api/annotations.proto" ;
21
+ import "google/api/client.proto" ;
22
+ import "google/api/field_behavior.proto" ;
23
+ import "google/api/resource.proto" ;
21
24
import "google/protobuf/timestamp.proto" ;
22
25
23
26
option csharp_namespace = "Google.Cloud.RecaptchaEnterprise.V1Beta1" ;
@@ -28,15 +31,18 @@ option java_package = "com.google.recaptchaenterprise.v1beta1";
28
31
option objc_class_prefix = "GCRE" ;
29
32
option php_namespace = "Google\\Cloud\\RecaptchaEnterprise\\V1beta1" ;
30
33
31
-
32
34
// Service to determine the likelihood an event is legitimate.
33
35
service RecaptchaEnterpriseServiceV1Beta1 {
36
+ option (google.api.default_host ) = "recaptchaenterprise.googleapis.com" ;
37
+ option (google.api.oauth_scopes ) = "https://www.googleapis.com/auth/cloud-platform" ;
38
+
34
39
// Creates an Assessment of the likelihood an event is legitimate.
35
40
rpc CreateAssessment (CreateAssessmentRequest ) returns (Assessment ) {
36
41
option (google.api.http ) = {
37
42
post : "/v1beta1/{parent=projects/*}/assessments"
38
43
body : "assessment"
39
44
};
45
+ option (google.api.method_signature ) = "parent,assessment" ;
40
46
}
41
47
42
48
// Annotates a previously created Assessment to provide additional information
@@ -46,17 +52,23 @@ service RecaptchaEnterpriseServiceV1Beta1 {
46
52
post : "/v1beta1/{name=projects/*/assessments/*}:annotate"
47
53
body : "*"
48
54
};
55
+ option (google.api.method_signature ) = "name,annotation" ;
49
56
}
50
57
}
51
58
52
59
// The create assessment request message.
53
60
message CreateAssessmentRequest {
54
61
// Required. The name of the project in which the assessment will be created,
55
62
// in the format "projects/{project_number}".
56
- string parent = 1 ;
57
-
58
- // The asessment details.
59
- Assessment assessment = 2 ;
63
+ string parent = 1 [
64
+ (google.api.field_behavior ) = REQUIRED ,
65
+ (google.api.resource_reference ) = {
66
+ type : "cloudresourcemanager.googleapis.com/Project"
67
+ }
68
+ ];
69
+
70
+ // Required. The assessment details.
71
+ Assessment assessment = 2 [(google.api.field_behavior ) = REQUIRED ];
60
72
}
61
73
62
74
// The request message to annotate an Assessment.
@@ -75,10 +87,15 @@ message AnnotateAssessmentRequest {
75
87
76
88
// Required. The resource name of the Assessment, in the format
77
89
// "projects/{project_number}/assessments/{assessment_id}".
78
- string name = 1 ;
79
-
80
- // The annotation that will be assigned to the Event.
81
- Annotation annotation = 2 ;
90
+ string name = 1 [
91
+ (google.api.field_behavior ) = REQUIRED ,
92
+ (google.api.resource_reference ) = {
93
+ type : "recaptchaenterprise.googleapis.com/Assessment"
94
+ }
95
+ ];
96
+
97
+ // Required. The annotation that will be assigned to the Event.
98
+ Annotation annotation = 2 [(google.api.field_behavior ) = REQUIRED ];
82
99
}
83
100
84
101
// Empty response for AnnotateAssessment.
@@ -88,57 +105,66 @@ message AnnotateAssessmentResponse {
88
105
89
106
// A recaptcha assessment resource.
90
107
message Assessment {
108
+ option (google.api.resource ) = {
109
+ type : "recaptchaenterprise.googleapis.com/Assessment"
110
+ pattern : "projects/{project}/assessments/{assessment}"
111
+ };
112
+
91
113
// LINT.IfChange(classification_reason)
92
114
// Reasons contributing to the risk analysis verdict.
93
115
enum ClassificationReason {
94
116
// Default unspecified type.
95
117
CLASSIFICATION_REASON_UNSPECIFIED = 0 ;
96
118
97
- // The event appeared to be automated.
119
+ // Interactions matched the behavior of an automated agent .
98
120
AUTOMATION = 1 ;
99
121
100
- // The event was not made from the proper context on the real site .
122
+ // The event originated from an illegitimate environment .
101
123
UNEXPECTED_ENVIRONMENT = 2 ;
102
124
103
- // Browsing behavior leading up to the event was generated was out of the
104
- // ordinary.
125
+ // Traffic volume from the event source is higher than normal.
126
+ TOO_MUCH_TRAFFIC = 3 ;
127
+
128
+ // Interactions with the site were significantly different than expected
129
+ // patterns.
105
130
UNEXPECTED_USAGE_PATTERNS = 4 ;
106
131
107
132
// Too little traffic has been received from this site thus far to generate
108
133
// quality risk analysis.
109
- PROVISIONAL_RISK_ANALYSIS = 5 ;
134
+ LOW_CONFIDENCE_SCORE = 5 ;
110
135
}
111
136
112
137
// Output only. The resource name for the Assessment in the format
113
138
// "projects/{project_number}/assessments/{assessment_id}".
114
- string name = 1 ;
139
+ string name = 1 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
115
140
116
141
// The event being assessed.
117
142
Event event = 2 ;
118
143
119
144
// Output only. Legitimate event score from 0.0 to 1.0.
120
145
// (1.0 means very likely legitimate traffic while 0.0 means very likely
121
146
// non-legitimate traffic).
122
- float score = 3 ;
147
+ float score = 3 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
123
148
124
149
// Output only. Properties of the provided event token.
125
- TokenProperties token_properties = 4 ;
150
+ TokenProperties token_properties = 4 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
126
151
127
152
// Output only. Reasons contributing to the risk analysis verdict.
128
- repeated ClassificationReason reasons = 5 ;
153
+ repeated ClassificationReason reasons = 5 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
129
154
}
130
155
131
156
message Event {
132
- // The user response token provided by the reCAPTCHA client-side integration
157
+ // Required. The user response token provided by the reCAPTCHA client-side integration
133
158
// on your site.
134
- string token = 1 ;
159
+ string token = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
135
160
136
- // The site key that was used to invoke reCAPTCHA on your site and generate
161
+ // Required. The site key that was used to invoke reCAPTCHA on your site and generate
137
162
// the token.
138
- string site_key = 2 ;
163
+ string site_key = 2 [ (google.api .field_behavior ) = REQUIRED ] ;
139
164
}
140
165
141
166
message TokenProperties {
167
+ // LINT.IfChange
142
168
// Enum that represents the types of invalid token reasons.
143
169
enum InvalidReason {
144
170
// Default unspecified type.
@@ -156,7 +182,7 @@ message TokenProperties {
156
182
// The user verification had already been seen.
157
183
DUPE = 4 ;
158
184
159
- // The user verification token did not match the provided site secret .
185
+ // The user verification token did not match the provided site key .
160
186
// This may be a configuration error (e.g. development keys used in
161
187
// production) or end users trying to use verification tokens from other
162
188
// sites.
@@ -166,18 +192,18 @@ message TokenProperties {
166
192
MISSING = 6 ;
167
193
}
168
194
169
- // Output only. Whether the provided user response token is valid.
195
+ // Whether the provided user response token is valid.
170
196
bool valid = 1 ;
171
197
172
- // Output only. Reason associated with the response when valid = false.
198
+ // Reason associated with the response when valid = false.
173
199
InvalidReason invalid_reason = 2 ;
174
200
175
- // Output only. The timestamp corresponding to the generation of the token.
201
+ // The timestamp corresponding to the generation of the token.
176
202
google.protobuf.Timestamp create_time = 3 ;
177
203
178
- // Output only. The hostname of the page on which the token was generated.
204
+ // The hostname of the page on which the token was generated.
179
205
string hostname = 4 ;
180
206
181
- // Output only. Action name provided at token generation.
207
+ // Action name provided at token generation.
182
208
string action = 5 ;
183
209
}
0 commit comments