xref: /aosp_15_r20/external/googleapis/google/cloud/connectors/v1/ssl_config.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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
15syntax = "proto3";
16
17package google.cloud.connectors.v1;
18
19import "google/cloud/connectors/v1/common.proto";
20
21option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb";
22option java_multiple_files = true;
23option java_outer_classname = "SslConfigProto";
24option java_package = "com.google.cloud.connectors.v1";
25
26// Ssl config details of a connector version
27message SslConfigTemplate {
28  // Controls the ssl type for the given connector version
29  SslType ssl_type = 1;
30
31  // Boolean for determining if the connector version mandates TLS.
32  bool is_tls_mandatory = 2;
33
34  // List of supported Server Cert Types
35  repeated CertType server_cert_type = 3;
36
37  // List of supported Client Cert Types
38  repeated CertType client_cert_type = 4;
39
40  // Any additional fields that need to be rendered
41  repeated ConfigVariableTemplate additional_variables = 5;
42}
43
44// SSL Configuration of a connection
45message SslConfig {
46  // Enum for Ttust Model
47  enum TrustModel {
48    // Public Trust Model. Takes the Default Java trust store.
49    PUBLIC = 0;
50
51    // Private Trust Model. Takes custom/private trust store.
52    PRIVATE = 1;
53
54    // Insecure Trust Model. Accept all certificates.
55    INSECURE = 2;
56  }
57
58  // Controls the ssl type for the given connector version.
59  SslType type = 1;
60
61  // Trust Model of the SSL connection
62  TrustModel trust_model = 2;
63
64  // Private Server Certificate. Needs to be specified if trust model is
65  // `PRIVATE`.
66  Secret private_server_certificate = 3;
67
68  // Client Certificate
69  Secret client_certificate = 4;
70
71  // Client Private Key
72  Secret client_private_key = 5;
73
74  // Secret containing the passphrase protecting the Client Private Key
75  Secret client_private_key_pass = 6;
76
77  // Type of Server Cert (PEM/JKS/.. etc.)
78  CertType server_cert_type = 7;
79
80  // Type of Client Cert (PEM/JKS/.. etc.)
81  CertType client_cert_type = 8;
82
83  // Bool for enabling SSL
84  bool use_ssl = 9;
85
86  // Additional SSL related field values
87  repeated ConfigVariable additional_variables = 10;
88}
89
90// Enum for controlling the SSL Type (TLS/MTLS)
91enum SslType {
92  // No SSL configuration required.
93  SSL_TYPE_UNSPECIFIED = 0;
94
95  // TLS Handshake
96  TLS = 1;
97
98  // mutual TLS (MTLS) Handshake
99  MTLS = 2;
100}
101
102// Enum for Cert Types
103enum CertType {
104  // Cert type unspecified.
105  CERT_TYPE_UNSPECIFIED = 0;
106
107  // Privacy Enhanced Mail (PEM) Type
108  PEM = 1;
109}
110