Skip to content

Commit a2770cc

Browse files
committed
extract remaining client-related types to shared module
1 parent b7fbcf7 commit a2770cc

2 files changed

Lines changed: 96 additions & 90 deletions

File tree

common/client_types.proto

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,86 @@ message ClientPlatformInfo {
171171
optional string architecture = 7;
172172
}
173173

174+
// Password Reset
175+
176+
message PasswordResetInitializeRequest {
177+
string email = 1;
178+
}
179+
180+
message PasswordResetStartRequest {
181+
string token = 1;
182+
}
183+
184+
message PasswordResetStartResponse {
185+
int64 deadline_timestamp = 1;
186+
}
187+
188+
message PasswordResetRequest {
189+
string password = 1;
190+
optional string token = 2;
191+
}
192+
193+
// Client MFA
194+
195+
enum MfaMethod {
196+
TOTP = 0;
197+
EMAIL = 1;
198+
OIDC = 2;
199+
BIOMETRIC = 3;
200+
MOBILE_APPROVE = 4;
201+
}
202+
203+
message ClientMfaStartRequest {
204+
int64 location_id = 1;
205+
string pubkey = 2;
206+
MfaMethod method = 3;
207+
}
208+
209+
message ClientMfaStartResponse {
210+
string token = 1;
211+
// for biometric mfa method
212+
optional string challenge = 2;
213+
}
214+
215+
message ClientMfaFinishRequest {
216+
string token = 1;
217+
optional string code = 2;
218+
optional string auth_pub_key = 3;
219+
}
220+
221+
message ClientMfaFinishResponse {
222+
string preshared_key = 1;
223+
optional string token = 2;
224+
}
225+
226+
message RegisterMobileAuthRequest {
227+
string token = 1;
228+
string auth_pub_key = 2;
229+
string device_pub_key = 3;
230+
}
231+
232+
// TOTP and Email MFA Setup
233+
234+
message CodeMfaSetupStartRequest {
235+
MfaMethod method = 1;
236+
string token = 2;
237+
}
238+
239+
// in case of email secret is empty
240+
message CodeMfaSetupStartResponse {
241+
optional string totp_secret = 1;
242+
}
243+
244+
message CodeMfaSetupFinishRequest {
245+
string code = 1;
246+
string token = 2;
247+
MfaMethod method = 3;
248+
}
249+
250+
message CodeMfaSetupFinishResponse {
251+
repeated string recovery_codes = 1;
252+
}
253+
174254
// OIDC authentication flow
175255

