@aepstore-dev/contracts 1.103.0 → 1.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gen/auth.d.ts +115 -0
- package/gen/auth.js +7 -0
- package/gen/auth.ts +181 -0
- package/package.json +35 -35
- package/proto/activity.proto +200 -200
- package/proto/auth.proto +271 -152
- package/proto/mail.proto +54 -54
- package/proto/payments.proto +496 -496
- package/proto/products.proto +382 -382
- package/proto/support.proto +121 -121
- package/proto/taxonomy.proto +105 -105
- package/proto/upload.proto +171 -171
- package/proto/users.proto +600 -600
package/proto/auth.proto
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package auth.v1;
|
|
4
|
-
|
|
5
|
-
// Ported from legacy auth-service (@MessagePattern → @GrpcMethod).
|
|
6
|
-
// Tokens are HMAC primitives from @aepstore-dev/passport:
|
|
7
|
-
// - access token: short TTL, carries userId; the gateway validates it
|
|
8
|
-
// locally via PassportAuthGuard (no round-trip here).
|
|
9
|
-
// - refresh token: long TTL HMAC + a RefreshToken DB row (device list +
|
|
10
|
-
// revocation). Refresh verifies the HMAC AND that the row still exists.
|
|
11
|
-
service AuthService {
|
|
12
|
-
rpc Login(LoginRequest) returns (AuthResult);
|
|
13
|
-
rpc Register(RegisterRequest) returns (AuthResult);
|
|
14
|
-
rpc CreateCode(CreateCodeRequest) returns (AuthResult);
|
|
15
|
-
rpc VerifyCode(VerifyCodeRequest) returns (AuthResult);
|
|
16
|
-
rpc CheckToken(CheckTokenRequest) returns (AuthUser);
|
|
17
|
-
rpc RefreshToken(RefreshTokenRequest) returns (AuthResult);
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth.v1;
|
|
4
|
+
|
|
5
|
+
// Ported from legacy auth-service (@MessagePattern → @GrpcMethod).
|
|
6
|
+
// Tokens are HMAC primitives from @aepstore-dev/passport:
|
|
7
|
+
// - access token: short TTL, carries userId; the gateway validates it
|
|
8
|
+
// locally via PassportAuthGuard (no round-trip here).
|
|
9
|
+
// - refresh token: long TTL HMAC + a RefreshToken DB row (device list +
|
|
10
|
+
// revocation). Refresh verifies the HMAC AND that the row still exists.
|
|
11
|
+
service AuthService {
|
|
12
|
+
rpc Login(LoginRequest) returns (AuthResult);
|
|
13
|
+
rpc Register(RegisterRequest) returns (AuthResult);
|
|
14
|
+
rpc CreateCode(CreateCodeRequest) returns (AuthResult);
|
|
15
|
+
rpc VerifyCode(VerifyCodeRequest) returns (AuthResult);
|
|
16
|
+
rpc CheckToken(CheckTokenRequest) returns (AuthUser);
|
|
17
|
+
rpc RefreshToken(RefreshTokenRequest) returns (AuthResult);
|
|
18
18
|
rpc Get2faStatus(Get2faStatusRequest) returns (TwoFactorStatusResponse);
|
|
19
19
|
rpc GetProfile(GetProfileRequest) returns (AuthUser);
|
|
20
20
|
rpc CleanupExpiredTotpSetups(Empty) returns (Empty);
|
|
@@ -25,45 +25,55 @@ service AuthService {
|
|
|
25
25
|
rpc DeletePasskey(DeletePasskeyRequest) returns (DeletePasskeyResponse);
|
|
26
26
|
rpc GeneratePasskeyAuthenticationOptions(GeneratePasskeyAuthenticationOptionsRequest) returns (PasskeyOptionsResponse);
|
|
27
27
|
rpc VerifyPasskeyAuthentication(VerifyPasskeyAuthenticationRequest) returns (AuthResult);
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
rpc
|
|
32
|
-
rpc
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
rpc
|
|
38
|
-
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
rpc
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
28
|
+
|
|
29
|
+
// First-party OAuth 2.0 provider. Authorization codes use PKCE S256;
|
|
30
|
+
// access/refresh tokens are opaque, scoped and independently revocable.
|
|
31
|
+
rpc ValidateOAuthAuthorizationRequest(ValidateOAuthAuthorizationRequestInput) returns (OAuthAuthorizationRequestInfo);
|
|
32
|
+
rpc CreateOAuthAuthorizationCode(CreateOAuthAuthorizationCodeRequest) returns (CreateOAuthAuthorizationCodeResponse);
|
|
33
|
+
rpc ExchangeOAuthToken(ExchangeOAuthTokenRequest) returns (OAuthTokenResponse);
|
|
34
|
+
rpc GetOAuthUserInfo(OAuthResourceRequest) returns (OAuthUserInfoResponse);
|
|
35
|
+
rpc ListOAuthProducts(OAuthResourceRequest) returns (OAuthProductsResponse);
|
|
36
|
+
rpc ListOAuthAuthorizations(ListOAuthAuthorizationsRequest) returns (ListOAuthAuthorizationsResponse);
|
|
37
|
+
rpc RevokeOAuthAuthorization(RevokeOAuthAuthorizationRequest) returns (RevokeOAuthAuthorizationResponse);
|
|
38
|
+
|
|
39
|
+
// Logout — kill refresh tokens. LogoutCurrent kills only the one whose
|
|
40
|
+
// HMAC matches; LogoutAll wipes every row for the user.
|
|
41
|
+
rpc LogoutCurrent(LogoutCurrentRequest) returns (LogoutResponse);
|
|
42
|
+
rpc LogoutAll(LogoutAllRequest) returns (LogoutResponse);
|
|
43
|
+
|
|
44
|
+
// Self-service restore. Verifies credentials + password against a
|
|
45
|
+
// soft-deleted user, clears deletedAt/scheduledForHardDelete, and issues
|
|
46
|
+
// fresh tokens — the one auth path that DOES read deletedAt accounts.
|
|
47
|
+
rpc RestoreLogin(RestoreLoginRequest) returns (AuthResult);
|
|
48
|
+
|
|
49
|
+
// Login history. Read-only audit feed for the settings page; rows come
|
|
50
|
+
// from LoginEvent. Internal alternative: tasks-service GC.
|
|
51
|
+
rpc ListLoginHistory(ListLoginHistoryRequest) returns (ListLoginHistoryResponse);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
enum TwoFactorType {
|
|
55
|
+
NONE = 0;
|
|
56
|
+
APP = 1;
|
|
57
|
+
EMAIL = 2;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
// Requests
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
|
|
64
|
+
// Login by username OR email (one of the two must be set).
|
|
55
65
|
message LoginRequest {
|
|
56
66
|
string password = 1;
|
|
57
67
|
string credentials = 2; // username OR email — resolved by the service
|
|
58
|
-
// Gateway-supplied audit context. LoginEvent rows for LOGIN /
|
|
59
|
-
// PASSWORD_FAIL get the same ip/user-agent that REFRESH and RESTORE
|
|
60
|
-
// already carry; the gRPC layer has no transport-level access to
|
|
68
|
+
// Gateway-supplied audit context. LoginEvent rows for LOGIN /
|
|
69
|
+
// PASSWORD_FAIL get the same ip/user-agent that REFRESH and RESTORE
|
|
70
|
+
// already carry; the gRPC layer has no transport-level access to
|
|
61
71
|
// either, so the gateway extracts them from the HTTP request.
|
|
62
72
|
string user_agent = 3;
|
|
63
73
|
string ip = 4;
|
|
64
74
|
string trusted_device_token = 5;
|
|
65
75
|
}
|
|
66
|
-
|
|
76
|
+
|
|
67
77
|
message RegisterRequest {
|
|
68
78
|
string email = 1;
|
|
69
79
|
string username = 2;
|
|
@@ -71,13 +81,13 @@ message RegisterRequest {
|
|
|
71
81
|
string ip = 4; // optional, attached by gateway from req
|
|
72
82
|
string user_agent = 5; // optional, attached by gateway from req
|
|
73
83
|
}
|
|
74
|
-
|
|
84
|
+
|
|
75
85
|
// type ∈ { twofa, reset, totp_generate, confirm } (legacy strings)
|
|
76
|
-
message CreateCodeRequest {
|
|
77
|
-
string email = 1;
|
|
78
|
-
string type = 2;
|
|
79
|
-
}
|
|
80
|
-
|
|
86
|
+
message CreateCodeRequest {
|
|
87
|
+
string email = 1;
|
|
88
|
+
string type = 2;
|
|
89
|
+
}
|
|
90
|
+
|
|
81
91
|
// type ∈ { twofa, twofa_activate, twofa_deactivate, reset, totp, totp_activate,
|
|
82
92
|
// totp_deactivate, backup, regenerate_backup, confirm }
|
|
83
93
|
// regenerate_backup expects a current TOTP code, not an existing backup code.
|
|
@@ -95,21 +105,21 @@ message VerifyCodeRequest {
|
|
|
95
105
|
// Public login completions must use challenge_id instead.
|
|
96
106
|
bool account_verification = 9;
|
|
97
107
|
}
|
|
98
|
-
|
|
99
|
-
message CheckTokenRequest {
|
|
100
|
-
string token = 1;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
message RefreshTokenRequest {
|
|
104
|
-
string refresh_token = 1;
|
|
105
|
-
string user_agent = 2; // optional
|
|
106
|
-
string ip = 3; // optional
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
message Get2faStatusRequest {
|
|
110
|
-
string username = 1;
|
|
111
|
-
}
|
|
112
|
-
|
|
108
|
+
|
|
109
|
+
message CheckTokenRequest {
|
|
110
|
+
string token = 1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
message RefreshTokenRequest {
|
|
114
|
+
string refresh_token = 1;
|
|
115
|
+
string user_agent = 2; // optional
|
|
116
|
+
string ip = 3; // optional
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
message Get2faStatusRequest {
|
|
120
|
+
string username = 1;
|
|
121
|
+
}
|
|
122
|
+
|
|
113
123
|
message GetProfileRequest {
|
|
114
124
|
string user_id = 1;
|
|
115
125
|
}
|
|
@@ -155,11 +165,120 @@ message VerifyPasskeyAuthenticationRequest {
|
|
|
155
165
|
string user_agent = 3;
|
|
156
166
|
string ip = 4;
|
|
157
167
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
168
|
+
|
|
169
|
+
message CreateOAuthAuthorizationCodeRequest {
|
|
170
|
+
string user_id = 1;
|
|
171
|
+
string response_type = 2;
|
|
172
|
+
string client_id = 3;
|
|
173
|
+
string redirect_uri = 4;
|
|
174
|
+
repeated string scopes = 5;
|
|
175
|
+
string code_challenge = 6;
|
|
176
|
+
string code_challenge_method = 7;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
message ValidateOAuthAuthorizationRequestInput {
|
|
180
|
+
string response_type = 1;
|
|
181
|
+
string client_id = 2;
|
|
182
|
+
string redirect_uri = 3;
|
|
183
|
+
repeated string scopes = 4;
|
|
184
|
+
string code_challenge = 5;
|
|
185
|
+
string code_challenge_method = 6;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
message OAuthAuthorizationRequestInfo {
|
|
189
|
+
string client_id = 1;
|
|
190
|
+
string client_name = 2;
|
|
191
|
+
string redirect_uri = 3;
|
|
192
|
+
repeated string scopes = 4;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
message CreateOAuthAuthorizationCodeResponse {
|
|
196
|
+
string code = 1;
|
|
197
|
+
string redirect_uri = 2;
|
|
198
|
+
int32 expires_in = 3;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
message ExchangeOAuthTokenRequest {
|
|
202
|
+
string grant_type = 1;
|
|
203
|
+
string code = 2;
|
|
204
|
+
string refresh_token = 3;
|
|
205
|
+
string client_id = 4;
|
|
206
|
+
string client_secret = 5;
|
|
207
|
+
string redirect_uri = 6;
|
|
208
|
+
string code_verifier = 7;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
message OAuthTokenResponse {
|
|
212
|
+
string access_token = 1;
|
|
213
|
+
string token_type = 2;
|
|
214
|
+
int32 expires_in = 3;
|
|
215
|
+
string refresh_token = 4;
|
|
216
|
+
string scope = 5;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
message OAuthResourceRequest {
|
|
220
|
+
string access_token = 1;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
message OAuthPremiumInfo {
|
|
224
|
+
bool active = 1;
|
|
225
|
+
string expires_at = 2;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
message OAuthUserInfoResponse {
|
|
229
|
+
string id = 1;
|
|
230
|
+
string email = 2;
|
|
231
|
+
string username = 3;
|
|
232
|
+
string full_name = 4;
|
|
233
|
+
string avatar_url = 5;
|
|
234
|
+
OAuthPremiumInfo premium = 6;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
message OAuthProduct {
|
|
238
|
+
string id = 1;
|
|
239
|
+
string name = 2;
|
|
240
|
+
string description = 3;
|
|
241
|
+
string preview = 4;
|
|
242
|
+
string price = 5;
|
|
243
|
+
string currency = 6;
|
|
244
|
+
string public_url = 7;
|
|
245
|
+
string moderation_status = 8;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
message OAuthProductsResponse {
|
|
249
|
+
repeated OAuthProduct items = 1;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
message ListOAuthAuthorizationsRequest {
|
|
253
|
+
string user_id = 1;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
message OAuthAuthorization {
|
|
257
|
+
string client_id = 1;
|
|
258
|
+
string client_name = 2;
|
|
259
|
+
repeated string scopes = 3;
|
|
260
|
+
string granted_at = 4;
|
|
261
|
+
string last_used_at = 5;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
message ListOAuthAuthorizationsResponse {
|
|
265
|
+
repeated OAuthAuthorization items = 1;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
message RevokeOAuthAuthorizationRequest {
|
|
269
|
+
string user_id = 1;
|
|
270
|
+
string client_id = 2;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
message RevokeOAuthAuthorizationResponse {
|
|
274
|
+
bool revoked = 1;
|
|
275
|
+
int32 revoked_tokens = 2;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// ---------------------------------------------------------------------------
|
|
279
|
+
// Responses
|
|
280
|
+
// ---------------------------------------------------------------------------
|
|
281
|
+
|
|
163
282
|
message AuthUser {
|
|
164
283
|
string id = 1;
|
|
165
284
|
string username = 2;
|
|
@@ -167,39 +286,39 @@ message AuthUser {
|
|
|
167
286
|
string avatar_url = 4;
|
|
168
287
|
string banner_url = 5;
|
|
169
288
|
repeated string roles = 6;
|
|
170
|
-
// Reserved: 7=role, 8=is_verified, 9=two_factor_type, 10=two_factor_enabled,
|
|
171
|
-
// 11=balance. Dropped in contracts 1.51.0 — clients read 2FA flags from
|
|
289
|
+
// Reserved: 7=role, 8=is_verified, 9=two_factor_type, 10=two_factor_enabled,
|
|
290
|
+
// 11=balance. Dropped in contracts 1.51.0 — clients read 2FA flags from
|
|
172
291
|
// AuthResult / /account/settings, balance from /payments/wallet.
|
|
173
292
|
reserved 7, 8, 9, 10, 11;
|
|
174
293
|
reserved "role", "is_verified", "two_factor_type", "two_factor_enabled", "balance";
|
|
175
294
|
string avatar_border = 12;
|
|
176
295
|
}
|
|
177
|
-
|
|
178
|
-
// Unified result for login/register/createCode/verifyCode/refresh. Which fields
|
|
179
|
-
// are populated depends on the flow:
|
|
180
|
-
// - fully authenticated → access_token + refresh_token + expires_in + user
|
|
181
|
-
// - 2FA required / pending confirm → message + two_factor_required + two_factor_type + user (no tokens)
|
|
182
|
-
// - totp_generate → secret + otpauth + qr (+ user)
|
|
183
|
-
// - totp_activate → backup_codes (+ tokens/user)
|
|
184
|
-
message AuthResult {
|
|
185
|
-
string access_token = 1;
|
|
186
|
-
string refresh_token = 2;
|
|
187
|
-
int32 expires_in = 3;
|
|
188
|
-
AuthUser user = 4;
|
|
189
|
-
|
|
190
|
-
string message = 5;
|
|
191
|
-
// Renamed from `requires_2fa` in 1.52.0: the digit-after-underscore broke
|
|
192
|
-
// the grpc proto-loader's camelCase pass (`_2` isn't `_<letter>`), so the
|
|
193
|
-
// wire key stayed snake_case and never matched the camelCase handler output
|
|
194
|
-
// → always serialised false. `two_factor_required` camelCases cleanly to
|
|
195
|
-
// `twoFactorRequired` on every layer. Field number 6 is unchanged (wire-
|
|
196
|
-
// compatible).
|
|
197
|
-
bool two_factor_required = 6;
|
|
198
|
-
TwoFactorType two_factor_type = 7;
|
|
199
|
-
|
|
200
|
-
// TOTP setup extras
|
|
201
|
-
string secret = 8;
|
|
202
|
-
string otpauth = 9;
|
|
296
|
+
|
|
297
|
+
// Unified result for login/register/createCode/verifyCode/refresh. Which fields
|
|
298
|
+
// are populated depends on the flow:
|
|
299
|
+
// - fully authenticated → access_token + refresh_token + expires_in + user
|
|
300
|
+
// - 2FA required / pending confirm → message + two_factor_required + two_factor_type + user (no tokens)
|
|
301
|
+
// - totp_generate → secret + otpauth + qr (+ user)
|
|
302
|
+
// - totp_activate → backup_codes (+ tokens/user)
|
|
303
|
+
message AuthResult {
|
|
304
|
+
string access_token = 1;
|
|
305
|
+
string refresh_token = 2;
|
|
306
|
+
int32 expires_in = 3;
|
|
307
|
+
AuthUser user = 4;
|
|
308
|
+
|
|
309
|
+
string message = 5;
|
|
310
|
+
// Renamed from `requires_2fa` in 1.52.0: the digit-after-underscore broke
|
|
311
|
+
// the grpc proto-loader's camelCase pass (`_2` isn't `_<letter>`), so the
|
|
312
|
+
// wire key stayed snake_case and never matched the camelCase handler output
|
|
313
|
+
// → always serialised false. `two_factor_required` camelCases cleanly to
|
|
314
|
+
// `twoFactorRequired` on every layer. Field number 6 is unchanged (wire-
|
|
315
|
+
// compatible).
|
|
316
|
+
bool two_factor_required = 6;
|
|
317
|
+
TwoFactorType two_factor_type = 7;
|
|
318
|
+
|
|
319
|
+
// TOTP setup extras
|
|
320
|
+
string secret = 8;
|
|
321
|
+
string otpauth = 9;
|
|
203
322
|
string qr = 10; // data URL (PNG)
|
|
204
323
|
repeated string backup_codes = 11;
|
|
205
324
|
string challenge_id = 12;
|
|
@@ -207,26 +326,26 @@ message AuthResult {
|
|
|
207
326
|
string trusted_device_expires_at = 14;
|
|
208
327
|
bool security_setup_required = 15;
|
|
209
328
|
}
|
|
210
|
-
|
|
211
|
-
message TwoFactorStatusResponse {
|
|
212
|
-
TwoFactorType two_factor_type = 1;
|
|
213
|
-
bool has_2fa = 2;
|
|
214
|
-
bool is_verified = 3;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
message Empty {}
|
|
218
|
-
|
|
219
|
-
message LogoutCurrentRequest {
|
|
220
|
-
string refresh_token = 1;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
message LogoutAllRequest {
|
|
224
|
-
string user_id = 1;
|
|
225
|
-
// Current session's refresh token — excluded from the wipe so "log out
|
|
226
|
-
// everywhere" keeps THIS device signed in. Empty = revoke every session.
|
|
227
|
-
string refresh_token = 2;
|
|
228
|
-
}
|
|
229
|
-
|
|
329
|
+
|
|
330
|
+
message TwoFactorStatusResponse {
|
|
331
|
+
TwoFactorType two_factor_type = 1;
|
|
332
|
+
bool has_2fa = 2;
|
|
333
|
+
bool is_verified = 3;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
message Empty {}
|
|
337
|
+
|
|
338
|
+
message LogoutCurrentRequest {
|
|
339
|
+
string refresh_token = 1;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
message LogoutAllRequest {
|
|
343
|
+
string user_id = 1;
|
|
344
|
+
// Current session's refresh token — excluded from the wipe so "log out
|
|
345
|
+
// everywhere" keeps THIS device signed in. Empty = revoke every session.
|
|
346
|
+
string refresh_token = 2;
|
|
347
|
+
}
|
|
348
|
+
|
|
230
349
|
message LogoutResponse {
|
|
231
350
|
bool ok = 1;
|
|
232
351
|
int32 removed = 2; // number of refresh-token rows deleted
|
|
@@ -266,33 +385,33 @@ message ListPasskeysResponse {
|
|
|
266
385
|
message DeletePasskeyResponse {
|
|
267
386
|
bool ok = 1;
|
|
268
387
|
}
|
|
269
|
-
|
|
270
|
-
message RestoreLoginRequest {
|
|
271
|
-
string credentials = 1; // email or username
|
|
272
|
-
string password = 2;
|
|
273
|
-
string user_agent = 3;
|
|
274
|
-
string ip = 4;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
message ListLoginHistoryRequest {
|
|
278
|
-
string user_id = 1;
|
|
279
|
-
int32 page = 2;
|
|
280
|
-
int32 limit = 3;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
message LoginEventRow {
|
|
284
|
-
string id = 1;
|
|
285
|
-
string type = 2; // LOGIN | LOGOUT | REFRESH | TWO_FA_FAIL | PASSWORD_FAIL | BLOCKED | RESTORE
|
|
286
|
-
bool success = 3;
|
|
287
|
-
string reason = 4;
|
|
288
|
-
string ip = 5;
|
|
289
|
-
string user_agent = 6;
|
|
290
|
-
string created_at = 7;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
message ListLoginHistoryResponse {
|
|
294
|
-
repeated LoginEventRow items = 1;
|
|
295
|
-
int32 total = 2;
|
|
296
|
-
int32 page = 3;
|
|
297
|
-
int32 limit = 4;
|
|
298
|
-
}
|
|
388
|
+
|
|
389
|
+
message RestoreLoginRequest {
|
|
390
|
+
string credentials = 1; // email or username
|
|
391
|
+
string password = 2;
|
|
392
|
+
string user_agent = 3;
|
|
393
|
+
string ip = 4;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
message ListLoginHistoryRequest {
|
|
397
|
+
string user_id = 1;
|
|
398
|
+
int32 page = 2;
|
|
399
|
+
int32 limit = 3;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
message LoginEventRow {
|
|
403
|
+
string id = 1;
|
|
404
|
+
string type = 2; // LOGIN | LOGOUT | REFRESH | TWO_FA_FAIL | PASSWORD_FAIL | BLOCKED | RESTORE
|
|
405
|
+
bool success = 3;
|
|
406
|
+
string reason = 4;
|
|
407
|
+
string ip = 5;
|
|
408
|
+
string user_agent = 6;
|
|
409
|
+
string created_at = 7;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
message ListLoginHistoryResponse {
|
|
413
|
+
repeated LoginEventRow items = 1;
|
|
414
|
+
int32 total = 2;
|
|
415
|
+
int32 page = 3;
|
|
416
|
+
int32 limit = 4;
|
|
417
|
+
}
|
package/proto/mail.proto
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package mail.v1;
|
|
4
|
-
|
|
5
|
-
// Legacy mail-service used @EventPattern (fire-and-forget). In the new gRPC
|
|
6
|
-
// stack each becomes a unary RPC that returns an Ack. Callers ignore the
|
|
7
|
-
// response if they don't care about delivery.
|
|
8
|
-
service MailService {
|
|
9
|
-
rpc SendReg(SendRegRequest) returns (MailAck);
|
|
10
|
-
rpc Send2fa(Send2faRequest) returns (MailAck);
|
|
11
|
-
rpc SendPasswordReset(SendPasswordResetRequest) returns (MailAck);
|
|
12
|
-
rpc SendRegistrationConfirm(SendRegistrationConfirmRequest) returns (MailAck);
|
|
13
|
-
|
|
14
|
-
// GDPR data-export delivery — tasks-service fires after the JSON dump
|
|
15
|
-
// lands in S3; mail-service sends the signed URL with a sensible TTL note.
|
|
16
|
-
rpc SendDataExportReady(SendDataExportReadyRequest) returns (MailAck);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
message MailAck {
|
|
20
|
-
bool queued = 1;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
message SendRegRequest {
|
|
24
|
-
string user_id = 1;
|
|
25
|
-
string email = 2;
|
|
26
|
-
string username = 3;
|
|
27
|
-
string full_name = 4;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
message Send2faRequest {
|
|
31
|
-
string email = 1;
|
|
32
|
-
string code = 2;
|
|
33
|
-
string username = 3;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
message SendPasswordResetRequest {
|
|
37
|
-
string email = 1;
|
|
38
|
-
string code = 2;
|
|
39
|
-
string username = 3;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
message SendRegistrationConfirmRequest {
|
|
43
|
-
string email = 1;
|
|
44
|
-
string code = 2;
|
|
45
|
-
string username = 3;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
message SendDataExportReadyRequest {
|
|
49
|
-
string email = 1;
|
|
50
|
-
string username = 2;
|
|
51
|
-
string file_url = 3; // signed S3 URL
|
|
52
|
-
int32 url_ttl_hours = 4; // for the message body
|
|
53
|
-
int32 file_size = 5;
|
|
54
|
-
}
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package mail.v1;
|
|
4
|
+
|
|
5
|
+
// Legacy mail-service used @EventPattern (fire-and-forget). In the new gRPC
|
|
6
|
+
// stack each becomes a unary RPC that returns an Ack. Callers ignore the
|
|
7
|
+
// response if they don't care about delivery.
|
|
8
|
+
service MailService {
|
|
9
|
+
rpc SendReg(SendRegRequest) returns (MailAck);
|
|
10
|
+
rpc Send2fa(Send2faRequest) returns (MailAck);
|
|
11
|
+
rpc SendPasswordReset(SendPasswordResetRequest) returns (MailAck);
|
|
12
|
+
rpc SendRegistrationConfirm(SendRegistrationConfirmRequest) returns (MailAck);
|
|
13
|
+
|
|
14
|
+
// GDPR data-export delivery — tasks-service fires after the JSON dump
|
|
15
|
+
// lands in S3; mail-service sends the signed URL with a sensible TTL note.
|
|
16
|
+
rpc SendDataExportReady(SendDataExportReadyRequest) returns (MailAck);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message MailAck {
|
|
20
|
+
bool queued = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message SendRegRequest {
|
|
24
|
+
string user_id = 1;
|
|
25
|
+
string email = 2;
|
|
26
|
+
string username = 3;
|
|
27
|
+
string full_name = 4;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message Send2faRequest {
|
|
31
|
+
string email = 1;
|
|
32
|
+
string code = 2;
|
|
33
|
+
string username = 3;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message SendPasswordResetRequest {
|
|
37
|
+
string email = 1;
|
|
38
|
+
string code = 2;
|
|
39
|
+
string username = 3;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message SendRegistrationConfirmRequest {
|
|
43
|
+
string email = 1;
|
|
44
|
+
string code = 2;
|
|
45
|
+
string username = 3;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message SendDataExportReadyRequest {
|
|
49
|
+
string email = 1;
|
|
50
|
+
string username = 2;
|
|
51
|
+
string file_url = 3; // signed S3 URL
|
|
52
|
+
int32 url_ttl_hours = 4; // for the message body
|
|
53
|
+
int32 file_size = 5;
|
|
54
|
+
}
|