@aepstore-dev/contracts 1.102.0 → 1.104.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 +92 -5
- package/gen/auth.js +5 -0
- package/gen/auth.ts +137 -5
- package/package.json +35 -35
- package/proto/activity.proto +200 -200
- package/proto/auth.proto +247 -155
- 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,53 @@ 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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
+
|
|
37
|
+
// Logout — kill refresh tokens. LogoutCurrent kills only the one whose
|
|
38
|
+
// HMAC matches; LogoutAll wipes every row for the user.
|
|
39
|
+
rpc LogoutCurrent(LogoutCurrentRequest) returns (LogoutResponse);
|
|
40
|
+
rpc LogoutAll(LogoutAllRequest) returns (LogoutResponse);
|
|
41
|
+
|
|
42
|
+
// Self-service restore. Verifies credentials + password against a
|
|
43
|
+
// soft-deleted user, clears deletedAt/scheduledForHardDelete, and issues
|
|
44
|
+
// fresh tokens — the one auth path that DOES read deletedAt accounts.
|
|
45
|
+
rpc RestoreLogin(RestoreLoginRequest) returns (AuthResult);
|
|
46
|
+
|
|
47
|
+
// Login history. Read-only audit feed for the settings page; rows come
|
|
48
|
+
// from LoginEvent. Internal alternative: tasks-service GC.
|
|
49
|
+
rpc ListLoginHistory(ListLoginHistoryRequest) returns (ListLoginHistoryResponse);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
enum TwoFactorType {
|
|
53
|
+
NONE = 0;
|
|
54
|
+
APP = 1;
|
|
55
|
+
EMAIL = 2;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
// Requests
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
|
|
62
|
+
// Login by username OR email (one of the two must be set).
|
|
55
63
|
message LoginRequest {
|
|
56
64
|
string password = 1;
|
|
57
65
|
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
|
|
66
|
+
// Gateway-supplied audit context. LoginEvent rows for LOGIN /
|
|
67
|
+
// PASSWORD_FAIL get the same ip/user-agent that REFRESH and RESTORE
|
|
68
|
+
// already carry; the gRPC layer has no transport-level access to
|
|
61
69
|
// either, so the gateway extracts them from the HTTP request.
|
|
62
70
|
string user_agent = 3;
|
|
63
71
|
string ip = 4;
|
|
64
72
|
string trusted_device_token = 5;
|
|
65
73
|
}
|
|
66
|
-
|
|
74
|
+
|
|
67
75
|
message RegisterRequest {
|
|
68
76
|
string email = 1;
|
|
69
77
|
string username = 2;
|
|
@@ -71,13 +79,13 @@ message RegisterRequest {
|
|
|
71
79
|
string ip = 4; // optional, attached by gateway from req
|
|
72
80
|
string user_agent = 5; // optional, attached by gateway from req
|
|
73
81
|
}
|
|
74
|
-
|
|
82
|
+
|
|
75
83
|
// type ∈ { twofa, reset, totp_generate, confirm } (legacy strings)
|
|
76
|
-
message CreateCodeRequest {
|
|
77
|
-
string email = 1;
|
|
78
|
-
string type = 2;
|
|
79
|
-
}
|
|
80
|
-
|
|
84
|
+
message CreateCodeRequest {
|
|
85
|
+
string email = 1;
|
|
86
|
+
string type = 2;
|
|
87
|
+
}
|
|
88
|
+
|
|
81
89
|
// type ∈ { twofa, twofa_activate, twofa_deactivate, reset, totp, totp_activate,
|
|
82
90
|
// totp_deactivate, backup, regenerate_backup, confirm }
|
|
83
91
|
// regenerate_backup expects a current TOTP code, not an existing backup code.
|
|
@@ -95,21 +103,21 @@ message VerifyCodeRequest {
|
|
|
95
103
|
// Public login completions must use challenge_id instead.
|
|
96
104
|
bool account_verification = 9;
|
|
97
105
|
}
|
|
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
|
-
|
|
106
|
+
|
|
107
|
+
message CheckTokenRequest {
|
|
108
|
+
string token = 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
message RefreshTokenRequest {
|
|
112
|
+
string refresh_token = 1;
|
|
113
|
+
string user_agent = 2; // optional
|
|
114
|
+
string ip = 3; // optional
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
message Get2faStatusRequest {
|
|
118
|
+
string username = 1;
|
|
119
|
+
}
|
|
120
|
+
|
|
113
121
|
message GetProfileRequest {
|
|
114
122
|
string user_id = 1;
|
|
115
123
|
}
|
|
@@ -142,9 +150,10 @@ message DeletePasskeyRequest {
|
|
|
142
150
|
}
|
|
143
151
|
|
|
144
152
|
message GeneratePasskeyAuthenticationOptionsRequest {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
string
|
|
153
|
+
reserved 1;
|
|
154
|
+
reserved "credentials";
|
|
155
|
+
string user_agent = 2;
|
|
156
|
+
string ip = 3;
|
|
148
157
|
}
|
|
149
158
|
|
|
150
159
|
message VerifyPasskeyAuthenticationRequest {
|
|
@@ -154,11 +163,94 @@ message VerifyPasskeyAuthenticationRequest {
|
|
|
154
163
|
string user_agent = 3;
|
|
155
164
|
string ip = 4;
|
|
156
165
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
166
|
+
|
|
167
|
+
message CreateOAuthAuthorizationCodeRequest {
|
|
168
|
+
string user_id = 1;
|
|
169
|
+
string response_type = 2;
|
|
170
|
+
string client_id = 3;
|
|
171
|
+
string redirect_uri = 4;
|
|
172
|
+
repeated string scopes = 5;
|
|
173
|
+
string code_challenge = 6;
|
|
174
|
+
string code_challenge_method = 7;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
message ValidateOAuthAuthorizationRequestInput {
|
|
178
|
+
string response_type = 1;
|
|
179
|
+
string client_id = 2;
|
|
180
|
+
string redirect_uri = 3;
|
|
181
|
+
repeated string scopes = 4;
|
|
182
|
+
string code_challenge = 5;
|
|
183
|
+
string code_challenge_method = 6;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
message OAuthAuthorizationRequestInfo {
|
|
187
|
+
string client_id = 1;
|
|
188
|
+
string client_name = 2;
|
|
189
|
+
string redirect_uri = 3;
|
|
190
|
+
repeated string scopes = 4;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
message CreateOAuthAuthorizationCodeResponse {
|
|
194
|
+
string code = 1;
|
|
195
|
+
string redirect_uri = 2;
|
|
196
|
+
int32 expires_in = 3;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
message ExchangeOAuthTokenRequest {
|
|
200
|
+
string grant_type = 1;
|
|
201
|
+
string code = 2;
|
|
202
|
+
string refresh_token = 3;
|
|
203
|
+
string client_id = 4;
|
|
204
|
+
string client_secret = 5;
|
|
205
|
+
string redirect_uri = 6;
|
|
206
|
+
string code_verifier = 7;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
message OAuthTokenResponse {
|
|
210
|
+
string access_token = 1;
|
|
211
|
+
string token_type = 2;
|
|
212
|
+
int32 expires_in = 3;
|
|
213
|
+
string refresh_token = 4;
|
|
214
|
+
string scope = 5;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
message OAuthResourceRequest {
|
|
218
|
+
string access_token = 1;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
message OAuthPremiumInfo {
|
|
222
|
+
bool active = 1;
|
|
223
|
+
string expires_at = 2;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
message OAuthUserInfoResponse {
|
|
227
|
+
string id = 1;
|
|
228
|
+
string email = 2;
|
|
229
|
+
string username = 3;
|
|
230
|
+
string full_name = 4;
|
|
231
|
+
string avatar_url = 5;
|
|
232
|
+
OAuthPremiumInfo premium = 6;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
message OAuthProduct {
|
|
236
|
+
string id = 1;
|
|
237
|
+
string name = 2;
|
|
238
|
+
string description = 3;
|
|
239
|
+
string preview = 4;
|
|
240
|
+
string price = 5;
|
|
241
|
+
string currency = 6;
|
|
242
|
+
string public_url = 7;
|
|
243
|
+
string moderation_status = 8;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
message OAuthProductsResponse {
|
|
247
|
+
repeated OAuthProduct items = 1;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// ---------------------------------------------------------------------------
|
|
251
|
+
// Responses
|
|
252
|
+
// ---------------------------------------------------------------------------
|
|
253
|
+
|
|
162
254
|
message AuthUser {
|
|
163
255
|
string id = 1;
|
|
164
256
|
string username = 2;
|
|
@@ -166,39 +258,39 @@ message AuthUser {
|
|
|
166
258
|
string avatar_url = 4;
|
|
167
259
|
string banner_url = 5;
|
|
168
260
|
repeated string roles = 6;
|
|
169
|
-
// Reserved: 7=role, 8=is_verified, 9=two_factor_type, 10=two_factor_enabled,
|
|
170
|
-
// 11=balance. Dropped in contracts 1.51.0 — clients read 2FA flags from
|
|
261
|
+
// Reserved: 7=role, 8=is_verified, 9=two_factor_type, 10=two_factor_enabled,
|
|
262
|
+
// 11=balance. Dropped in contracts 1.51.0 — clients read 2FA flags from
|
|
171
263
|
// AuthResult / /account/settings, balance from /payments/wallet.
|
|
172
264
|
reserved 7, 8, 9, 10, 11;
|
|
173
265
|
reserved "role", "is_verified", "two_factor_type", "two_factor_enabled", "balance";
|
|
174
266
|
string avatar_border = 12;
|
|
175
267
|
}
|
|
176
|
-
|
|
177
|
-
// Unified result for login/register/createCode/verifyCode/refresh. Which fields
|
|
178
|
-
// are populated depends on the flow:
|
|
179
|
-
// - fully authenticated → access_token + refresh_token + expires_in + user
|
|
180
|
-
// - 2FA required / pending confirm → message + two_factor_required + two_factor_type + user (no tokens)
|
|
181
|
-
// - totp_generate → secret + otpauth + qr (+ user)
|
|
182
|
-
// - totp_activate → backup_codes (+ tokens/user)
|
|
183
|
-
message AuthResult {
|
|
184
|
-
string access_token = 1;
|
|
185
|
-
string refresh_token = 2;
|
|
186
|
-
int32 expires_in = 3;
|
|
187
|
-
AuthUser user = 4;
|
|
188
|
-
|
|
189
|
-
string message = 5;
|
|
190
|
-
// Renamed from `requires_2fa` in 1.52.0: the digit-after-underscore broke
|
|
191
|
-
// the grpc proto-loader's camelCase pass (`_2` isn't `_<letter>`), so the
|
|
192
|
-
// wire key stayed snake_case and never matched the camelCase handler output
|
|
193
|
-
// → always serialised false. `two_factor_required` camelCases cleanly to
|
|
194
|
-
// `twoFactorRequired` on every layer. Field number 6 is unchanged (wire-
|
|
195
|
-
// compatible).
|
|
196
|
-
bool two_factor_required = 6;
|
|
197
|
-
TwoFactorType two_factor_type = 7;
|
|
198
|
-
|
|
199
|
-
// TOTP setup extras
|
|
200
|
-
string secret = 8;
|
|
201
|
-
string otpauth = 9;
|
|
268
|
+
|
|
269
|
+
// Unified result for login/register/createCode/verifyCode/refresh. Which fields
|
|
270
|
+
// are populated depends on the flow:
|
|
271
|
+
// - fully authenticated → access_token + refresh_token + expires_in + user
|
|
272
|
+
// - 2FA required / pending confirm → message + two_factor_required + two_factor_type + user (no tokens)
|
|
273
|
+
// - totp_generate → secret + otpauth + qr (+ user)
|
|
274
|
+
// - totp_activate → backup_codes (+ tokens/user)
|
|
275
|
+
message AuthResult {
|
|
276
|
+
string access_token = 1;
|
|
277
|
+
string refresh_token = 2;
|
|
278
|
+
int32 expires_in = 3;
|
|
279
|
+
AuthUser user = 4;
|
|
280
|
+
|
|
281
|
+
string message = 5;
|
|
282
|
+
// Renamed from `requires_2fa` in 1.52.0: the digit-after-underscore broke
|
|
283
|
+
// the grpc proto-loader's camelCase pass (`_2` isn't `_<letter>`), so the
|
|
284
|
+
// wire key stayed snake_case and never matched the camelCase handler output
|
|
285
|
+
// → always serialised false. `two_factor_required` camelCases cleanly to
|
|
286
|
+
// `twoFactorRequired` on every layer. Field number 6 is unchanged (wire-
|
|
287
|
+
// compatible).
|
|
288
|
+
bool two_factor_required = 6;
|
|
289
|
+
TwoFactorType two_factor_type = 7;
|
|
290
|
+
|
|
291
|
+
// TOTP setup extras
|
|
292
|
+
string secret = 8;
|
|
293
|
+
string otpauth = 9;
|
|
202
294
|
string qr = 10; // data URL (PNG)
|
|
203
295
|
repeated string backup_codes = 11;
|
|
204
296
|
string challenge_id = 12;
|
|
@@ -206,26 +298,26 @@ message AuthResult {
|
|
|
206
298
|
string trusted_device_expires_at = 14;
|
|
207
299
|
bool security_setup_required = 15;
|
|
208
300
|
}
|
|
209
|
-
|
|
210
|
-
message TwoFactorStatusResponse {
|
|
211
|
-
TwoFactorType two_factor_type = 1;
|
|
212
|
-
bool has_2fa = 2;
|
|
213
|
-
bool is_verified = 3;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
message Empty {}
|
|
217
|
-
|
|
218
|
-
message LogoutCurrentRequest {
|
|
219
|
-
string refresh_token = 1;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
message LogoutAllRequest {
|
|
223
|
-
string user_id = 1;
|
|
224
|
-
// Current session's refresh token — excluded from the wipe so "log out
|
|
225
|
-
// everywhere" keeps THIS device signed in. Empty = revoke every session.
|
|
226
|
-
string refresh_token = 2;
|
|
227
|
-
}
|
|
228
|
-
|
|
301
|
+
|
|
302
|
+
message TwoFactorStatusResponse {
|
|
303
|
+
TwoFactorType two_factor_type = 1;
|
|
304
|
+
bool has_2fa = 2;
|
|
305
|
+
bool is_verified = 3;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
message Empty {}
|
|
309
|
+
|
|
310
|
+
message LogoutCurrentRequest {
|
|
311
|
+
string refresh_token = 1;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
message LogoutAllRequest {
|
|
315
|
+
string user_id = 1;
|
|
316
|
+
// Current session's refresh token — excluded from the wipe so "log out
|
|
317
|
+
// everywhere" keeps THIS device signed in. Empty = revoke every session.
|
|
318
|
+
string refresh_token = 2;
|
|
319
|
+
}
|
|
320
|
+
|
|
229
321
|
message LogoutResponse {
|
|
230
322
|
bool ok = 1;
|
|
231
323
|
int32 removed = 2; // number of refresh-token rows deleted
|
|
@@ -265,33 +357,33 @@ message ListPasskeysResponse {
|
|
|
265
357
|
message DeletePasskeyResponse {
|
|
266
358
|
bool ok = 1;
|
|
267
359
|
}
|
|
268
|
-
|
|
269
|
-
message RestoreLoginRequest {
|
|
270
|
-
string credentials = 1; // email or username
|
|
271
|
-
string password = 2;
|
|
272
|
-
string user_agent = 3;
|
|
273
|
-
string ip = 4;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
message ListLoginHistoryRequest {
|
|
277
|
-
string user_id = 1;
|
|
278
|
-
int32 page = 2;
|
|
279
|
-
int32 limit = 3;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
message LoginEventRow {
|
|
283
|
-
string id = 1;
|
|
284
|
-
string type = 2; // LOGIN | LOGOUT | REFRESH | TWO_FA_FAIL | PASSWORD_FAIL | BLOCKED | RESTORE
|
|
285
|
-
bool success = 3;
|
|
286
|
-
string reason = 4;
|
|
287
|
-
string ip = 5;
|
|
288
|
-
string user_agent = 6;
|
|
289
|
-
string created_at = 7;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
message ListLoginHistoryResponse {
|
|
293
|
-
repeated LoginEventRow items = 1;
|
|
294
|
-
int32 total = 2;
|
|
295
|
-
int32 page = 3;
|
|
296
|
-
int32 limit = 4;
|
|
297
|
-
}
|
|
360
|
+
|
|
361
|
+
message RestoreLoginRequest {
|
|
362
|
+
string credentials = 1; // email or username
|
|
363
|
+
string password = 2;
|
|
364
|
+
string user_agent = 3;
|
|
365
|
+
string ip = 4;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
message ListLoginHistoryRequest {
|
|
369
|
+
string user_id = 1;
|
|
370
|
+
int32 page = 2;
|
|
371
|
+
int32 limit = 3;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
message LoginEventRow {
|
|
375
|
+
string id = 1;
|
|
376
|
+
string type = 2; // LOGIN | LOGOUT | REFRESH | TWO_FA_FAIL | PASSWORD_FAIL | BLOCKED | RESTORE
|
|
377
|
+
bool success = 3;
|
|
378
|
+
string reason = 4;
|
|
379
|
+
string ip = 5;
|
|
380
|
+
string user_agent = 6;
|
|
381
|
+
string created_at = 7;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
message ListLoginHistoryResponse {
|
|
385
|
+
repeated LoginEventRow items = 1;
|
|
386
|
+
int32 total = 2;
|
|
387
|
+
int32 page = 3;
|
|
388
|
+
int32 limit = 4;
|
|
389
|
+
}
|
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
|
+
}
|