Skip to content

Commit bc4a508

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add metadata exchange support for AlloyDB GA connectors
PiperOrigin-RevId: 569333566
1 parent 6152583 commit bc4a508

3 files changed

Lines changed: 315 additions & 0 deletions

File tree

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
# This file was automatically generated by BuildFileGenerator
2+
3+
# This is an API workspace, having public visibility by default makes perfect sense.
4+
package(default_visibility = ["//visibility:public"])
5+
6+
##############################################################################
7+
# Common
8+
##############################################################################
9+
load("@rules_proto//proto:defs.bzl", "proto_library")
10+
11+
proto_library(
12+
name = "connectors_proto",
13+
srcs = [
14+
"resources.proto",
15+
],
16+
deps = [
17+
"//google/api:field_behavior_proto",
18+
],
19+
)
20+
21+
##############################################################################
22+
# Java
23+
##############################################################################
24+
load(
25+
"@com_google_googleapis_imports//:imports.bzl",
26+
"java_proto_library",
27+
"java_gapic_assembly_gradle_pkg",
28+
)
29+
30+
java_proto_library(
31+
name = "connectors_java_proto",
32+
deps = [":connectors_proto"],
33+
)
34+
35+
# Open Source Packages
36+
java_gapic_assembly_gradle_pkg(
37+
name = "google-cloud-alloydb-connectors-v1-java",
38+
deps = [
39+
":connectors_proto",
40+
":connectors_java_proto",
41+
],
42+
)
43+
44+
##############################################################################
45+
# Go
46+
##############################################################################
47+
load(
48+
"@com_google_googleapis_imports//:imports.bzl",
49+
"go_proto_library",
50+
"go_gapic_assembly_pkg",
51+
)
52+
53+
go_proto_library(
54+
name = "connectors_go_proto",
55+
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
56+
importpath = "cloud.google.com/go/alloydb/connectors/apiv1/connectorspb",
57+
protos = [":connectors_proto"],
58+
deps = [
59+
"//google/api:annotations_go_proto",
60+
],
61+
)
62+
63+
go_gapic_assembly_pkg(
64+
name = "google-cloud-alloydb-connectors-v1-go",
65+
deps = [
66+
":connectors_go_proto",
67+
],
68+
)
69+
70+
##############################################################################
71+
# Python
72+
##############################################################################
73+
load(
74+
"@com_google_googleapis_imports//:imports.bzl",
75+
"moved_proto_library",
76+
"py_grpc_library",
77+
"py_proto_library",
78+
"py_gapic_library",
79+
"py_gapic_assembly_pkg",
80+
)
81+
82+
moved_proto_library(
83+
name = "connectors_moved_proto",
84+
srcs = [":connectors_proto"],
85+
deps = [
86+
"//google/api:field_behavior_proto",
87+
],
88+
)
89+
90+
py_proto_library(
91+
name = "connectors_py_proto",
92+
deps = [":connectors_moved_proto"],
93+
)
94+
95+
py_grpc_library(
96+
name = "connectors_py_grpc",
97+
srcs = [":connectors_moved_proto"],
98+
deps = [":connectors_py_proto"],
99+
)
100+
101+
py_gapic_library(
102+
name = "connectors_py_gapic",
103+
srcs = [":connectors_proto"],
104+
rest_numeric_enums = False,
105+
transport = "grpc+rest",
106+
)
107+
108+
# Open Source Packages
109+
py_gapic_assembly_pkg(
110+
name = "google-cloud-alloydb-connectors-v1-py",
111+
deps = [
112+
":connectors_py_gapic",
113+
],
114+
)
115+
116+
##############################################################################
117+
# PHP
118+
##############################################################################
119+
load(
120+
"@com_google_googleapis_imports//:imports.bzl",
121+
"php_gapic_assembly_pkg",
122+
"php_proto_library",
123+
)
124+
125+
php_proto_library(
126+
name = "connectors_php_proto",
127+
deps = [":connectors_proto"],
128+
)
129+
130+
php_gapic_assembly_pkg(
131+
name = "google-cloud-alloydb-connectors-v1-php",
132+
deps = [
133+
":connectors_php_proto",
134+
],
135+
)
136+
137+
##############################################################################
138+
# Ruby
139+
##############################################################################
140+
load(
141+
"@com_google_googleapis_imports//:imports.bzl",
142+
"ruby_grpc_library",
143+
"ruby_proto_library",
144+
)
145+
146+
ruby_proto_library(
147+
name = "connectors_ruby_proto",
148+
deps = [":connectors_proto"],
149+
)
150+
151+
ruby_grpc_library(
152+
name = "connectors_ruby_grpc",
153+
srcs = [":connectors_proto"],
154+
deps = [":connectors_ruby_proto"],
155+
)
156+
157+
##############################################################################
158+
# C#
159+
##############################################################################
160+
load(
161+
"@com_google_googleapis_imports//:imports.bzl",
162+
"csharp_proto_library",
163+
"csharp_gapic_assembly_pkg",
164+
)
165+
166+
csharp_proto_library(
167+
name = "connectors_csharp_proto",
168+
deps = [":connectors_proto"],
169+
)
170+
171+
# Open Source Packages
172+
csharp_gapic_assembly_pkg(
173+
name = "google-cloud-alloydb-connectors-v1-csharp",
174+
package_name = "Google.Cloud.AlloyDb.Connectors.V1",
175+
generate_nongapic_package = True,
176+
deps = [
177+
":connectors_csharp_proto",
178+
],
179+
)
180+
181+
##############################################################################
182+
# C++
183+
##############################################################################
184+
load(
185+
"@com_google_googleapis_imports//:imports.bzl",
186+
"cc_grpc_library",
187+
"cc_proto_library",
188+
)
189+
190+
cc_proto_library(
191+
name = "connectors_cc_proto",
192+
deps = [":connectors_proto"],
193+
)
194+
195+
cc_grpc_library(
196+
name = "connectors_cc_grpc",
197+
srcs = [":connectors_proto"],
198+
grpc_only = True,
199+
deps = [":connectors_cc_proto"],
200+
)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
type: google.api.Service
2+
config_version: 3
3+
name: connectors.googleapis.com
4+
title: AlloyDB connectors
5+
6+
types:
7+
- name: google.cloud.alloydb.connectors.v1.MetadataExchangeRequest
8+
- name: google.cloud.alloydb.connectors.v1.MetadataExchangeResponse
9+
10+
publishing:
11+
new_issue_uri: https://issuetracker.google.com/issues/new?component=1194526&template=1689942
12+
documentation_uri: https://cloud.google.com/alloydb/docs
13+
api_short_name: alloydb
14+
github_label: 'api: alloydb'
15+
doc_tag_prefix: alloydb
16+
organization: CLOUD
17+
library_settings:
18+
- version: google.cloud.alloydb.connectors.v1
19+
launch_stage: GA
20+
java_settings:
21+
common:
22+
destinations:
23+
- PACKAGE_MANAGER
24+
python_settings:
25+
common:
26+
destinations:
27+
- PACKAGE_MANAGER
28+
node_settings:
29+
common:
30+
destinations:
31+
- PACKAGE_MANAGER
32+
go_settings:
33+
common:
34+
destinations:
35+
- PACKAGE_MANAGER
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// Copyright 2023 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+
15+
syntax = "proto3";
16+
17+
package google.cloud.alloydb.connectors.v1;
18+
19+
import "google/api/field_behavior.proto";
20+
21+
option csharp_namespace = "Google.Cloud.AlloyDb.Connectors.V1";
22+
option go_package = "cloud.google.com/go/alloydb/connectors/apiv1/connectorspb;connectorspb";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "ResourcesProto";
25+
option java_package = "com.google.cloud.alloydb.connectors.v1";
26+
option php_namespace = "Google\\Cloud\\AlloyDb\\Connectors\\V1";
27+
option ruby_package = "Google::Cloud::AlloyDb::Connectors::V1";
28+
29+
// Message used by AlloyDB connectors to exchange client and connection metadata
30+
// with the server after a successful TLS handshake. This metadata includes an
31+
// IAM token, which is used to authenticate users based on their IAM identity.
32+
// The sole purpose of this message is for the use of AlloyDB connectors.
33+
// Clients should not rely on this message directly as there can be breaking
34+
// changes in the future.
35+
message MetadataExchangeRequest {
36+
// AuthType contains all supported authentication types.
37+
enum AuthType {
38+
// Authentication type is unspecified and DB_NATIVE is used by default
39+
AUTH_TYPE_UNSPECIFIED = 0;
40+
41+
// Database native authentication (user/password)
42+
DB_NATIVE = 1;
43+
44+
// Automatic IAM authentication
45+
AUTO_IAM = 2;
46+
}
47+
48+
// Optional. Connector information.
49+
string user_agent = 1 [(google.api.field_behavior) = OPTIONAL];
50+
51+
// Authentication type.
52+
AuthType auth_type = 2;
53+
54+
// IAM token used for both IAM user authentiation and
55+
// `alloydb.instances.connect` permission check.
56+
string oauth2_token = 3;
57+
}
58+
59+
// Message for response to metadata exchange request. The sole purpose of this
60+
// message is for the use of AlloyDB connectors. Clients should not rely on this
61+
// message directly as there can be breaking changes in the future.
62+
message MetadataExchangeResponse {
63+
// Response code.
64+
enum ResponseCode {
65+
// Unknown response code
66+
RESPONSE_CODE_UNSPECIFIED = 0;
67+
68+
// Success
69+
OK = 1;
70+
71+
// Failure
72+
ERROR = 2;
73+
}
74+
75+
// Response code.
76+
ResponseCode response_code = 1;
77+
78+
// Optional. Error message.
79+
string error = 2 [(google.api.field_behavior) = OPTIONAL];
80+
}

0 commit comments

Comments
 (0)