recaptchaenterprise.proto 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.recaptchaenterprise.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/protobuf/empty.proto";
  21. import "google/protobuf/field_mask.proto";
  22. import "google/protobuf/timestamp.proto";
  23. option csharp_namespace = "Google.Cloud.RecaptchaEnterprise.V1";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1;recaptchaenterprise";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "RecaptchaEnterpriseProto";
  27. option java_package = "com.google.recaptchaenterprise.v1";
  28. option objc_class_prefix = "GCRE";
  29. option php_namespace = "Google\\Cloud\\RecaptchaEnterprise\\V1";
  30. option ruby_package = "Google::Cloud::RecaptchaEnterprise::V1";
  31. // Service to determine the likelihood an event is legitimate.
  32. service RecaptchaEnterpriseService {
  33. option (google.api.default_host) = "recaptchaenterprise.googleapis.com";
  34. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  35. // Creates an Assessment of the likelihood an event is legitimate.
  36. rpc CreateAssessment(CreateAssessmentRequest) returns (Assessment) {
  37. option (google.api.http) = {
  38. post: "/v1/{parent=projects/*}/assessments"
  39. body: "assessment"
  40. };
  41. option (google.api.method_signature) = "parent,assessment";
  42. }
  43. // Annotates a previously created Assessment to provide additional information
  44. // on whether the event turned out to be authentic or fraudulent.
  45. rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) {
  46. option (google.api.http) = {
  47. post: "/v1/{name=projects/*/assessments/*}:annotate"
  48. body: "*"
  49. };
  50. option (google.api.method_signature) = "name,annotation";
  51. }
  52. // Creates a new reCAPTCHA Enterprise key.
  53. rpc CreateKey(CreateKeyRequest) returns (Key) {
  54. option (google.api.http) = {
  55. post: "/v1/{parent=projects/*}/keys"
  56. body: "key"
  57. };
  58. }
  59. // Returns the list of all keys that belong to a project.
  60. rpc ListKeys(ListKeysRequest) returns (ListKeysResponse) {
  61. option (google.api.http) = {
  62. get: "/v1/{parent=projects/*}/keys"
  63. };
  64. }
  65. // Returns the secret key related to the specified public key.
  66. // You must use the legacy secret key only in a 3rd party integration with
  67. // legacy reCAPTCHA.
  68. rpc RetrieveLegacySecretKey(RetrieveLegacySecretKeyRequest) returns (RetrieveLegacySecretKeyResponse) {
  69. option (google.api.http) = {
  70. get: "/v1/{key=projects/*/keys/*}:retrieveLegacySecretKey"
  71. };
  72. option (google.api.method_signature) = "key";
  73. }
  74. // Returns the specified key.
  75. rpc GetKey(GetKeyRequest) returns (Key) {
  76. option (google.api.http) = {
  77. get: "/v1/{name=projects/*/keys/*}"
  78. };
  79. }
  80. // Updates the specified key.
  81. rpc UpdateKey(UpdateKeyRequest) returns (Key) {
  82. option (google.api.http) = {
  83. patch: "/v1/{key.name=projects/*/keys/*}"
  84. body: "key"
  85. };
  86. }
  87. // Deletes the specified key.
  88. rpc DeleteKey(DeleteKeyRequest) returns (google.protobuf.Empty) {
  89. option (google.api.http) = {
  90. delete: "/v1/{name=projects/*/keys/*}"
  91. };
  92. }
  93. // Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
  94. // Once a key is migrated, it can be used from either product. SiteVerify
  95. // requests are billed as CreateAssessment calls. You must be
  96. // authenticated as one of the current owners of the reCAPTCHA Site Key, and
  97. // your user must have the reCAPTCHA Enterprise Admin IAM role in the
  98. // destination project.
  99. rpc MigrateKey(MigrateKeyRequest) returns (Key) {
  100. option (google.api.http) = {
  101. post: "/v1/{name=projects/*/keys/*}:migrate"
  102. body: "*"
  103. };
  104. }
  105. // Get some aggregated metrics for a Key. This data can be used to build
  106. // dashboards.
  107. rpc GetMetrics(GetMetricsRequest) returns (Metrics) {
  108. option (google.api.http) = {
  109. get: "/v1/{name=projects/*/keys/*/metrics}"
  110. };
  111. option (google.api.method_signature) = "name";
  112. }
  113. // List groups of related accounts.
  114. rpc ListRelatedAccountGroups(ListRelatedAccountGroupsRequest) returns (ListRelatedAccountGroupsResponse) {
  115. option (google.api.http) = {
  116. get: "/v1/{parent=projects/*}/relatedaccountgroups"
  117. };
  118. option (google.api.method_signature) = "parent";
  119. }
  120. // Get memberships in a group of related accounts.
  121. rpc ListRelatedAccountGroupMemberships(ListRelatedAccountGroupMembershipsRequest) returns (ListRelatedAccountGroupMembershipsResponse) {
  122. option (google.api.http) = {
  123. get: "/v1/{parent=projects/*/relatedaccountgroups/*}/memberships"
  124. };
  125. option (google.api.method_signature) = "parent";
  126. }
  127. // Search group memberships related to a given account.
  128. rpc SearchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest) returns (SearchRelatedAccountGroupMembershipsResponse) {
  129. option (google.api.http) = {
  130. post: "/v1/{project=projects/*}/relatedaccountgroupmemberships:search"
  131. body: "*"
  132. };
  133. option (google.api.method_signature) = "project,hashed_account_id";
  134. }
  135. }
  136. // The create assessment request message.
  137. message CreateAssessmentRequest {
  138. // Required. The name of the project in which the assessment will be created,
  139. // in the format "projects/{project}".
  140. string parent = 1 [
  141. (google.api.field_behavior) = REQUIRED,
  142. (google.api.resource_reference) = {
  143. type: "cloudresourcemanager.googleapis.com/Project"
  144. }
  145. ];
  146. // Required. The assessment details.
  147. Assessment assessment = 2 [(google.api.field_behavior) = REQUIRED];
  148. }
  149. // The request message to annotate an Assessment.
  150. message AnnotateAssessmentRequest {
  151. // Enum that represents the types of annotations.
  152. enum Annotation {
  153. // Default unspecified type.
  154. ANNOTATION_UNSPECIFIED = 0;
  155. // Provides information that the event turned out to be legitimate.
  156. LEGITIMATE = 1;
  157. // Provides information that the event turned out to be fraudulent.
  158. FRAUDULENT = 2;
  159. // Provides information that the event was related to a login event in which
  160. // the user typed the correct password. Deprecated, prefer indicating
  161. // CORRECT_PASSWORD through the reasons field instead.
  162. PASSWORD_CORRECT = 3 [deprecated = true];
  163. // Provides information that the event was related to a login event in which
  164. // the user typed the incorrect password. Deprecated, prefer indicating
  165. // INCORRECT_PASSWORD through the reasons field instead.
  166. PASSWORD_INCORRECT = 4 [deprecated = true];
  167. }
  168. // Enum that represents potential reasons for annotating an assessment.
  169. enum Reason {
  170. // Default unspecified reason.
  171. REASON_UNSPECIFIED = 0;
  172. // Indicates that the transaction had a chargeback issued with no other
  173. // details. When possible, specify the type by using CHARGEBACK_FRAUD or
  174. // CHARGEBACK_DISPUTE instead.
  175. CHARGEBACK = 1;
  176. // Indicates that the transaction had a chargeback issued related to an
  177. // alleged unauthorized transaction from the cardholder's perspective (for
  178. // example, the card number was stolen).
  179. CHARGEBACK_FRAUD = 8;
  180. // Indicates that the transaction had a chargeback issued related to the
  181. // cardholder having provided their card details but allegedly not being
  182. // satisfied with the purchase (for example, misrepresentation, attempted
  183. // cancellation).
  184. CHARGEBACK_DISPUTE = 9;
  185. // Indicates that the completed payment transaction was refunded by the
  186. // seller.
  187. REFUND = 10;
  188. // Indicates that the completed payment transaction was determined to be
  189. // fraudulent by the seller, and was cancelled and refunded as a result.
  190. REFUND_FRAUD = 11;
  191. // Indicates that the payment transaction was accepted, and the user was
  192. // charged.
  193. TRANSACTION_ACCEPTED = 12;
  194. // Indicates that the payment transaction was declined, for example due to
  195. // invalid card details.
  196. TRANSACTION_DECLINED = 13;
  197. // Indicates the transaction associated with the assessment is suspected of
  198. // being fraudulent based on the payment method, billing details, shipping
  199. // address or other transaction information.
  200. PAYMENT_HEURISTICS = 2;
  201. // Indicates that the user was served a 2FA challenge. An old assessment
  202. // with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been
  203. // overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow.
  204. // This is equivalent to `FAILED_TWO_FACTOR`.
  205. INITIATED_TWO_FACTOR = 7;
  206. // Indicates that the user passed a 2FA challenge.
  207. PASSED_TWO_FACTOR = 3;
  208. // Indicates that the user failed a 2FA challenge.
  209. FAILED_TWO_FACTOR = 4;
  210. // Indicates the user provided the correct password.
  211. CORRECT_PASSWORD = 5;
  212. // Indicates the user provided an incorrect password.
  213. INCORRECT_PASSWORD = 6;
  214. // Indicates that the user sent unwanted and abusive messages to other users
  215. // of the platform, such as spam, scams, phishing, or social engineering.
  216. SOCIAL_SPAM = 14;
  217. }
  218. // Required. The resource name of the Assessment, in the format
  219. // "projects/{project}/assessments/{assessment}".
  220. string name = 1 [
  221. (google.api.field_behavior) = REQUIRED,
  222. (google.api.resource_reference) = {
  223. type: "recaptchaenterprise.googleapis.com/Assessment"
  224. }
  225. ];
  226. // Optional. The annotation that will be assigned to the Event. This field can be left
  227. // empty to provide reasons that apply to an event without concluding whether
  228. // the event is legitimate or fraudulent.
  229. Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL];
  230. // Optional. Optional reasons for the annotation that will be assigned to the Event.
  231. repeated Reason reasons = 3 [(google.api.field_behavior) = OPTIONAL];
  232. // Optional. Unique stable hashed user identifier to apply to the assessment.
  233. // This is an alternative to setting the hashed_account_id in
  234. // CreateAssessment, for example when the account identifier is not yet known
  235. // in the initial request. It is recommended that the identifier is hashed
  236. // using hmac-sha256 with stable secret.
  237. bytes hashed_account_id = 4 [(google.api.field_behavior) = OPTIONAL];
  238. }
  239. // Empty response for AnnotateAssessment.
  240. message AnnotateAssessmentResponse {
  241. }
  242. // Private password leak verification info.
  243. message PrivatePasswordLeakVerification {
  244. // Optional. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized username. It
  245. // is used to look up password leaks associated with that hash prefix.
  246. bytes lookup_hash_prefix = 1 [(google.api.field_behavior) = OPTIONAL];
  247. // Optional. Encrypted Scrypt hash of the canonicalized username+password. It is
  248. // re-encrypted by the server and returned through
  249. // `reencrypted_user_credentials_hash`.
  250. bytes encrypted_user_credentials_hash = 2 [(google.api.field_behavior) = OPTIONAL];
  251. // Output only. List of prefixes of the encrypted potential password leaks that matched the
  252. // given parameters. They must be compared with the client-side decryption
  253. // prefix of `reencrypted_user_credentials_hash`
  254. repeated bytes encrypted_leak_match_prefixes = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  255. // Output only. Corresponds to the re-encryption of the `encrypted_user_credentials_hash`
  256. // field. It is used to match potential password leaks within
  257. // `encrypted_leak_match_prefixes`.
  258. bytes reencrypted_user_credentials_hash = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  259. }
  260. // A recaptcha assessment resource.
  261. message Assessment {
  262. option (google.api.resource) = {
  263. type: "recaptchaenterprise.googleapis.com/Assessment"
  264. pattern: "projects/{project}/assessments/{assessment}"
  265. };
  266. // Output only. The resource name for the Assessment in the format
  267. // "projects/{project}/assessments/{assessment}".
  268. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  269. // The event being assessed.
  270. Event event = 2;
  271. // Output only. The risk analysis result for the event being assessed.
  272. RiskAnalysis risk_analysis = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  273. // Output only. Properties of the provided event token.
  274. TokenProperties token_properties = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  275. // Assessment returned by account defender when a hashed_account_id is
  276. // provided.
  277. AccountDefenderAssessment account_defender_assessment = 6;
  278. // The private password leak verification field contains the parameters that
  279. // are used to to check for leaks privately without sharing user credentials.
  280. PrivatePasswordLeakVerification private_password_leak_verification = 8;
  281. }
  282. message Event {
  283. // Optional. The user response token provided by the reCAPTCHA client-side integration
  284. // on your site.
  285. string token = 1 [(google.api.field_behavior) = OPTIONAL];
  286. // Optional. The site key that was used to invoke reCAPTCHA on your site and generate
  287. // the token.
  288. string site_key = 2 [(google.api.field_behavior) = OPTIONAL];
  289. // Optional. The user agent present in the request from the user's device related to
  290. // this event.
  291. string user_agent = 3 [(google.api.field_behavior) = OPTIONAL];
  292. // Optional. The IP address in the request from the user's device related to this event.
  293. string user_ip_address = 4 [(google.api.field_behavior) = OPTIONAL];
  294. // Optional. The expected action for this type of event. This should be the same action
  295. // provided at token generation time on client-side platforms already
  296. // integrated with recaptcha enterprise.
  297. string expected_action = 5 [(google.api.field_behavior) = OPTIONAL];
  298. // Optional. Unique stable hashed user identifier for the request. The identifier must
  299. // be hashed using hmac-sha256 with stable secret.
  300. bytes hashed_account_id = 6 [(google.api.field_behavior) = OPTIONAL];
  301. }
  302. // Risk analysis result for an event.
  303. message RiskAnalysis {
  304. // Reasons contributing to the risk analysis verdict.
  305. enum ClassificationReason {
  306. // Default unspecified type.
  307. CLASSIFICATION_REASON_UNSPECIFIED = 0;
  308. // Interactions matched the behavior of an automated agent.
  309. AUTOMATION = 1;
  310. // The event originated from an illegitimate environment.
  311. UNEXPECTED_ENVIRONMENT = 2;
  312. // Traffic volume from the event source is higher than normal.
  313. TOO_MUCH_TRAFFIC = 3;
  314. // Interactions with the site were significantly different than expected
  315. // patterns.
  316. UNEXPECTED_USAGE_PATTERNS = 4;
  317. // Too little traffic has been received from this site thus far to generate
  318. // quality risk analysis.
  319. LOW_CONFIDENCE_SCORE = 5;
  320. }
  321. // Legitimate event score from 0.0 to 1.0.
  322. // (1.0 means very likely legitimate traffic while 0.0 means very likely
  323. // non-legitimate traffic).
  324. float score = 1;
  325. // Reasons contributing to the risk analysis verdict.
  326. repeated ClassificationReason reasons = 2;
  327. }
  328. message TokenProperties {
  329. // Enum that represents the types of invalid token reasons.
  330. enum InvalidReason {
  331. // Default unspecified type.
  332. INVALID_REASON_UNSPECIFIED = 0;
  333. // If the failure reason was not accounted for.
  334. UNKNOWN_INVALID_REASON = 1;
  335. // The provided user verification token was malformed.
  336. MALFORMED = 2;
  337. // The user verification token had expired.
  338. EXPIRED = 3;
  339. // The user verification had already been seen.
  340. DUPE = 4;
  341. // The user verification token was not present.
  342. MISSING = 5;
  343. // A retriable error (such as network failure) occurred on the browser.
  344. // Could easily be simulated by an attacker.
  345. BROWSER_ERROR = 6;
  346. }
  347. // Whether the provided user response token is valid. When valid = false, the
  348. // reason could be specified in invalid_reason or it could also be due to
  349. // a user failing to solve a challenge or a sitekey mismatch (i.e the sitekey
  350. // used to generate the token was different than the one specified in the
  351. // assessment).
  352. bool valid = 1;
  353. // Reason associated with the response when valid = false.
  354. InvalidReason invalid_reason = 2;
  355. // The timestamp corresponding to the generation of the token.
  356. google.protobuf.Timestamp create_time = 3;
  357. // The hostname of the page on which the token was generated (Web keys only).
  358. string hostname = 4;
  359. // Action name provided at token generation.
  360. string action = 5;
  361. }
  362. // Account defender risk assessment.
  363. message AccountDefenderAssessment {
  364. // Labels returned by account defender for this request.
  365. enum AccountDefenderLabel {
  366. // Default unspecified type.
  367. ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0;
  368. // The request matches a known good profile for the user.
  369. PROFILE_MATCH = 1;
  370. // The request is potentially a suspicious login event and must be further
  371. // verified either through multi-factor authentication or another system.
  372. SUSPICIOUS_LOGIN_ACTIVITY = 2;
  373. // The request matched a profile that previously had suspicious account
  374. // creation behavior. This can mean that this is a fake account.
  375. SUSPICIOUS_ACCOUNT_CREATION = 3;
  376. // The account in the request has a high number of related accounts. It does
  377. // not necessarily imply that the account is bad but can require further
  378. // investigation.
  379. RELATED_ACCOUNTS_NUMBER_HIGH = 4;
  380. }
  381. // Labels for this request.
  382. repeated AccountDefenderLabel labels = 1;
  383. }
  384. // The create key request message.
  385. message CreateKeyRequest {
  386. // Required. The name of the project in which the key will be created, in the
  387. // format "projects/{project}".
  388. string parent = 1 [
  389. (google.api.field_behavior) = REQUIRED,
  390. (google.api.resource_reference) = {
  391. type: "cloudresourcemanager.googleapis.com/Project"
  392. }
  393. ];
  394. // Required. Information to create a reCAPTCHA Enterprise key.
  395. Key key = 2 [(google.api.field_behavior) = REQUIRED];
  396. }
  397. // The list keys request message.
  398. message ListKeysRequest {
  399. // Required. The name of the project that contains the keys that will be
  400. // listed, in the format "projects/{project}".
  401. string parent = 1 [
  402. (google.api.field_behavior) = REQUIRED,
  403. (google.api.resource_reference) = {
  404. type: "cloudresourcemanager.googleapis.com/Project"
  405. }
  406. ];
  407. // Optional. The maximum number of keys to return. Default is 10. Max limit is
  408. // 1000.
  409. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  410. // Optional. The next_page_token value returned from a previous.
  411. // ListKeysRequest, if any.
  412. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  413. }
  414. // Response to request to list keys in a project.
  415. message ListKeysResponse {
  416. // Key details.
  417. repeated Key keys = 1;
  418. // Token to retrieve the next page of results. It is set to empty if no keys
  419. // remain in results.
  420. string next_page_token = 2;
  421. }
  422. // The retrieve legacy secret key request message.
  423. message RetrieveLegacySecretKeyRequest {
  424. // Required. The public key name linked to the requested secret key in the format
  425. // "projects/{project}/keys/{key}".
  426. string key = 1 [
  427. (google.api.field_behavior) = REQUIRED,
  428. (google.api.resource_reference) = {
  429. type: "recaptchaenterprise.googleapis.com/Key"
  430. }
  431. ];
  432. }
  433. // The get key request message.
  434. message GetKeyRequest {
  435. // Required. The name of the requested key, in the format
  436. // "projects/{project}/keys/{key}".
  437. string name = 1 [
  438. (google.api.field_behavior) = REQUIRED,
  439. (google.api.resource_reference) = {
  440. type: "recaptchaenterprise.googleapis.com/Key"
  441. }
  442. ];
  443. }
  444. // The update key request message.
  445. message UpdateKeyRequest {
  446. // Required. The key to update.
  447. Key key = 1 [(google.api.field_behavior) = REQUIRED];
  448. // Optional. The mask to control which fields of the key get updated. If the mask is not
  449. // present, all fields will be updated.
  450. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
  451. }
  452. // The delete key request message.
  453. message DeleteKeyRequest {
  454. // Required. The name of the key to be deleted, in the format
  455. // "projects/{project}/keys/{key}".
  456. string name = 1 [
  457. (google.api.field_behavior) = REQUIRED,
  458. (google.api.resource_reference) = {
  459. type: "recaptchaenterprise.googleapis.com/Key"
  460. }
  461. ];
  462. }
  463. // The migrate key request message.
  464. message MigrateKeyRequest {
  465. // Required. The name of the key to be migrated, in the format
  466. // "projects/{project}/keys/{key}".
  467. string name = 1 [
  468. (google.api.field_behavior) = REQUIRED,
  469. (google.api.resource_reference) = {
  470. type: "recaptchaenterprise.googleapis.com/Key"
  471. }
  472. ];
  473. }
  474. // The get metrics request message.
  475. message GetMetricsRequest {
  476. // Required. The name of the requested metrics, in the format
  477. // "projects/{project}/keys/{key}/metrics".
  478. string name = 1 [
  479. (google.api.field_behavior) = REQUIRED,
  480. (google.api.resource_reference) = {
  481. type: "recaptchaenterprise.googleapis.com/Metrics"
  482. }
  483. ];
  484. }
  485. // Metrics for a single Key.
  486. message Metrics {
  487. option (google.api.resource) = {
  488. type: "recaptchaenterprise.googleapis.com/Metrics"
  489. pattern: "projects/{project}/keys/{key}/metrics"
  490. };
  491. // Output only. The name of the metrics, in the format
  492. // "projects/{project}/keys/{key}/metrics".
  493. string name = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  494. // Inclusive start time aligned to a day (UTC).
  495. google.protobuf.Timestamp start_time = 1;
  496. // Metrics will be continuous and in order by dates, and in the granularity
  497. // of day. All Key types should have score-based data.
  498. repeated ScoreMetrics score_metrics = 2;
  499. // Metrics will be continuous and in order by dates, and in the granularity
  500. // of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
  501. // challenge-based data.
  502. repeated ChallengeMetrics challenge_metrics = 3;
  503. }
  504. // Secret key is used only in legacy reCAPTCHA. It must be used in a 3rd party
  505. // integration with legacy reCAPTCHA.
  506. message RetrieveLegacySecretKeyResponse {
  507. // The secret key (also known as shared secret) authorizes communication
  508. // between your application backend and the reCAPTCHA Enterprise server to
  509. // create an assessment.
  510. // The secret key needs to be kept safe for security purposes.
  511. string legacy_secret_key = 1;
  512. }
  513. // A key used to identify and configure applications (web and/or mobile) that
  514. // use reCAPTCHA Enterprise.
  515. message Key {
  516. option (google.api.resource) = {
  517. type: "recaptchaenterprise.googleapis.com/Key"
  518. pattern: "projects/{project}/keys/{key}"
  519. };
  520. // The resource name for the Key in the format
  521. // "projects/{project}/keys/{key}".
  522. string name = 1;
  523. // Human-readable display name of this key. Modifiable by user.
  524. string display_name = 2;
  525. // Platform specific settings for this key. The key can only be used on a
  526. // platform for which the settings are enabled.
  527. oneof platform_settings {
  528. // Settings for keys that can be used by websites.
  529. WebKeySettings web_settings = 3;
  530. // Settings for keys that can be used by Android apps.
  531. AndroidKeySettings android_settings = 4;
  532. // Settings for keys that can be used by iOS apps.
  533. IOSKeySettings ios_settings = 5;
  534. }
  535. // See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
  536. // Creating and managing labels</a>.
  537. map<string, string> labels = 6;
  538. // The timestamp corresponding to the creation of this Key.
  539. google.protobuf.Timestamp create_time = 7;
  540. // Options for user acceptance testing.
  541. TestingOptions testing_options = 9;
  542. // Settings for WAF
  543. WafSettings waf_settings = 10;
  544. }
  545. // Options for user acceptance testing.
  546. message TestingOptions {
  547. // Enum that represents the challenge option for challenge-based (CHECKBOX,
  548. // INVISIBLE) testing keys.
  549. enum TestingChallenge {
  550. // Perform the normal risk analysis and return either nocaptcha or a
  551. // challenge depending on risk and trust factors.
  552. TESTING_CHALLENGE_UNSPECIFIED = 0;
  553. // Challenge requests for this key always return a nocaptcha, which
  554. // does not require a solution.
  555. NOCAPTCHA = 1;
  556. // Challenge requests for this key always return an unsolvable
  557. // challenge.
  558. UNSOLVABLE_CHALLENGE = 2;
  559. }
  560. // All assessments for this Key will return this score. Must be between 0
  561. // (likely not legitimate) and 1 (likely legitimate) inclusive.
  562. float testing_score = 1;
  563. // For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
  564. // for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
  565. // challenge if CHALLENGE.
  566. TestingChallenge testing_challenge = 2;
  567. }
  568. // Settings specific to keys that can be used by websites.
  569. message WebKeySettings {
  570. // Enum that represents the integration types for web keys.
  571. enum IntegrationType {
  572. // Default type that indicates this enum hasn't been specified. This is not
  573. // a valid IntegrationType, one of the other types must be specified
  574. // instead.
  575. INTEGRATION_TYPE_UNSPECIFIED = 0;
  576. // Only used to produce scores. It doesn't display the "I'm not a robot"
  577. // checkbox and never shows captcha challenges.
  578. SCORE = 1;
  579. // Displays the "I'm not a robot" checkbox and may show captcha challenges
  580. // after it is checked.
  581. CHECKBOX = 2;
  582. // Doesn't display the "I'm not a robot" checkbox, but may show captcha
  583. // challenges after risk analysis.
  584. INVISIBLE = 3;
  585. }
  586. // Enum that represents the possible challenge frequency and difficulty
  587. // configurations for a web key.
  588. enum ChallengeSecurityPreference {
  589. // Default type that indicates this enum hasn't been specified.
  590. CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0;
  591. // Key tends to show fewer and easier challenges.
  592. USABILITY = 1;
  593. // Key tends to show balanced (in amount and difficulty) challenges.
  594. BALANCE = 2;
  595. // Key tends to show more and harder challenges.
  596. SECURITY = 3;
  597. }
  598. // If set to true, it means allowed_domains will not be enforced.
  599. bool allow_all_domains = 3;
  600. // Domains or subdomains of websites allowed to use the key. All subdomains
  601. // of an allowed domain are automatically allowed. A valid domain requires a
  602. // host and must not include any path, port, query or fragment.
  603. // Examples: 'example.com' or 'subdomain.example.com'
  604. repeated string allowed_domains = 1;
  605. // If set to true, the key can be used on AMP (Accelerated Mobile Pages)
  606. // websites. This is supported only for the SCORE integration type.
  607. bool allow_amp_traffic = 2;
  608. // Required. Describes how this key is integrated with the website.
  609. IntegrationType integration_type = 4 [(google.api.field_behavior) = REQUIRED];
  610. // Settings for the frequency and difficulty at which this key triggers
  611. // captcha challenges. This should only be specified for IntegrationTypes
  612. // CHECKBOX and INVISIBLE.
  613. ChallengeSecurityPreference challenge_security_preference = 5;
  614. }
  615. // Settings specific to keys that can be used by Android apps.
  616. message AndroidKeySettings {
  617. // If set to true, allowed_package_names are not enforced.
  618. bool allow_all_package_names = 2;
  619. // Android package names of apps allowed to use the key.
  620. // Example: 'com.companyname.appname'
  621. repeated string allowed_package_names = 1;
  622. }
  623. // Settings specific to keys that can be used by iOS apps.
  624. message IOSKeySettings {
  625. // If set to true, allowed_bundle_ids are not enforced.
  626. bool allow_all_bundle_ids = 2;
  627. // iOS bundle ids of apps allowed to use the key.
  628. // Example: 'com.companyname.productname.appname'
  629. repeated string allowed_bundle_ids = 1;
  630. }
  631. // Score distribution.
  632. message ScoreDistribution {
  633. // Map key is score value multiplied by 100. The scores are discrete values
  634. // between [0, 1]. The maximum number of buckets is on order of a few dozen,
  635. // but typically much lower (ie. 10).
  636. map<int32, int64> score_buckets = 1;
  637. }
  638. // Metrics related to scoring.
  639. message ScoreMetrics {
  640. // Aggregated score metrics for all traffic.
  641. ScoreDistribution overall_metrics = 1;
  642. // Action-based metrics. The map key is the action name which specified by the
  643. // site owners at time of the "execute" client-side call.
  644. // Populated only for SCORE keys.
  645. map<string, ScoreDistribution> action_metrics = 2;
  646. }
  647. // Metrics related to challenges.
  648. message ChallengeMetrics {
  649. // Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent
  650. // to a count of pageloads for pages that include reCAPTCHA.
  651. int64 pageload_count = 1;
  652. // Count of nocaptchas (successful verification without a challenge) issued.
  653. int64 nocaptcha_count = 2;
  654. // Count of submitted challenge solutions that were incorrect or otherwise
  655. // deemed suspicious such that a subsequent challenge was triggered.
  656. int64 failed_count = 3;
  657. // Count of nocaptchas (successful verification without a challenge) plus
  658. // submitted challenge solutions that were correct and resulted in
  659. // verification.
  660. int64 passed_count = 4;
  661. }
  662. // The request message to list memberships in a related account group.
  663. message ListRelatedAccountGroupMembershipsRequest {
  664. // Required. The resource name for the related account group in the format
  665. // `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`.
  666. string parent = 1 [
  667. (google.api.field_behavior) = REQUIRED,
  668. (google.api.resource_reference) = {
  669. child_type: "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership"
  670. }
  671. ];
  672. // Optional. The maximum number of accounts to return. The service might return fewer
  673. // than this value.
  674. // If unspecified, at most 50 accounts are returned.
  675. // The maximum value is 1000; values above 1000 are coerced to 1000.
  676. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  677. // Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships`
  678. // call.
  679. //
  680. // When paginating, all other parameters provided to
  681. // `ListRelatedAccountGroupMemberships` must match the call that provided the
  682. // page token.
  683. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  684. }
  685. // The response to a `ListRelatedAccountGroupMemberships` call.
  686. message ListRelatedAccountGroupMembershipsResponse {
  687. // The memberships listed by the query.
  688. repeated RelatedAccountGroupMembership related_account_group_memberships = 1;
  689. // A token, which can be sent as `page_token` to retrieve the next page.
  690. // If this field is omitted, there are no subsequent pages.
  691. string next_page_token = 2;
  692. }
  693. // The request message to list related account groups.
  694. message ListRelatedAccountGroupsRequest {
  695. // Required. The name of the project to list related account groups from, in the format
  696. // "projects/{project}".
  697. string parent = 1 [
  698. (google.api.field_behavior) = REQUIRED,
  699. (google.api.resource_reference) = {
  700. child_type: "recaptchaenterprise.googleapis.com/RelatedAccountGroup"
  701. }
  702. ];
  703. // Optional. The maximum number of groups to return. The service might return fewer than
  704. // this value.
  705. // If unspecified, at most 50 groups are returned.
  706. // The maximum value is 1000; values above 1000 are coerced to 1000.
  707. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  708. // Optional. A page token, received from a previous `ListRelatedAccountGroups` call.
  709. // Provide this to retrieve the subsequent page.
  710. //
  711. // When paginating, all other parameters provided to
  712. // `ListRelatedAccountGroups` must match the call that provided the page
  713. // token.
  714. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  715. }
  716. // The response to a `ListRelatedAccountGroups` call.
  717. message ListRelatedAccountGroupsResponse {
  718. // The groups of related accounts listed by the query.
  719. repeated RelatedAccountGroup related_account_groups = 1;
  720. // A token, which can be sent as `page_token` to retrieve the next page.
  721. // If this field is omitted, there are no subsequent pages.
  722. string next_page_token = 2;
  723. }
  724. // The request message to search related account group memberships.
  725. message SearchRelatedAccountGroupMembershipsRequest {
  726. // Required. The name of the project to search related account group memberships from.
  727. // Specify the project name in the following format: "projects/{project}".
  728. string project = 1 [
  729. (google.api.field_behavior) = REQUIRED,
  730. (google.api.resource_reference) = {
  731. child_type: "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership"
  732. }
  733. ];
  734. // Optional. The unique stable hashed user identifier we should search connections to.
  735. // The identifier should correspond to a `hashed_account_id` provided in a
  736. // previous `CreateAssessment` or `AnnotateAssessment` call.
  737. bytes hashed_account_id = 2 [(google.api.field_behavior) = OPTIONAL];
  738. // Optional. The maximum number of groups to return. The service might return fewer than
  739. // this value.
  740. // If unspecified, at most 50 groups are returned.
  741. // The maximum value is 1000; values above 1000 are coerced to 1000.
  742. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
  743. // Optional. A page token, received from a previous
  744. // `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the
  745. // subsequent page.
  746. //
  747. // When paginating, all other parameters provided to
  748. // `SearchRelatedAccountGroupMemberships` must match the call that provided
  749. // the page token.
  750. string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
  751. }
  752. // The response to a `SearchRelatedAccountGroupMemberships` call.
  753. message SearchRelatedAccountGroupMembershipsResponse {
  754. // The queried memberships.
  755. repeated RelatedAccountGroupMembership related_account_group_memberships = 1;
  756. // A token, which can be sent as `page_token` to retrieve the next page.
  757. // If this field is omitted, there are no subsequent pages.
  758. string next_page_token = 2;
  759. }
  760. // A membership in a group of related accounts.
  761. message RelatedAccountGroupMembership {
  762. option (google.api.resource) = {
  763. type: "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership"
  764. pattern: "projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}"
  765. };
  766. // Required. The resource name for this membership in the format
  767. // `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`.
  768. string name = 1 [
  769. (google.api.field_behavior) = REQUIRED,
  770. (google.api.resource_reference) = {
  771. type: "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership"
  772. }
  773. ];
  774. // The unique stable hashed user identifier of the member. The identifier
  775. // corresponds to a `hashed_account_id` provided in a previous
  776. // `CreateAssessment` or `AnnotateAssessment` call.
  777. bytes hashed_account_id = 2;
  778. }
  779. // A group of related accounts.
  780. message RelatedAccountGroup {
  781. option (google.api.resource) = {
  782. type: "recaptchaenterprise.googleapis.com/RelatedAccountGroup"
  783. pattern: "projects/{project}/relatedaccountgroups/{relatedaccountgroup}"
  784. };
  785. // Required. The resource name for the related account group in the format
  786. // `projects/{project}/relatedaccountgroups/{related_account_group}`.
  787. string name = 1 [
  788. (google.api.field_behavior) = REQUIRED,
  789. (google.api.resource_reference) = {
  790. type: "recaptchaenterprise.googleapis.com/RelatedAccountGroup"
  791. }
  792. ];
  793. }
  794. // Settings specific to keys that can be used for WAF (Web Application
  795. // Firewall).
  796. message WafSettings {
  797. // Supported WAF features. For more information, see
  798. // https://cloud.google.com/recaptcha-enterprise/docs/usecase#comparison_of_features.
  799. enum WafFeature {
  800. // Undefined feature.
  801. WAF_FEATURE_UNSPECIFIED = 0;
  802. // Redirects suspicious traffic to reCAPTCHA.
  803. CHALLENGE_PAGE = 1;
  804. // Use reCAPTCHA session-tokens to protect the whole user session on the
  805. // site's domain.
  806. SESSION_TOKEN = 2;
  807. // Use reCAPTCHA action-tokens to protect user actions.
  808. ACTION_TOKEN = 3;
  809. }
  810. // Web Application Firewalls supported by reCAPTCHA Enterprise.
  811. enum WafService {
  812. // Undefined WAF
  813. WAF_SERVICE_UNSPECIFIED = 0;
  814. // Cloud Armor
  815. CA = 1;
  816. }
  817. // Required. The WAF service that uses this key.
  818. WafService waf_service = 1 [(google.api.field_behavior) = REQUIRED];
  819. // Required. The WAF feature for which this key is enabled.
  820. WafFeature waf_feature = 2 [(google.api.field_behavior) = REQUIRED];
  821. }