@aepstore-dev/contracts 1.98.0 → 1.100.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 +15 -0
- package/gen/auth.js +1 -0
- package/gen/auth.ts +22 -0
- package/package.json +1 -1
- package/proto/auth.proto +31 -16
package/gen/auth.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ export interface RegisterRequest {
|
|
|
27
27
|
password: string;
|
|
28
28
|
/** optional, attached by gateway from req */
|
|
29
29
|
ip: string;
|
|
30
|
+
/** optional, attached by gateway from req */
|
|
31
|
+
userAgent: string;
|
|
30
32
|
}
|
|
31
33
|
/** type ∈ { twofa, reset, totp_generate, confirm } (legacy strings) */
|
|
32
34
|
export interface CreateCodeRequest {
|
|
@@ -36,6 +38,7 @@ export interface CreateCodeRequest {
|
|
|
36
38
|
/**
|
|
37
39
|
* type ∈ { twofa, twofa_activate, twofa_deactivate, reset, totp, totp_activate,
|
|
38
40
|
* totp_deactivate, backup, regenerate_backup, confirm }
|
|
41
|
+
* regenerate_backup expects a current TOTP code, not an existing backup code.
|
|
39
42
|
* new_password is only used by the 'reset' flow.
|
|
40
43
|
*/
|
|
41
44
|
export interface VerifyCodeRequest {
|
|
@@ -70,6 +73,11 @@ export interface Get2faStatusRequest {
|
|
|
70
73
|
export interface GetProfileRequest {
|
|
71
74
|
userId: string;
|
|
72
75
|
}
|
|
76
|
+
export interface ResetUserTwoFactorRequest {
|
|
77
|
+
targetUserId: string;
|
|
78
|
+
adminId: string;
|
|
79
|
+
reason: string;
|
|
80
|
+
}
|
|
73
81
|
export interface AuthUser {
|
|
74
82
|
id: string;
|
|
75
83
|
username: string;
|
|
@@ -137,6 +145,11 @@ export interface LogoutResponse {
|
|
|
137
145
|
/** number of refresh-token rows deleted */
|
|
138
146
|
removed: number;
|
|
139
147
|
}
|
|
148
|
+
export interface ResetUserTwoFactorResponse {
|
|
149
|
+
ok: boolean;
|
|
150
|
+
previousType: TwoFactorType;
|
|
151
|
+
revokedSessions: number;
|
|
152
|
+
}
|
|
140
153
|
export interface RestoreLoginRequest {
|
|
141
154
|
/** email or username */
|
|
142
155
|
credentials: string;
|
|
@@ -184,6 +197,7 @@ export interface AuthServiceClient {
|
|
|
184
197
|
get2FaStatus(request: Get2faStatusRequest): Observable<TwoFactorStatusResponse>;
|
|
185
198
|
getProfile(request: GetProfileRequest): Observable<AuthUser>;
|
|
186
199
|
cleanupExpiredTotpSetups(request: Empty): Observable<Empty>;
|
|
200
|
+
resetUserTwoFactor(request: ResetUserTwoFactorRequest): Observable<ResetUserTwoFactorResponse>;
|
|
187
201
|
/**
|
|
188
202
|
* Logout — kill refresh tokens. LogoutCurrent kills only the one whose
|
|
189
203
|
* HMAC matches; LogoutAll wipes every row for the user.
|
|
@@ -220,6 +234,7 @@ export interface AuthServiceController {
|
|
|
220
234
|
get2FaStatus(request: Get2faStatusRequest): Promise<TwoFactorStatusResponse> | Observable<TwoFactorStatusResponse> | TwoFactorStatusResponse;
|
|
221
235
|
getProfile(request: GetProfileRequest): Promise<AuthUser> | Observable<AuthUser> | AuthUser;
|
|
222
236
|
cleanupExpiredTotpSetups(request: Empty): Promise<Empty> | Observable<Empty> | Empty;
|
|
237
|
+
resetUserTwoFactor(request: ResetUserTwoFactorRequest): Promise<ResetUserTwoFactorResponse> | Observable<ResetUserTwoFactorResponse> | ResetUserTwoFactorResponse;
|
|
223
238
|
/**
|
|
224
239
|
* Logout — kill refresh tokens. LogoutCurrent kills only the one whose
|
|
225
240
|
* HMAC matches; LogoutAll wipes every row for the user.
|
package/gen/auth.js
CHANGED
package/gen/auth.ts
CHANGED
|
@@ -39,6 +39,8 @@ export interface RegisterRequest {
|
|
|
39
39
|
password: string;
|
|
40
40
|
/** optional, attached by gateway from req */
|
|
41
41
|
ip: string;
|
|
42
|
+
/** optional, attached by gateway from req */
|
|
43
|
+
userAgent: string;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
/** type ∈ { twofa, reset, totp_generate, confirm } (legacy strings) */
|
|
@@ -50,6 +52,7 @@ export interface CreateCodeRequest {
|
|
|
50
52
|
/**
|
|
51
53
|
* type ∈ { twofa, twofa_activate, twofa_deactivate, reset, totp, totp_activate,
|
|
52
54
|
* totp_deactivate, backup, regenerate_backup, confirm }
|
|
55
|
+
* regenerate_backup expects a current TOTP code, not an existing backup code.
|
|
53
56
|
* new_password is only used by the 'reset' flow.
|
|
54
57
|
*/
|
|
55
58
|
export interface VerifyCodeRequest {
|
|
@@ -89,6 +92,12 @@ export interface GetProfileRequest {
|
|
|
89
92
|
userId: string;
|
|
90
93
|
}
|
|
91
94
|
|
|
95
|
+
export interface ResetUserTwoFactorRequest {
|
|
96
|
+
targetUserId: string;
|
|
97
|
+
adminId: string;
|
|
98
|
+
reason: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
92
101
|
export interface AuthUser {
|
|
93
102
|
id: string;
|
|
94
103
|
username: string;
|
|
@@ -163,6 +172,12 @@ export interface LogoutResponse {
|
|
|
163
172
|
removed: number;
|
|
164
173
|
}
|
|
165
174
|
|
|
175
|
+
export interface ResetUserTwoFactorResponse {
|
|
176
|
+
ok: boolean;
|
|
177
|
+
previousType: TwoFactorType;
|
|
178
|
+
revokedSessions: number;
|
|
179
|
+
}
|
|
180
|
+
|
|
166
181
|
export interface RestoreLoginRequest {
|
|
167
182
|
/** email or username */
|
|
168
183
|
credentials: string;
|
|
@@ -225,6 +240,8 @@ export interface AuthServiceClient {
|
|
|
225
240
|
|
|
226
241
|
cleanupExpiredTotpSetups(request: Empty): Observable<Empty>;
|
|
227
242
|
|
|
243
|
+
resetUserTwoFactor(request: ResetUserTwoFactorRequest): Observable<ResetUserTwoFactorResponse>;
|
|
244
|
+
|
|
228
245
|
/**
|
|
229
246
|
* Logout — kill refresh tokens. LogoutCurrent kills only the one whose
|
|
230
247
|
* HMAC matches; LogoutAll wipes every row for the user.
|
|
@@ -280,6 +297,10 @@ export interface AuthServiceController {
|
|
|
280
297
|
|
|
281
298
|
cleanupExpiredTotpSetups(request: Empty): Promise<Empty> | Observable<Empty> | Empty;
|
|
282
299
|
|
|
300
|
+
resetUserTwoFactor(
|
|
301
|
+
request: ResetUserTwoFactorRequest,
|
|
302
|
+
): Promise<ResetUserTwoFactorResponse> | Observable<ResetUserTwoFactorResponse> | ResetUserTwoFactorResponse;
|
|
303
|
+
|
|
283
304
|
/**
|
|
284
305
|
* Logout — kill refresh tokens. LogoutCurrent kills only the one whose
|
|
285
306
|
* HMAC matches; LogoutAll wipes every row for the user.
|
|
@@ -319,6 +340,7 @@ export function AuthServiceControllerMethods() {
|
|
|
319
340
|
"get2FaStatus",
|
|
320
341
|
"getProfile",
|
|
321
342
|
"cleanupExpiredTotpSetups",
|
|
343
|
+
"resetUserTwoFactor",
|
|
322
344
|
"logoutCurrent",
|
|
323
345
|
"logoutAll",
|
|
324
346
|
"restoreLogin",
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -15,9 +15,10 @@ service AuthService {
|
|
|
15
15
|
rpc VerifyCode(VerifyCodeRequest) returns (AuthResult);
|
|
16
16
|
rpc CheckToken(CheckTokenRequest) returns (AuthUser);
|
|
17
17
|
rpc RefreshToken(RefreshTokenRequest) returns (AuthResult);
|
|
18
|
-
rpc Get2faStatus(Get2faStatusRequest) returns (TwoFactorStatusResponse);
|
|
19
|
-
rpc GetProfile(GetProfileRequest) returns (AuthUser);
|
|
20
|
-
rpc CleanupExpiredTotpSetups(Empty) returns (Empty);
|
|
18
|
+
rpc Get2faStatus(Get2faStatusRequest) returns (TwoFactorStatusResponse);
|
|
19
|
+
rpc GetProfile(GetProfileRequest) returns (AuthUser);
|
|
20
|
+
rpc CleanupExpiredTotpSetups(Empty) returns (Empty);
|
|
21
|
+
rpc ResetUserTwoFactor(ResetUserTwoFactorRequest) returns (ResetUserTwoFactorResponse);
|
|
21
22
|
|
|
22
23
|
// Logout — kill refresh tokens. LogoutCurrent kills only the one whose
|
|
23
24
|
// HMAC matches; LogoutAll wipes every row for the user.
|
|
@@ -57,12 +58,13 @@ message LoginRequest {
|
|
|
57
58
|
string trusted_device_token = 5;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
message RegisterRequest {
|
|
61
|
-
string email = 1;
|
|
62
|
-
string username = 2;
|
|
63
|
-
string password = 3;
|
|
64
|
-
string ip = 4; // optional, attached by gateway from req
|
|
65
|
-
|
|
61
|
+
message RegisterRequest {
|
|
62
|
+
string email = 1;
|
|
63
|
+
string username = 2;
|
|
64
|
+
string password = 3;
|
|
65
|
+
string ip = 4; // optional, attached by gateway from req
|
|
66
|
+
string user_agent = 5; // optional, attached by gateway from req
|
|
67
|
+
}
|
|
66
68
|
|
|
67
69
|
// type ∈ { twofa, reset, totp_generate, confirm } (legacy strings)
|
|
68
70
|
message CreateCodeRequest {
|
|
@@ -72,6 +74,7 @@ message CreateCodeRequest {
|
|
|
72
74
|
|
|
73
75
|
// type ∈ { twofa, twofa_activate, twofa_deactivate, reset, totp, totp_activate,
|
|
74
76
|
// totp_deactivate, backup, regenerate_backup, confirm }
|
|
77
|
+
// regenerate_backup expects a current TOTP code, not an existing backup code.
|
|
75
78
|
// new_password is only used by the 'reset' flow.
|
|
76
79
|
message VerifyCodeRequest {
|
|
77
80
|
string email = 1;
|
|
@@ -101,9 +104,15 @@ message Get2faStatusRequest {
|
|
|
101
104
|
string username = 1;
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
message GetProfileRequest {
|
|
105
|
-
string user_id = 1;
|
|
106
|
-
}
|
|
107
|
+
message GetProfileRequest {
|
|
108
|
+
string user_id = 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
message ResetUserTwoFactorRequest {
|
|
112
|
+
string target_user_id = 1;
|
|
113
|
+
string admin_id = 2;
|
|
114
|
+
string reason = 3;
|
|
115
|
+
}
|
|
107
116
|
|
|
108
117
|
// ---------------------------------------------------------------------------
|
|
109
118
|
// Responses
|
|
@@ -176,10 +185,16 @@ message LogoutAllRequest {
|
|
|
176
185
|
string refresh_token = 2;
|
|
177
186
|
}
|
|
178
187
|
|
|
179
|
-
message LogoutResponse {
|
|
180
|
-
bool ok = 1;
|
|
181
|
-
int32 removed = 2; // number of refresh-token rows deleted
|
|
182
|
-
}
|
|
188
|
+
message LogoutResponse {
|
|
189
|
+
bool ok = 1;
|
|
190
|
+
int32 removed = 2; // number of refresh-token rows deleted
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
message ResetUserTwoFactorResponse {
|
|
194
|
+
bool ok = 1;
|
|
195
|
+
TwoFactorType previous_type = 2;
|
|
196
|
+
int32 revoked_sessions = 3;
|
|
197
|
+
}
|
|
183
198
|
|
|
184
199
|
message RestoreLoginRequest {
|
|
185
200
|
string credentials = 1; // email or username
|