176256
enum AuthFlowType {

v2/proxy.proto

Lines changed: 16 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,7 @@ package defguard.proxy.v2;
44
import "common/client_types.proto";
55
import "google/protobuf/empty.proto";
66

7-
// Password Reset
8-
message PasswordResetStartRequest {
9-
string token = 1;
10-
}
11-
12-
message PasswordResetInitializeRequest {
13-
string email = 1;
14-
}
15-
16-
message PasswordResetStartResponse {
17-
int64 deadline_timestamp = 1;
18-
}
19-
20-
message PasswordResetRequest {
21-
string password = 1;
22-
optional string token = 2;
23-
}
24-
25-
// Client MFA
26-
enum MfaMethod {
27-
TOTP = 0;
28-
EMAIL = 1;
29-
OIDC = 2;
30-
BIOMETRIC = 3;
31-
MOBILE_APPROVE = 4;
32-
}
33-
7+
// Client MFA (proxy-internal only)
348
message ClientMfaTokenValidationRequest {
359
string token = 1;
3610
}
@@ -39,29 +13,6 @@ message ClientMfaTokenValidationResponse {
3913
bool token_valid = 1;
4014
}
4115

42-
message ClientMfaStartRequest {
43-
int64 location_id = 1;
44-
string pubkey = 2;
45-
MfaMethod method = 3;
46-
}
47-
48-
message ClientMfaStartResponse {
49-
string token = 1;
50-
// for biometric mfa method
51-
optional string challenge = 2;
52-
}
53-
54-
message ClientMfaFinishRequest {
55-
string token = 1;
56-
optional string code = 2;
57-
optional string auth_pub_key = 3;
58-
}
59-
60-
message ClientMfaFinishResponse {
61-
string preshared_key = 1;
62-
optional string token = 2;
63-
}
64-
6516
message AuthInfoResponse {
6617
string url = 1;
6718
string csrf_token = 2;
@@ -93,33 +44,6 @@ message DeviceInfo {
9344
optional string platform = 4;
9445
}
9546

96-
message RegisterMobileAuthRequest {
97-
string token = 1;
98-
string auth_pub_key = 2;
99-
string device_pub_key = 3;
100-
}
101-
102-
// TOTP and Email MFA Setup
103-
message CodeMfaSetupStartRequest {
104-
MfaMethod method = 1;
105-
string token = 2;
106-
}
107-
108-
// in case of email secret is empty
109-
message CodeMfaSetupStartResponse {
110-
optional string totp_secret = 1;
111-
}
112-
113-
message CodeMfaSetupFinishRequest {
114-
string code = 1;
115-
string token = 2;
116-
MfaMethod method = 3;
117-
}
118-
119-
message CodeMfaSetupFinishResponse {
120-
repeated string recovery_codes = 1;
121-
}
122-
12347
message AwaitRemoteMfaFinishRequest {
12448
string token = 1;
12549
}
@@ -152,16 +76,16 @@ message CoreResponse {
15276
google.protobuf.Empty empty = 2;
15377
defguard.client_types.EnrollmentStartResponse enrollment_start = 3;
15478
defguard.client_types.DeviceConfigResponse device_config = 4;
155-
PasswordResetStartResponse password_reset_start = 5;
156-
ClientMfaStartResponse client_mfa_start = 6;
157-
ClientMfaFinishResponse client_mfa_finish = 7;
79+
defguard.client_types.PasswordResetStartResponse password_reset_start = 5;
80+
defguard.client_types.ClientMfaStartResponse client_mfa_start = 6;
81+
defguard.client_types.ClientMfaFinishResponse client_mfa_finish = 7;
15882
CoreError core_error = 8;
15983
defguard.client_types.InstanceInfoResponse instance_info = 9;
16084
AuthInfoResponse auth_info = 10;
16185
AuthCallbackResponse auth_callback = 11;
16286
ClientMfaTokenValidationResponse client_mfa_token_validation = 12;
163-
CodeMfaSetupStartResponse code_mfa_setup_start_response = 13;
164-
CodeMfaSetupFinishResponse code_mfa_setup_finish_response = 14;
87+
defguard.client_types.CodeMfaSetupStartResponse code_mfa_setup_start_response = 13;
88+
defguard.client_types.CodeMfaSetupFinishResponse code_mfa_setup_finish_response = 14;
16589
InitialInfo initial_info = 15;
16690
AwaitRemoteMfaFinishResponse await_remote_mfa_finish = 16;
16791
HttpsCerts https_certs = 17;
@@ -236,24 +160,26 @@ message CoreRequest {
236160
uint64 id = 1;
237161
DeviceInfo device_info = 2;
238162
oneof payload {
163+
// desktop & mobile client messages
239164
defguard.client_types.EnrollmentStartRequest enrollment_start = 3;
240165
defguard.client_types.ActivateUserRequest activate_user = 4;
241166
defguard.client_types.NewDevice new_device = 5;
242167
defguard.client_types.ExistingDevice existing_device = 6;
243-
PasswordResetInitializeRequest password_reset_init = 7;
244-
PasswordResetStartRequest password_reset_start = 8;
245-
PasswordResetRequest password_reset = 9;
246-
ClientMfaStartRequest client_mfa_start = 10;
247-
ClientMfaFinishRequest client_mfa_finish = 11;
168+
defguard.client_types.ClientMfaStartRequest client_mfa_start = 10;
169+
defguard.client_types.ClientMfaFinishRequest client_mfa_finish = 11;
248170
defguard.client_types.InstanceInfoRequest instance_info = 12;
249171
defguard.client_types.AuthInfoRequest auth_info = 13;
250172
AuthCallbackRequest auth_callback = 14;
251173
ClientMfaOidcAuthenticateRequest client_mfa_oidc_authenticate = 15;
252-
RegisterMobileAuthRequest register_mobile_auth = 16;
174+
defguard.client_types.RegisterMobileAuthRequest register_mobile_auth = 16;
253175
ClientMfaTokenValidationRequest client_mfa_token_validation = 17;
254-
CodeMfaSetupStartRequest code_mfa_setup_start = 18;
255-
CodeMfaSetupFinishRequest code_mfa_setup_finish = 19;
176+
defguard.client_types.CodeMfaSetupStartRequest code_mfa_setup_start = 18;
177+
defguard.client_types.CodeMfaSetupFinishRequest code_mfa_setup_finish = 19;
256178
AwaitRemoteMfaFinishRequest await_remote_mfa_finish = 20;
179+
// proxy messages
180+
defguard.client_types.PasswordResetInitializeRequest password_reset_init = 7;
181+
defguard.client_types.PasswordResetStartRequest password_reset_start = 8;
182+
defguard.client_types.PasswordResetRequest password_reset = 9;
257183
AcmeCertificate acme_certificate = 21;
258184
}
259185
}

0 commit comments

Comments
 (0)