Add protos and BUILD rules for v1 API.
PiperOrigin-RevId: 301179394
This commit is contained in:
parent
8386761d09
commit
ff1713453b
|
|
@ -0,0 +1,364 @@
|
|||
# This file was automatically generated by BuildFileGenerator
|
||||
|
||||
# This is an API workspace, having public visibility by default makes perfect sense.
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
##############################################################################
|
||||
# Common
|
||||
##############################################################################
|
||||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
|
||||
|
||||
proto_library(
|
||||
name = "recaptchaenterprise_proto",
|
||||
srcs = [
|
||||
"recaptchaenterprise.proto",
|
||||
],
|
||||
deps = [
|
||||
"//google/api:annotations_proto",
|
||||
"//google/api:client_proto",
|
||||
"//google/api:field_behavior_proto",
|
||||
"//google/api:resource_proto",
|
||||
"@com_google_protobuf//:empty_proto",
|
||||
"@com_google_protobuf//:field_mask_proto",
|
||||
"@com_google_protobuf//:timestamp_proto",
|
||||
],
|
||||
)
|
||||
|
||||
proto_library_with_info(
|
||||
name = "recaptchaenterprise_proto_with_info",
|
||||
deps = [
|
||||
":recaptchaenterprise_proto",
|
||||
"//google/cloud:common_resources_proto",
|
||||
],
|
||||
)
|
||||
|
||||
##############################################################################
|
||||
# Java
|
||||
##############################################################################
|
||||
load(
|
||||
"@com_google_googleapis_imports//:imports.bzl",
|
||||
"java_gapic_assembly_gradle_pkg",
|
||||
"java_gapic_library",
|
||||
"java_gapic_test",
|
||||
"java_grpc_library",
|
||||
"java_proto_library",
|
||||
)
|
||||
|
||||
java_proto_library(
|
||||
name = "recaptchaenterprise_java_proto",
|
||||
deps = [":recaptchaenterprise_proto"],
|
||||
)
|
||||
|
||||
java_grpc_library(
|
||||
name = "recaptchaenterprise_java_grpc",
|
||||
srcs = [":recaptchaenterprise_proto"],
|
||||
deps = [":recaptchaenterprise_java_proto"],
|
||||
)
|
||||
|
||||
java_gapic_library(
|
||||
name = "recaptchaenterprise_java_gapic",
|
||||
src = ":recaptchaenterprise_proto_with_info",
|
||||
gapic_yaml = "recaptchaenterprise_gapic.yaml",
|
||||
package = "google.cloud.recaptchaenterprise.v1",
|
||||
service_yaml = "recaptchaenterprise_v1.yaml",
|
||||
test_deps = [
|
||||
":recaptchaenterprise_java_grpc",
|
||||
],
|
||||
deps = [
|
||||
":recaptchaenterprise_java_proto",
|
||||
],
|
||||
)
|
||||
|
||||
java_gapic_test(
|
||||
name = "recaptchaenterprise_java_gapic_test_suite",
|
||||
test_classes = [
|
||||
"com.google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClientTest",
|
||||
],
|
||||
runtime_deps = [":recaptchaenterprise_java_gapic_test"],
|
||||
)
|
||||
|
||||
# Open Source Packages
|
||||
java_gapic_assembly_gradle_pkg(
|
||||
name = "google-cloud-recaptchaenterprise-v1-java",
|
||||
deps = [
|
||||
":recaptchaenterprise_java_gapic",
|
||||
":recaptchaenterprise_java_grpc",
|
||||
":recaptchaenterprise_java_proto",
|
||||
":recaptchaenterprise_proto",
|
||||
],
|
||||
)
|
||||
|
||||
##############################################################################
|
||||
# Go
|
||||
##############################################################################
|
||||
load(
|
||||
"@com_google_googleapis_imports//:imports.bzl",
|
||||
"go_gapic_assembly_pkg",
|
||||
"go_gapic_library",
|
||||
"go_proto_library",
|
||||
"go_test",
|
||||
)
|
||||
|
||||
go_proto_library(
|
||||
name = "recaptchaenterprise_go_proto",
|
||||
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
|
||||
importpath = "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1",
|
||||
protos = [":recaptchaenterprise_proto"],
|
||||
deps = [
|
||||
"//google/api:annotations_go_proto",
|
||||
],
|
||||
)
|
||||
|
||||
go_gapic_library(
|
||||
name = "recaptchaenterprise_go_gapic",
|
||||
src = ":recaptchaenterprise_proto_with_info",
|
||||
gapic_yaml = "recaptchaenterprise_gapic.yaml",
|
||||
importpath = "cloud.google.com/go/recaptchaenterprise/apiv1",
|
||||
package = "google.cloud.recaptchaenterprise.v1",
|
||||
service_yaml = "recaptchaenterprise_v1.yaml",
|
||||
deps = [
|
||||
":recaptchaenterprise_go_proto",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "recaptchaenterprise_go_gapic_test",
|
||||
srcs = [":recaptchaenterprise_go_gapic_srcjar_test"],
|
||||
embed = [":recaptchaenterprise_go_gapic"],
|
||||
importpath = "cloud.google.com/go/recaptchaenterprise/apiv1",
|
||||
)
|
||||
|
||||
# Open Source Packages
|
||||
go_gapic_assembly_pkg(
|
||||
name = "gapi-cloud-recaptchaenterprise-v1-go",
|
||||
deps = [
|
||||
":recaptchaenterprise_go_gapic",
|
||||
":recaptchaenterprise_go_gapic_srcjar-smoke-test.srcjar",
|
||||
":recaptchaenterprise_go_gapic_srcjar-test.srcjar",
|
||||
":recaptchaenterprise_go_proto",
|
||||
],
|
||||
)
|
||||
|
||||
##############################################################################
|
||||
# Python
|
||||
##############################################################################
|
||||
load(
|
||||
"@com_google_googleapis_imports//:imports.bzl",
|
||||
"moved_proto_library",
|
||||
"py_gapic_assembly_pkg",
|
||||
"py_gapic_library",
|
||||
"py_grpc_library",
|
||||
"py_proto_library",
|
||||
)
|
||||
|
||||
moved_proto_library(
|
||||
name = "recaptchaenterprise_moved_proto",
|
||||
srcs = [":recaptchaenterprise_proto"],
|
||||
deps = [
|
||||
"//google/api:annotations_proto",
|
||||
"//google/api:client_proto",
|
||||
"//google/api:field_behavior_proto",
|
||||
"//google/api:resource_proto",
|
||||
"@com_google_protobuf//:empty_proto",
|
||||
"@com_google_protobuf//:field_mask_proto",
|
||||
"@com_google_protobuf//:timestamp_proto",
|
||||
],
|
||||
)
|
||||
|
||||
py_proto_library(
|
||||
name = "recaptchaenterprise_py_proto",
|
||||
plugin = "@protoc_docs_plugin//:docs_plugin",
|
||||
deps = [":recaptchaenterprise_moved_proto"],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
name = "recaptchaenterprise_py_grpc",
|
||||
srcs = [":recaptchaenterprise_moved_proto"],
|
||||
deps = [":recaptchaenterprise_py_proto"],
|
||||
)
|
||||
|
||||
py_gapic_library(
|
||||
name = "recaptchaenterprise_py_gapic",
|
||||
src = ":recaptchaenterprise_proto_with_info",
|
||||
gapic_yaml = "recaptchaenterprise_gapic.yaml",
|
||||
package = "google.cloud.recaptchaenterprise.v1",
|
||||
service_yaml = "recaptchaenterprise_v1.yaml",
|
||||
deps = [
|
||||
":recaptchaenterprise_py_grpc",
|
||||
":recaptchaenterprise_py_proto",
|
||||
],
|
||||
)
|
||||
|
||||
# Open Source Packages
|
||||
py_gapic_assembly_pkg(
|
||||
name = "recaptchaenterprise-v1-py",
|
||||
deps = [
|
||||
":recaptchaenterprise_py_gapic",
|
||||
":recaptchaenterprise_py_grpc",
|
||||
":recaptchaenterprise_py_proto",
|
||||
],
|
||||
)
|
||||
|
||||
##############################################################################
|
||||
# PHP
|
||||
##############################################################################
|
||||
load(
|
||||
"@com_google_googleapis_imports//:imports.bzl",
|
||||
"php_gapic_assembly_pkg",
|
||||
"php_gapic_library",
|
||||
"php_grpc_library",
|
||||
"php_proto_library",
|
||||
)
|
||||
|
||||
php_proto_library(
|
||||
name = "recaptchaenterprise_php_proto",
|
||||
deps = [":recaptchaenterprise_proto"],
|
||||
)
|
||||
|
||||
php_grpc_library(
|
||||
name = "recaptchaenterprise_php_grpc",
|
||||
srcs = [":recaptchaenterprise_proto"],
|
||||
deps = [":recaptchaenterprise_php_proto"],
|
||||
)
|
||||
|
||||
php_gapic_library(
|
||||
name = "recaptchaenterprise_php_gapic",
|
||||
src = ":recaptchaenterprise_proto_with_info",
|
||||
gapic_yaml = "recaptchaenterprise_gapic.yaml",
|
||||
package = "google.cloud.recaptchaenterprise.v1",
|
||||
service_yaml = "recaptchaenterprise_v1.yaml",
|
||||
deps = [
|
||||
":recaptchaenterprise_php_grpc",
|
||||
":recaptchaenterprise_php_proto",
|
||||
],
|
||||
)
|
||||
|
||||
# Open Source Packages
|
||||
php_gapic_assembly_pkg(
|
||||
name = "google-cloud-recaptchaenterprise-v1-php",
|
||||
deps = [
|
||||
":recaptchaenterprise_php_gapic",
|
||||
":recaptchaenterprise_php_grpc",
|
||||
":recaptchaenterprise_php_proto",
|
||||
],
|
||||
)
|
||||
|
||||
##############################################################################
|
||||
# Node.js
|
||||
##############################################################################
|
||||
load(
|
||||
"@com_google_googleapis_imports//:imports.bzl",
|
||||
"nodejs_gapic_assembly_pkg",
|
||||
"nodejs_gapic_library",
|
||||
)
|
||||
|
||||
nodejs_gapic_library(
|
||||
name = "recaptchaenterprise_nodejs_gapic",
|
||||
src = ":recaptchaenterprise_proto_with_info",
|
||||
gapic_yaml = "recaptchaenterprise_gapic.yaml",
|
||||
package = "google.cloud.recaptchaenterprise.v1",
|
||||
service_yaml = "recaptchaenterprise_v1.yaml",
|
||||
deps = [],
|
||||
)
|
||||
|
||||
nodejs_gapic_assembly_pkg(
|
||||
name = "recaptchaenterprise-v1-nodejs",
|
||||
deps = [
|
||||
":recaptchaenterprise_nodejs_gapic",
|
||||
":recaptchaenterprise_proto",
|
||||
],
|
||||
)
|
||||
|
||||
##############################################################################
|
||||
# Ruby
|
||||
##############################################################################
|
||||
load(
|
||||
"@com_google_googleapis_imports//:imports.bzl",
|
||||
"ruby_gapic_assembly_pkg",
|
||||
"ruby_gapic_library",
|
||||
"ruby_grpc_library",
|
||||
"ruby_proto_library",
|
||||
)
|
||||
|
||||
ruby_proto_library(
|
||||
name = "recaptchaenterprise_ruby_proto",
|
||||
deps = [":recaptchaenterprise_proto"],
|
||||
)
|
||||
|
||||
ruby_grpc_library(
|
||||
name = "recaptchaenterprise_ruby_grpc",
|
||||
srcs = [":recaptchaenterprise_proto"],
|
||||
deps = [":recaptchaenterprise_ruby_proto"],
|
||||
)
|
||||
|
||||
ruby_gapic_library(
|
||||
name = "recaptchaenterprise_ruby_gapic",
|
||||
src = ":recaptchaenterprise_proto_with_info",
|
||||
gapic_yaml = "recaptchaenterprise_gapic.yaml",
|
||||
package = "google.cloud.recaptchaenterprise.v1",
|
||||
service_yaml = "recaptchaenterprise_v1.yaml",
|
||||
deps = [
|
||||
":recaptchaenterprise_ruby_grpc",
|
||||
":recaptchaenterprise_ruby_proto",
|
||||
],
|
||||
)
|
||||
|
||||
# Open Source Packages
|
||||
ruby_gapic_assembly_pkg(
|
||||
name = "google-cloud-recaptchaenterprise-v1-ruby",
|
||||
deps = [
|
||||
":recaptchaenterprise_ruby_gapic",
|
||||
":recaptchaenterprise_ruby_grpc",
|
||||
":recaptchaenterprise_ruby_proto",
|
||||
],
|
||||
)
|
||||
|
||||
##############################################################################
|
||||
# C#
|
||||
##############################################################################
|
||||
load(
|
||||
"@com_google_googleapis_imports//:imports.bzl",
|
||||
"csharp_gapic_assembly_pkg",
|
||||
"csharp_gapic_library",
|
||||
"csharp_grpc_library",
|
||||
"csharp_proto_library",
|
||||
)
|
||||
|
||||
csharp_proto_library(
|
||||
name = "recaptchaenterprise_csharp_proto",
|
||||
deps = [":recaptchaenterprise_proto"],
|
||||
)
|
||||
|
||||
csharp_grpc_library(
|
||||
name = "recaptchaenterprise_csharp_grpc",
|
||||
srcs = [":recaptchaenterprise_proto"],
|
||||
deps = [":recaptchaenterprise_csharp_proto"],
|
||||
)
|
||||
|
||||
csharp_gapic_library(
|
||||
name = "recaptchaenterprise_csharp_gapic",
|
||||
src = ":recaptchaenterprise_proto_with_info",
|
||||
gapic_yaml = "recaptchaenterprise_gapic.yaml",
|
||||
package = "google.cloud.recaptchaenterprise.v1",
|
||||
service_yaml = "recaptchaenterprise_v1.yaml",
|
||||
deps = [
|
||||
":recaptchaenterprise_csharp_grpc",
|
||||
":recaptchaenterprise_csharp_proto",
|
||||
],
|
||||
)
|
||||
|
||||
# Open Source Packages
|
||||
csharp_gapic_assembly_pkg(
|
||||
name = "google-cloud-recaptchaenterprise-v1-csharp",
|
||||
deps = [
|
||||
":recaptchaenterprise_csharp_gapic",
|
||||
":recaptchaenterprise_csharp_grpc",
|
||||
":recaptchaenterprise_csharp_proto",
|
||||
],
|
||||
)
|
||||
|
||||
##############################################################################
|
||||
# C++
|
||||
##############################################################################
|
||||
# Put your C++ rules here
|
||||
|
|
@ -0,0 +1,459 @@
|
|||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package google.cloud.recaptchaenterprise.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
import "google/api/resource.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option csharp_namespace = "Google.Cloud.RecaptchaEnterprise.V1";
|
||||
option go_package = "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1;recaptchaenterprise";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "RecaptchaEnterpriseProto";
|
||||
option java_package = "com.google.recaptchaenterprise.v1";
|
||||
option objc_class_prefix = "GCRE";
|
||||
option php_namespace = "Google\\Cloud\\RecaptchaEnterprise\\V1";
|
||||
|
||||
// Service to determine the likelihood an event is legitimate.
|
||||
service RecaptchaEnterpriseService {
|
||||
option (google.api.default_host) = "recaptchaenterprise.googleapis.com";
|
||||
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
|
||||
|
||||
// Creates an Assessment of the likelihood an event is legitimate.
|
||||
rpc CreateAssessment(CreateAssessmentRequest) returns (Assessment) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/{parent=projects/*}/assessments"
|
||||
body: "assessment"
|
||||
};
|
||||
option (google.api.method_signature) = "parent,assessment";
|
||||
}
|
||||
|
||||
// Annotates a previously created Assessment to provide additional information
|
||||
// on whether the event turned out to be authentic or fradulent.
|
||||
rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/{name=projects/*/assessments/*}:annotate"
|
||||
body: "*"
|
||||
};
|
||||
option (google.api.method_signature) = "name,annotation";
|
||||
}
|
||||
|
||||
// Creates a new reCAPTCHA Enterprise key.
|
||||
rpc CreateKey(CreateKeyRequest) returns (Key) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/{parent=projects/*}/keys"
|
||||
body: "key"
|
||||
};
|
||||
}
|
||||
|
||||
// Returns the list of all keys that belong to a project.
|
||||
rpc ListKeys(ListKeysRequest) returns (ListKeysResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/{parent=projects/*}/keys"
|
||||
};
|
||||
}
|
||||
|
||||
// Returns the specified key.
|
||||
rpc GetKey(GetKeyRequest) returns (Key) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/{name=projects/*/keys/*}"
|
||||
};
|
||||
}
|
||||
|
||||
// Updates the specified key.
|
||||
rpc UpdateKey(UpdateKeyRequest) returns (Key) {
|
||||
option (google.api.http) = {
|
||||
patch: "/v1/{key.name=projects/*/keys/*}"
|
||||
body: "key"
|
||||
};
|
||||
}
|
||||
|
||||
// Deletes the specified key.
|
||||
rpc DeleteKey(DeleteKeyRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
delete: "/v1/{name=projects/*/keys/*}"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// The create assessment request message.
|
||||
message CreateAssessmentRequest {
|
||||
// Required. The name of the project in which the assessment will be created,
|
||||
// in the format "projects/{project}".
|
||||
string parent = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {
|
||||
type: "cloudresourcemanager.googleapis.com/Project"
|
||||
}
|
||||
];
|
||||
|
||||
// Required. The assessment details.
|
||||
Assessment assessment = 2 [(google.api.field_behavior) = REQUIRED];
|
||||
}
|
||||
|
||||
// The request message to annotate an Assessment.
|
||||
message AnnotateAssessmentRequest {
|
||||
// Enum that reprensents the types of annotations.
|
||||
enum Annotation {
|
||||
// Default unspecified type.
|
||||
ANNOTATION_UNSPECIFIED = 0;
|
||||
|
||||
// Provides information that the event turned out to be legitimate.
|
||||
LEGITIMATE = 1;
|
||||
|
||||
// Provides information that the event turned out to be fraudulent.
|
||||
FRAUDULENT = 2;
|
||||
|
||||
// Provides information that the event was related to a login event in which
|
||||
// the user typed the correct password.
|
||||
PASSWORD_CORRECT = 3;
|
||||
|
||||
// Provides information that the event was related to a login event in which
|
||||
// the user typed the incorrect password.
|
||||
PASSWORD_INCORRECT = 4;
|
||||
}
|
||||
|
||||
// Required. The resource name of the Assessment, in the format
|
||||
// "projects/{project}/assessments/{assessment}".
|
||||
string name = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {
|
||||
type: "recaptchaenterprise.googleapis.com/Assessment"
|
||||
}
|
||||
];
|
||||
|
||||
// Required. The annotation that will be assigned to the Event.
|
||||
Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED];
|
||||
}
|
||||
|
||||
// Empty response for AnnotateAssessment.
|
||||
message AnnotateAssessmentResponse {
|
||||
|
||||
}
|
||||
|
||||
// A recaptcha assessment resource.
|
||||
message Assessment {
|
||||
option (google.api.resource) = {
|
||||
type: "recaptchaenterprise.googleapis.com/Assessment"
|
||||
pattern: "projects/{project}/assessments/{assessment}"
|
||||
};
|
||||
|
||||
// Output only. The resource name for the Assessment in the format
|
||||
// "projects/{project}/assessments/{assessment}".
|
||||
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
// The event being assessed.
|
||||
Event event = 2;
|
||||
|
||||
// Output only. The risk analysis result for the event being assessed.
|
||||
RiskAnalysis risk_analysis = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
// Output only. Properties of the provided event token.
|
||||
TokenProperties token_properties = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
}
|
||||
|
||||
message Event {
|
||||
// Optional. The user response token provided by the reCAPTCHA client-side integration
|
||||
// on your site.
|
||||
string token = 1 [(google.api.field_behavior) = OPTIONAL];
|
||||
|
||||
// Optional. The site key that was used to invoke reCAPTCHA on your site and generate
|
||||
// the token.
|
||||
string site_key = 2 [(google.api.field_behavior) = OPTIONAL];
|
||||
|
||||
// Optional. The user agent present in the request from the user's device related to
|
||||
// this event.
|
||||
string user_agent = 3 [(google.api.field_behavior) = OPTIONAL];
|
||||
|
||||
// Optional. The IP address in the request from the user's device related to this event.
|
||||
string user_ip_address = 4 [(google.api.field_behavior) = OPTIONAL];
|
||||
|
||||
// Optional. The expected action for this type of event. This should be the same action
|
||||
// provided at token generation time on client-side platforms already
|
||||
// integrated with recaptcha enterprise.
|
||||
string expected_action = 5 [(google.api.field_behavior) = OPTIONAL];
|
||||
}
|
||||
|
||||
// Risk analysis result for an event.
|
||||
message RiskAnalysis {
|
||||
// LINT.IfChange(classification_reason)
|
||||
// Reasons contributing to the risk analysis verdict.
|
||||
enum ClassificationReason {
|
||||
// Default unspecified type.
|
||||
CLASSIFICATION_REASON_UNSPECIFIED = 0;
|
||||
|
||||
// Interactions matched the behavior of an automated agent.
|
||||
AUTOMATION = 1;
|
||||
|
||||
// The event originated from an illegitimate environment.
|
||||
UNEXPECTED_ENVIRONMENT = 2;
|
||||
|
||||
// Traffic volume from the event source is higher than normal.
|
||||
TOO_MUCH_TRAFFIC = 3;
|
||||
|
||||
// Interactions with the site were significantly different than expected
|
||||
// patterns.
|
||||
UNEXPECTED_USAGE_PATTERNS = 4;
|
||||
|
||||
// Too little traffic has been received from this site thus far to generate
|
||||
// quality risk analysis.
|
||||
LOW_CONFIDENCE_SCORE = 5;
|
||||
}
|
||||
|
||||
// Legitimate event score from 0.0 to 1.0.
|
||||
// (1.0 means very likely legitimate traffic while 0.0 means very likely
|
||||
// non-legitimate traffic).
|
||||
float score = 1;
|
||||
|
||||
// Reasons contributing to the risk analysis verdict.
|
||||
repeated ClassificationReason reasons = 2;
|
||||
}
|
||||
|
||||
message TokenProperties {
|
||||
// LINT.IfChange
|
||||
// Enum that represents the types of invalid token reasons.
|
||||
enum InvalidReason {
|
||||
// Default unspecified type.
|
||||
INVALID_REASON_UNSPECIFIED = 0;
|
||||
|
||||
// If the failure reason was not accounted for.
|
||||
UNKNOWN_INVALID_REASON = 1;
|
||||
|
||||
// The provided user verification token was malformed.
|
||||
MALFORMED = 2;
|
||||
|
||||
// The user verification token had expired.
|
||||
EXPIRED = 3;
|
||||
|
||||
// The user verification had already been seen.
|
||||
DUPE = 4;
|
||||
|
||||
// The user verification token was not present.
|
||||
MISSING = 5;
|
||||
}
|
||||
|
||||
// Whether the provided user response token is valid. When valid = false, the
|
||||
// reason could be specified in invalid_reason or it could also be due to
|
||||
// a user failing to solve a challenge or a sitekey mismatch (i.e the sitekey
|
||||
// used to generate the token was different than the one specified in the
|
||||
// assessment).
|
||||
bool valid = 1;
|
||||
|
||||
// Reason associated with the response when valid = false.
|
||||
InvalidReason invalid_reason = 2;
|
||||
|
||||
// The timestamp corresponding to the generation of the token.
|
||||
google.protobuf.Timestamp create_time = 3;
|
||||
|
||||
// The hostname of the page on which the token was generated.
|
||||
string hostname = 4;
|
||||
|
||||
// Action name provided at token generation.
|
||||
string action = 5;
|
||||
}
|
||||
|
||||
// The create key request message.
|
||||
message CreateKeyRequest {
|
||||
// Required. The name of the project in which the key will be created, in the
|
||||
// format "projects/{project}".
|
||||
string parent = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {
|
||||
type: "cloudresourcemanager.googleapis.com/Project"
|
||||
}
|
||||
];
|
||||
|
||||
// Required. Information to create a reCAPTCHA Enterprise key.
|
||||
Key key = 2 [(google.api.field_behavior) = REQUIRED];
|
||||
}
|
||||
|
||||
// The list keys request message.
|
||||
message ListKeysRequest {
|
||||
// Required. The name of the project that contains the keys that will be
|
||||
// listed, in the format "projects/{project}".
|
||||
string parent = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {
|
||||
type: "cloudresourcemanager.googleapis.com/Project"
|
||||
}
|
||||
];
|
||||
|
||||
// Optional. The maximum number of keys to return. Default is 10. Max limit is
|
||||
// 1000.
|
||||
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
|
||||
|
||||
// Optional. The next_page_token value returned from a previous.
|
||||
// ListKeysRequest, if any.
|
||||
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
|
||||
}
|
||||
|
||||
// Response to request to list keys in a project.
|
||||
message ListKeysResponse {
|
||||
// Key details.
|
||||
repeated Key keys = 1;
|
||||
|
||||
// Token to retrieve the next page of results. It is set to empty if no keys
|
||||
// remain in results.
|
||||
string next_page_token = 2;
|
||||
}
|
||||
|
||||
// The get key request message.
|
||||
message GetKeyRequest {
|
||||
// Required. The name of the requested key, in the format
|
||||
// "projects/{project}/keys/{key}".
|
||||
string name = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {
|
||||
type: "recaptchaenterprise.googleapis.com/Key"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
// The update key request message.
|
||||
message UpdateKeyRequest {
|
||||
// Required. The key to update.
|
||||
Key key = 1 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// Optional. The mask to control which field of the key get updated. If the mask is not
|
||||
// present, all fields will be updated.
|
||||
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
|
||||
}
|
||||
|
||||
// The delete key request message.
|
||||
message DeleteKeyRequest {
|
||||
// Required. The name of the key to be deleted, in the format
|
||||
// "projects/{project}/keys/{key}".
|
||||
string name = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {
|
||||
type: "recaptchaenterprise.googleapis.com/Key"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
// A key used to identify and configure applications (web and/or mobile) that
|
||||
// use reCAPTCHA Enterprise.
|
||||
message Key {
|
||||
option (google.api.resource) = {
|
||||
type: "recaptchaenterprise.googleapis.com/Key"
|
||||
pattern: "projects/{project}/keys/{key}"
|
||||
};
|
||||
|
||||
// The resource name for the Key in the format
|
||||
// "projects/{project}/keys/{key}".
|
||||
string name = 1;
|
||||
|
||||
// Human-readable display name of this key. Modifiable by user.
|
||||
string display_name = 2;
|
||||
|
||||
// Platform specific settings for this key. The key can only be used on one
|
||||
// platform, the one it has settings for.
|
||||
oneof platform_settings {
|
||||
// Settings for keys that can be used by websites.
|
||||
WebKeySettings web_settings = 3;
|
||||
|
||||
// Settings for keys that can be used by Android apps.
|
||||
AndroidKeySettings android_settings = 4;
|
||||
|
||||
// Settings for keys that can be used by iOS apps.
|
||||
IOSKeySettings ios_settings = 5;
|
||||
}
|
||||
|
||||
// Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
|
||||
// Creating and managing labels</a>.
|
||||
map<string, string> labels = 6 [(google.api.field_behavior) = OPTIONAL];
|
||||
|
||||
// The timestamp corresponding to the creation of this Key.
|
||||
google.protobuf.Timestamp create_time = 7;
|
||||
}
|
||||
|
||||
// Settings specific to keys that can be used by websites.
|
||||
message WebKeySettings {
|
||||
// Enum that represents the integration types for web keys.
|
||||
enum IntegrationType {
|
||||
// Default type that indicates this enum hasn't been specified. This is not
|
||||
// a valid IntegrationType, one of the other types must be specified
|
||||
// instead.
|
||||
INTEGRATION_TYPE_UNSPECIFIED = 0;
|
||||
|
||||
// Only used to produce scores. It doesn't display the "I'm not a robot"
|
||||
// checkbox and never shows captcha challenges.
|
||||
SCORE = 1;
|
||||
|
||||
// Displays the "I'm not a robot" checkbox and may show captcha challenges
|
||||
// after it is checked.
|
||||
CHECKBOX = 2;
|
||||
|
||||
// Doesn't display the "I'm not a robot" checkbox, but may show captcha
|
||||
// challenges after risk analysis.
|
||||
INVISIBLE = 3;
|
||||
}
|
||||
|
||||
// Enum that represents the possible challenge frequency and difficulty
|
||||
// configurations for a web key.
|
||||
enum ChallengeSecurityPreference {
|
||||
// Default type that indicates this enum hasn't been specified.
|
||||
CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0;
|
||||
|
||||
// Key tends to show fewer and easier challenges.
|
||||
USABILITY = 1;
|
||||
|
||||
// Key tends to show balanced (in amount and difficulty) challenges.
|
||||
BALANCE = 2;
|
||||
|
||||
// Key tends to show more and harder challenges.
|
||||
SECURITY = 3;
|
||||
}
|
||||
|
||||
// If set to true, it means allowed_domains will not be enforced.
|
||||
bool allow_all_domains = 3;
|
||||
|
||||
// Domains or subdomains of websites allowed to use the key. All subdomains
|
||||
// of an allowed domain are automatically allowed. A valid domain requires a
|
||||
// host and must not include any path, port, query or fragment.
|
||||
// Examples: 'example.com' or 'subdomain.example.com'
|
||||
repeated string allowed_domains = 1;
|
||||
|
||||
// Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
|
||||
bool allow_amp_traffic = 2 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// Required. Describes how this key is integrated with the website.
|
||||
IntegrationType integration_type = 4 [(google.api.field_behavior) = REQUIRED];
|
||||
|
||||
// Settings for the frequency and difficulty at which this key triggers
|
||||
// captcha challenges. This should only be specified for IntegrationTypes
|
||||
// CHECKBOX and INVISIBLE.
|
||||
ChallengeSecurityPreference challenge_security_preference = 5;
|
||||
}
|
||||
|
||||
// Settings specific to keys that can be used by Android apps.
|
||||
message AndroidKeySettings {
|
||||
// Android package names of apps allowed to use the key.
|
||||
// Example: 'com.companyname.appname'
|
||||
repeated string allowed_package_names = 1;
|
||||
}
|
||||
|
||||
// Settings specific to keys that can be used by iOS apps.
|
||||
message IOSKeySettings {
|
||||
// iOS bundle ids of apps allowed to use the key.
|
||||
// Example: 'com.companyname.productname.appname'
|
||||
repeated string allowed_bundle_ids = 1;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
type: com.google.api.codegen.ConfigProto
|
||||
config_schema_version: 2.0.0
|
||||
# The settings of generated code in a specific language.
|
||||
language_settings:
|
||||
java:
|
||||
package_name: com.google.cloud.recaptchaenterprise.v1
|
||||
python:
|
||||
package_name: google.cloud.recaptcha_enterprise_v1.gapic
|
||||
go:
|
||||
package_name: cloud.google.com/go/recaptchaenterprise/apiv1
|
||||
csharp:
|
||||
package_name: Google.Cloud.RecaptchaEnterprise.V1
|
||||
ruby:
|
||||
package_name: Google::Cloud::RecaptchaEnterprise::V1
|
||||
php:
|
||||
package_name: Google\Cloud\RecaptchaEnterprise\V1
|
||||
nodejs:
|
||||
package_name: recaptchaenterprise.v1
|
||||
domain_layer_location: google-cloud
|
||||
collections:
|
||||
- entity_name: project
|
||||
language_overrides:
|
||||
- language: csharp
|
||||
common_resource_name: Google.Api.Gax.ResourceNames.ProjectName
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"methodConfig": [
|
||||
{
|
||||
"name": [
|
||||
{
|
||||
"service": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService",
|
||||
"method": "CreateAssessment"
|
||||
},
|
||||
{
|
||||
"service": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService",
|
||||
"method": "AnnotateAssessment"
|
||||
},
|
||||
{
|
||||
"service": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService",
|
||||
"method": "CreateKey"
|
||||
},
|
||||
{
|
||||
"service": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService",
|
||||
"method": "ListKeys"
|
||||
},
|
||||
{
|
||||
"service": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService",
|
||||
"method": "GetKey"
|
||||
},
|
||||
{
|
||||
"service": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService",
|
||||
"method": "DeleteKey"
|
||||
},
|
||||
{
|
||||
"service": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService",
|
||||
"method": "UpdateKey"
|
||||
}
|
||||
],
|
||||
"timeout": "600s"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
type: google.api.Service
|
||||
config_version: 3
|
||||
name: recaptchaenterprise.googleapis.com
|
||||
title: reCAPTCHA Enterprise API
|
||||
|
||||
apis:
|
||||
- name: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService
|
||||
|
||||
authentication:
|
||||
rules:
|
||||
- selector: 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.*'
|
||||
oauth:
|
||||
canonical_scopes: |-
|
||||
https://www.googleapis.com/auth/cloud-platform
|
||||
Loading…
Reference in New Issue