Skip to content

Commit 197c492

Browse files
committed
put cert-related messages in a shared package
1 parent 4ac3485 commit 197c492

3 files changed

Lines changed: 35 additions & 38 deletions

File tree

v2/common.proto

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
syntax = "proto3";
2+
package defguard.common.v2;
3+
4+
/*
5+
* Raw DER-encoded certificate or key payload.
6+
*/
7+
message DerPayload {
8+
bytes der_data = 1;
9+
}
10+
11+
/*
12+
* TLS certificate identity used to request a CSR from a component.
13+
*/
14+
message CertificateInfo {
15+
string cert_hostname = 1;
16+
}
17+
18+
/*
19+
* Structured log line streamed by a component during setup.
20+
*/
21+
message LogEntry {
22+
string level = 1;
23+
string target = 2;
24+
string message = 3;
25+
string timestamp = 4;
26+
map<string, string> fields = 5;
27+
}

v2/gateway.proto

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package defguard.gateway.v2;
33

44
import "enterprise/v2/firewall/firewall.proto";
55
import "google/protobuf/empty.proto";
6+
import "v2/common.proto";
67

78
/*
89
* Networking and VPN configuration send from Core to Gateway.
@@ -90,25 +91,9 @@ service Gateway {
9091
rpc Purge(google.protobuf.Empty) returns (google.protobuf.Empty);
9192
}
9293

93-
message DerPayload {
94-
bytes der_data = 1;
95-
}
96-
97-
message CertificateInfo {
98-
string cert_hostname = 1;
99-
}
100-
101-
message LogEntry {
102-
string level = 1;
103-
string target = 2;
104-
string message = 3;
105-
string timestamp = 4;
106-
map<string, string> fields = 5;
107-
}
108-
10994
// Service used for initial Gateway setup, for configuring TLS certificate on Gateway for gRPC communication.
11095
service GatewaySetup {
111-
rpc Start(google.protobuf.Empty) returns (stream LogEntry);
112-
rpc GetCsr(CertificateInfo) returns (DerPayload);
113-
rpc SendCert(DerPayload) returns (google.protobuf.Empty);
96+
rpc Start(google.protobuf.Empty) returns (stream defguard.common.v2.LogEntry);
97+
rpc GetCsr(defguard.common.v2.CertificateInfo) returns (defguard.common.v2.DerPayload);
98+
rpc SendCert(defguard.common.v2.DerPayload) returns (google.protobuf.Empty);
11499
}

v2/proxy.proto

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package defguard.proxy.v2;
33

44
import "common/client_types.proto";
55
import "google/protobuf/empty.proto";
6+
import "v2/common.proto";
67

78
// Client MFA (proxy-internal only)
89
message ClientMfaTokenValidationRequest {
@@ -182,14 +183,6 @@ message CoreRequest {
182183
}
183184
}
184185

185-
message CertificateInfo {
186-
string cert_hostname = 1;
187-
}
188-
189-
message DerPayload {
190-
bytes der_data = 1;
191-
}
192-
193186
service Proxy {
194187
/*
195188
* Bi-directional communication between core and proxy.
@@ -209,17 +202,9 @@ service Proxy {
209202
rpc TriggerAcme(AcmeChallenge) returns (stream AcmeIssueEvent);
210203
}
211204

212-
message LogEntry {
213-
string level = 1;
214-
string target = 2;
215-
string message = 3;
216-
string timestamp = 4;
217-
map<string, string> fields = 5;
218-
}
219-
220205
// Service used for initial Proxy setup, used for configuring TLS certificate on Proxy for gRPC communication.
221206
service ProxySetup {
222-
rpc Start(google.protobuf.Empty) returns (stream LogEntry);
223-
rpc GetCsr(CertificateInfo) returns (DerPayload);
224-
rpc SendCert(DerPayload) returns (google.protobuf.Empty);
207+
rpc Start(google.protobuf.Empty) returns (stream defguard.common.v2.LogEntry);
208+
rpc GetCsr(defguard.common.v2.CertificateInfo) returns (defguard.common.v2.DerPayload);
209+
rpc SendCert(defguard.common.v2.DerPayload) returns (google.protobuf.Empty);
225210
}

0 commit comments

Comments
 (0)