@bymax-one/nest-auth 1.4.17 → 1.4.19
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/CHANGELOG.md +142 -1
- package/README.md +28 -0
- package/dist/nextjs/index.cjs +22 -3
- package/dist/nextjs/index.d.cts +23 -8
- package/dist/nextjs/index.d.ts +23 -8
- package/dist/nextjs/index.mjs +22 -3
- package/dist/react/index.cjs +29 -8
- package/dist/react/index.d.cts +28 -8
- package/dist/react/index.d.ts +28 -8
- package/dist/react/index.mjs +29 -8
- package/dist/server/index.cjs +1002 -731
- package/dist/server/index.d.cts +154 -8
- package/dist/server/index.d.ts +154 -8
- package/dist/server/index.mjs +1002 -732
- package/package.json +3 -1
package/dist/server/index.mjs
CHANGED
|
@@ -187,6 +187,10 @@ var LIBRARY_READ_HEADERS = [
|
|
|
187
187
|
// The cross-site request checks of `TrustedOriginGuard`.
|
|
188
188
|
"origin",
|
|
189
189
|
"sec-fetch-site",
|
|
190
|
+
// The compressed-body refusal of `RequestEncodingGuard`, and the check of whether a body is present.
|
|
191
|
+
"content-encoding",
|
|
192
|
+
"content-length",
|
|
193
|
+
"transfer-encoding",
|
|
190
194
|
// What the client address (`request.ip`) is derived from behind a trusted proxy.
|
|
191
195
|
"x-forwarded-for",
|
|
192
196
|
"x-forwarded-host",
|
|
@@ -1263,6 +1267,8 @@ var CurrentUser = createParamDecorator((property, ctx) => {
|
|
|
1263
1267
|
});
|
|
1264
1268
|
var IS_PUBLIC_KEY = /* @__PURE__ */ Symbol("bymax:isPublic");
|
|
1265
1269
|
var Public = /* @__PURE__ */ __name(() => SetMetadata(IS_PUBLIC_KEY, true), "Public");
|
|
1270
|
+
var REQUEST_ENCODING_KEY = /* @__PURE__ */ Symbol("bymax:requestEncoding");
|
|
1271
|
+
var RequestEncoding = /* @__PURE__ */ __name((policy) => SetMetadata(REQUEST_ENCODING_KEY, policy), "RequestEncoding");
|
|
1266
1272
|
|
|
1267
1273
|
// src/server/dto/no-control-characters.ts
|
|
1268
1274
|
var NO_CONTROL_CHARACTERS = /^[^\u0000-\u001F\u007F-\u009F]+$/;
|
|
@@ -3860,6 +3866,78 @@ function _ts_metadata10(metadataKey, metadataValue) {
|
|
|
3860
3866
|
}
|
|
3861
3867
|
}
|
|
3862
3868
|
__name(_ts_metadata10, "_ts_metadata");
|
|
3869
|
+
var BODYLESS_METHODS = /* @__PURE__ */ new Set([
|
|
3870
|
+
"GET",
|
|
3871
|
+
"HEAD",
|
|
3872
|
+
"OPTIONS",
|
|
3873
|
+
"DELETE"
|
|
3874
|
+
]);
|
|
3875
|
+
var UNSUPPORTED_MEDIA_TYPE_MESSAGE = "Unsupported media type";
|
|
3876
|
+
var RequestEncodingGuard = class {
|
|
3877
|
+
static {
|
|
3878
|
+
__name(this, "RequestEncodingGuard");
|
|
3879
|
+
}
|
|
3880
|
+
reflector;
|
|
3881
|
+
constructor(reflector) {
|
|
3882
|
+
this.reflector = reflector;
|
|
3883
|
+
}
|
|
3884
|
+
/**
|
|
3885
|
+
* @param context - The execution context of the request.
|
|
3886
|
+
* @returns `true` when the route does not check, the request declares no encoding or only
|
|
3887
|
+
* `identity`, or the route checks only requests with a body and this one has none.
|
|
3888
|
+
* @throws {@link HttpException} `415` in the `auth.validation` envelope otherwise.
|
|
3889
|
+
*/
|
|
3890
|
+
canActivate(context) {
|
|
3891
|
+
const request = context.switchToHttp().getRequest();
|
|
3892
|
+
if (BODYLESS_METHODS.has(request.method)) return true;
|
|
3893
|
+
const policy = this.reflector.get(REQUEST_ENCODING_KEY, context.getHandler());
|
|
3894
|
+
if (policy === "unchecked") return true;
|
|
3895
|
+
const header = request.headers["content-encoding"];
|
|
3896
|
+
if (header === void 0) return true;
|
|
3897
|
+
const encodings = header.split(",").map((encoding) => encoding.trim().toLowerCase()).filter((encoding) => encoding.length > 0);
|
|
3898
|
+
if (encodings.every((encoding) => encoding === "identity")) return true;
|
|
3899
|
+
if (policy === "when-body" && !carriesBody(request)) return true;
|
|
3900
|
+
throw new HttpException({
|
|
3901
|
+
error: {
|
|
3902
|
+
code: AUTH_ERROR_CODES.VALIDATION,
|
|
3903
|
+
message: UNSUPPORTED_MEDIA_TYPE_MESSAGE,
|
|
3904
|
+
details: null
|
|
3905
|
+
}
|
|
3906
|
+
}, HttpStatus.UNSUPPORTED_MEDIA_TYPE);
|
|
3907
|
+
}
|
|
3908
|
+
};
|
|
3909
|
+
RequestEncodingGuard = _ts_decorate10([
|
|
3910
|
+
Injectable(),
|
|
3911
|
+
_ts_metadata10("design:type", Function),
|
|
3912
|
+
_ts_metadata10("design:paramtypes", [
|
|
3913
|
+
typeof Reflector === "undefined" ? Object : Reflector
|
|
3914
|
+
])
|
|
3915
|
+
], RequestEncodingGuard);
|
|
3916
|
+
function carriesBody(request) {
|
|
3917
|
+
const length = request.headers["content-length"];
|
|
3918
|
+
return request.headers["transfer-encoding"] !== void 0 || length !== void 0 && length !== "0";
|
|
3919
|
+
}
|
|
3920
|
+
__name(carriesBody, "carriesBody");
|
|
3921
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
3922
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3923
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3924
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
3925
|
+
} else {
|
|
3926
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
3927
|
+
if (d = decorators[i]) {
|
|
3928
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3929
|
+
}
|
|
3930
|
+
}
|
|
3931
|
+
}
|
|
3932
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3933
|
+
}
|
|
3934
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
3935
|
+
function _ts_metadata11(metadataKey, metadataValue) {
|
|
3936
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3937
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
3938
|
+
}
|
|
3939
|
+
}
|
|
3940
|
+
__name(_ts_metadata11, "_ts_metadata");
|
|
3863
3941
|
function _ts_param6(paramIndex, decorator) {
|
|
3864
3942
|
return function(target, key) {
|
|
3865
3943
|
decorator(target, key, paramIndex);
|
|
@@ -3903,15 +3981,15 @@ var TrustedOriginGuard = class {
|
|
|
3903
3981
|
return true;
|
|
3904
3982
|
}
|
|
3905
3983
|
};
|
|
3906
|
-
TrustedOriginGuard =
|
|
3984
|
+
TrustedOriginGuard = _ts_decorate11([
|
|
3907
3985
|
Injectable(),
|
|
3908
3986
|
_ts_param6(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
3909
|
-
|
|
3910
|
-
|
|
3987
|
+
_ts_metadata11("design:type", Function),
|
|
3988
|
+
_ts_metadata11("design:paramtypes", [
|
|
3911
3989
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
3912
3990
|
])
|
|
3913
3991
|
], TrustedOriginGuard);
|
|
3914
|
-
function
|
|
3992
|
+
function _ts_decorate12(decorators, target, key, desc) {
|
|
3915
3993
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3916
3994
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
3917
3995
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3924,13 +4002,13 @@ function _ts_decorate11(decorators, target, key, desc) {
|
|
|
3924
4002
|
}
|
|
3925
4003
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3926
4004
|
}
|
|
3927
|
-
__name(
|
|
3928
|
-
function
|
|
4005
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
4006
|
+
function _ts_metadata12(metadataKey, metadataValue) {
|
|
3929
4007
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
3930
4008
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
3931
4009
|
}
|
|
3932
4010
|
}
|
|
3933
|
-
__name(
|
|
4011
|
+
__name(_ts_metadata12, "_ts_metadata");
|
|
3934
4012
|
function _ts_param7(paramIndex, decorator) {
|
|
3935
4013
|
return function(target, key) {
|
|
3936
4014
|
decorator(target, key, paramIndex);
|
|
@@ -4077,15 +4155,15 @@ var AccountStatusService = class {
|
|
|
4077
4155
|
assertNotBlocked(admin.status, this.options.blockedStatuses);
|
|
4078
4156
|
}
|
|
4079
4157
|
};
|
|
4080
|
-
AccountStatusService =
|
|
4158
|
+
AccountStatusService = _ts_decorate12([
|
|
4081
4159
|
Injectable(),
|
|
4082
4160
|
_ts_param7(0, Inject(AuthRedisService)),
|
|
4083
4161
|
_ts_param7(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
4084
4162
|
_ts_param7(2, Inject(BYMAX_AUTH_OPTIONS)),
|
|
4085
4163
|
_ts_param7(3, Optional()),
|
|
4086
4164
|
_ts_param7(3, Inject(BYMAX_AUTH_PLATFORM_USER_REPOSITORY)),
|
|
4087
|
-
|
|
4088
|
-
|
|
4165
|
+
_ts_metadata12("design:type", Function),
|
|
4166
|
+
_ts_metadata12("design:paramtypes", [
|
|
4089
4167
|
typeof AuthRedisService === "undefined" ? Object : AuthRedisService,
|
|
4090
4168
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
4091
4169
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
@@ -4094,7 +4172,7 @@ AccountStatusService = _ts_decorate11([
|
|
|
4094
4172
|
], AccountStatusService);
|
|
4095
4173
|
|
|
4096
4174
|
// src/server/guards/user-status.guard.ts
|
|
4097
|
-
function
|
|
4175
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
4098
4176
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4099
4177
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
4100
4178
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4107,13 +4185,13 @@ function _ts_decorate12(decorators, target, key, desc) {
|
|
|
4107
4185
|
}
|
|
4108
4186
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4109
4187
|
}
|
|
4110
|
-
__name(
|
|
4111
|
-
function
|
|
4188
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
4189
|
+
function _ts_metadata13(metadataKey, metadataValue) {
|
|
4112
4190
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
4113
4191
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
4114
4192
|
}
|
|
4115
4193
|
}
|
|
4116
|
-
__name(
|
|
4194
|
+
__name(_ts_metadata13, "_ts_metadata");
|
|
4117
4195
|
function _ts_param8(paramIndex, decorator) {
|
|
4118
4196
|
return function(target, key) {
|
|
4119
4197
|
decorator(target, key, paramIndex);
|
|
@@ -4148,15 +4226,15 @@ var UserStatusGuard = class {
|
|
|
4148
4226
|
return true;
|
|
4149
4227
|
}
|
|
4150
4228
|
};
|
|
4151
|
-
UserStatusGuard =
|
|
4229
|
+
UserStatusGuard = _ts_decorate13([
|
|
4152
4230
|
Injectable(),
|
|
4153
4231
|
_ts_param8(0, Inject(AccountStatusService)),
|
|
4154
|
-
|
|
4155
|
-
|
|
4232
|
+
_ts_metadata13("design:type", Function),
|
|
4233
|
+
_ts_metadata13("design:paramtypes", [
|
|
4156
4234
|
typeof AccountStatusService === "undefined" ? Object : AccountStatusService
|
|
4157
4235
|
])
|
|
4158
4236
|
], UserStatusGuard);
|
|
4159
|
-
function
|
|
4237
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
4160
4238
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4161
4239
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
4162
4240
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4169,7 +4247,7 @@ function _ts_decorate13(decorators, target, key, desc) {
|
|
|
4169
4247
|
}
|
|
4170
4248
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4171
4249
|
}
|
|
4172
|
-
__name(
|
|
4250
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
4173
4251
|
var NoStoreInterceptor = class {
|
|
4174
4252
|
static {
|
|
4175
4253
|
__name(this, "NoStoreInterceptor");
|
|
@@ -4184,7 +4262,7 @@ var NoStoreInterceptor = class {
|
|
|
4184
4262
|
return next.handle();
|
|
4185
4263
|
}
|
|
4186
4264
|
};
|
|
4187
|
-
NoStoreInterceptor =
|
|
4265
|
+
NoStoreInterceptor = _ts_decorate14([
|
|
4188
4266
|
Injectable()
|
|
4189
4267
|
], NoStoreInterceptor);
|
|
4190
4268
|
function flattenValidationErrors(errors, parentPath = "") {
|
|
@@ -4224,7 +4302,7 @@ function createAuthValidationPipe(options = {}) {
|
|
|
4224
4302
|
});
|
|
4225
4303
|
}
|
|
4226
4304
|
__name(createAuthValidationPipe, "createAuthValidationPipe");
|
|
4227
|
-
function
|
|
4305
|
+
function _ts_decorate15(decorators, target, key, desc) {
|
|
4228
4306
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4229
4307
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
4230
4308
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4237,13 +4315,13 @@ function _ts_decorate14(decorators, target, key, desc) {
|
|
|
4237
4315
|
}
|
|
4238
4316
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4239
4317
|
}
|
|
4240
|
-
__name(
|
|
4241
|
-
function
|
|
4318
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
4319
|
+
function _ts_metadata14(metadataKey, metadataValue) {
|
|
4242
4320
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
4243
4321
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
4244
4322
|
}
|
|
4245
4323
|
}
|
|
4246
|
-
__name(
|
|
4324
|
+
__name(_ts_metadata14, "_ts_metadata");
|
|
4247
4325
|
function _ts_param9(paramIndex, decorator) {
|
|
4248
4326
|
return function(target, key) {
|
|
4249
4327
|
decorator(target, key, paramIndex);
|
|
@@ -4339,17 +4417,17 @@ var BruteForceService = class _BruteForceService {
|
|
|
4339
4417
|
}
|
|
4340
4418
|
}
|
|
4341
4419
|
};
|
|
4342
|
-
BruteForceService =
|
|
4420
|
+
BruteForceService = _ts_decorate15([
|
|
4343
4421
|
Injectable(),
|
|
4344
4422
|
_ts_param9(0, Inject(AuthRedisService)),
|
|
4345
4423
|
_ts_param9(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
4346
|
-
|
|
4347
|
-
|
|
4424
|
+
_ts_metadata14("design:type", Function),
|
|
4425
|
+
_ts_metadata14("design:paramtypes", [
|
|
4348
4426
|
typeof AuthRedisService === "undefined" ? Object : AuthRedisService,
|
|
4349
4427
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
4350
4428
|
])
|
|
4351
4429
|
], BruteForceService);
|
|
4352
|
-
function
|
|
4430
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
4353
4431
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4354
4432
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
4355
4433
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4362,13 +4440,13 @@ function _ts_decorate15(decorators, target, key, desc) {
|
|
|
4362
4440
|
}
|
|
4363
4441
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4364
4442
|
}
|
|
4365
|
-
__name(
|
|
4366
|
-
function
|
|
4443
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
4444
|
+
function _ts_metadata15(metadataKey, metadataValue) {
|
|
4367
4445
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
4368
4446
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
4369
4447
|
}
|
|
4370
4448
|
}
|
|
4371
|
-
__name(
|
|
4449
|
+
__name(_ts_metadata15, "_ts_metadata");
|
|
4372
4450
|
function _ts_param10(paramIndex, decorator) {
|
|
4373
4451
|
return function(target, key) {
|
|
4374
4452
|
decorator(target, key, paramIndex);
|
|
@@ -4532,17 +4610,17 @@ var OtpService = class {
|
|
|
4532
4610
|
await sleep(Math.max(0, MIN_VERIFY_MS - (Date.now() - start)));
|
|
4533
4611
|
}
|
|
4534
4612
|
};
|
|
4535
|
-
OtpService =
|
|
4613
|
+
OtpService = _ts_decorate16([
|
|
4536
4614
|
Injectable(),
|
|
4537
4615
|
_ts_param10(0, Inject(AuthRedisService)),
|
|
4538
4616
|
_ts_param10(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
4539
|
-
|
|
4540
|
-
|
|
4617
|
+
_ts_metadata15("design:type", Function),
|
|
4618
|
+
_ts_metadata15("design:paramtypes", [
|
|
4541
4619
|
typeof AuthRedisService === "undefined" ? Object : AuthRedisService,
|
|
4542
4620
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
4543
4621
|
])
|
|
4544
4622
|
], OtpService);
|
|
4545
|
-
function
|
|
4623
|
+
function _ts_decorate17(decorators, target, key, desc) {
|
|
4546
4624
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4547
4625
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
4548
4626
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4555,13 +4633,13 @@ function _ts_decorate16(decorators, target, key, desc) {
|
|
|
4555
4633
|
}
|
|
4556
4634
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4557
4635
|
}
|
|
4558
|
-
__name(
|
|
4559
|
-
function
|
|
4636
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
4637
|
+
function _ts_metadata16(metadataKey, metadataValue) {
|
|
4560
4638
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
4561
4639
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
4562
4640
|
}
|
|
4563
4641
|
}
|
|
4564
|
-
__name(
|
|
4642
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
4565
4643
|
function _ts_param11(paramIndex, decorator) {
|
|
4566
4644
|
return function(target, key) {
|
|
4567
4645
|
decorator(target, key, paramIndex);
|
|
@@ -4856,12 +4934,12 @@ var PasswordService = class _PasswordService {
|
|
|
4856
4934
|
return timingSafeEqual(candidate, DUMMY_EXPECTED);
|
|
4857
4935
|
}
|
|
4858
4936
|
};
|
|
4859
|
-
PasswordService =
|
|
4937
|
+
PasswordService = _ts_decorate17([
|
|
4860
4938
|
Injectable(),
|
|
4861
4939
|
_ts_param11(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
4862
4940
|
_ts_param11(1, Inject(BYMAX_AUTH_BREACH_CHECKER)),
|
|
4863
|
-
|
|
4864
|
-
|
|
4941
|
+
_ts_metadata16("design:type", Function),
|
|
4942
|
+
_ts_metadata16("design:paramtypes", [
|
|
4865
4943
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
4866
4944
|
typeof IPasswordBreachChecker === "undefined" ? Object : IPasswordBreachChecker
|
|
4867
4945
|
])
|
|
@@ -4894,7 +4972,7 @@ function settleAfter(first, followUps) {
|
|
|
4894
4972
|
__name(settleAfter, "settleAfter");
|
|
4895
4973
|
|
|
4896
4974
|
// src/server/services/session.service.ts
|
|
4897
|
-
function
|
|
4975
|
+
function _ts_decorate18(decorators, target, key, desc) {
|
|
4898
4976
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4899
4977
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
4900
4978
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4907,13 +4985,13 @@ function _ts_decorate17(decorators, target, key, desc) {
|
|
|
4907
4985
|
}
|
|
4908
4986
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4909
4987
|
}
|
|
4910
|
-
__name(
|
|
4911
|
-
function
|
|
4988
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
4989
|
+
function _ts_metadata17(metadataKey, metadataValue) {
|
|
4912
4990
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
4913
4991
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
4914
4992
|
}
|
|
4915
4993
|
}
|
|
4916
|
-
__name(
|
|
4994
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
4917
4995
|
function _ts_param12(paramIndex, decorator) {
|
|
4918
4996
|
return function(target, key) {
|
|
4919
4997
|
decorator(target, key, paramIndex);
|
|
@@ -5610,15 +5688,15 @@ var SessionService = class _SessionService {
|
|
|
5610
5688
|
}
|
|
5611
5689
|
}
|
|
5612
5690
|
};
|
|
5613
|
-
SessionService =
|
|
5691
|
+
SessionService = _ts_decorate18([
|
|
5614
5692
|
Injectable(),
|
|
5615
5693
|
_ts_param12(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
5616
5694
|
_ts_param12(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
5617
5695
|
_ts_param12(2, Inject(BYMAX_AUTH_HOOKS)),
|
|
5618
5696
|
_ts_param12(2, Optional()),
|
|
5619
5697
|
_ts_param12(3, Inject(AuthRedisService)),
|
|
5620
|
-
|
|
5621
|
-
|
|
5698
|
+
_ts_metadata17("design:type", Function),
|
|
5699
|
+
_ts_metadata17("design:paramtypes", [
|
|
5622
5700
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
5623
5701
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
5624
5702
|
Object,
|
|
@@ -5641,7 +5719,7 @@ function ownerFragment(ownerId) {
|
|
|
5641
5719
|
__name(ownerFragment, "ownerFragment");
|
|
5642
5720
|
|
|
5643
5721
|
// src/server/services/token-manager.service.ts
|
|
5644
|
-
function
|
|
5722
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
5645
5723
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5646
5724
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
5647
5725
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -5654,13 +5732,13 @@ function _ts_decorate18(decorators, target, key, desc) {
|
|
|
5654
5732
|
}
|
|
5655
5733
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5656
5734
|
}
|
|
5657
|
-
__name(
|
|
5658
|
-
function
|
|
5735
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
5736
|
+
function _ts_metadata18(metadataKey, metadataValue) {
|
|
5659
5737
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
5660
5738
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
5661
5739
|
}
|
|
5662
5740
|
}
|
|
5663
|
-
__name(
|
|
5741
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
5664
5742
|
function _ts_param13(paramIndex, decorator) {
|
|
5665
5743
|
return function(target, key) {
|
|
5666
5744
|
decorator(target, key, paramIndex);
|
|
@@ -6570,15 +6648,15 @@ var TokenManagerService = class _TokenManagerService {
|
|
|
6570
6648
|
return await this.redis.del(`mfa:${sha256(jti)}`);
|
|
6571
6649
|
}
|
|
6572
6650
|
};
|
|
6573
|
-
TokenManagerService =
|
|
6651
|
+
TokenManagerService = _ts_decorate19([
|
|
6574
6652
|
Injectable(),
|
|
6575
6653
|
_ts_param13(0, Inject(JwtService)),
|
|
6576
6654
|
_ts_param13(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
6577
6655
|
_ts_param13(2, Inject(AuthRedisService)),
|
|
6578
6656
|
_ts_param13(3, Inject(BYMAX_AUTH_HOOKS)),
|
|
6579
6657
|
_ts_param13(3, Optional()),
|
|
6580
|
-
|
|
6581
|
-
|
|
6658
|
+
_ts_metadata18("design:type", Function),
|
|
6659
|
+
_ts_metadata18("design:paramtypes", [
|
|
6582
6660
|
typeof JwtService === "undefined" ? Object : JwtService,
|
|
6583
6661
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
6584
6662
|
typeof AuthRedisService === "undefined" ? Object : AuthRedisService,
|
|
@@ -6586,6 +6664,18 @@ TokenManagerService = _ts_decorate18([
|
|
|
6586
6664
|
])
|
|
6587
6665
|
], TokenManagerService);
|
|
6588
6666
|
|
|
6667
|
+
// src/server/constants/logout-pending.ts
|
|
6668
|
+
var LOGOUT_PENDING_MIN_TTL_SECONDS = 300;
|
|
6669
|
+
function logoutPendingKey(plane, sessionHash) {
|
|
6670
|
+
return `${plane === "dashboard" ? "lp" : "plp"}:${sessionHash}`;
|
|
6671
|
+
}
|
|
6672
|
+
__name(logoutPendingKey, "logoutPendingKey");
|
|
6673
|
+
function logoutPendingTtlSeconds(accessExpiresIn) {
|
|
6674
|
+
const lifetime = accessExpiresIn === void 0 ? void 0 : durationToSeconds(accessExpiresIn);
|
|
6675
|
+
return Math.max(LOGOUT_PENDING_MIN_TTL_SECONDS, Math.ceil(lifetime ?? 0));
|
|
6676
|
+
}
|
|
6677
|
+
__name(logoutPendingTtlSeconds, "logoutPendingTtlSeconds");
|
|
6678
|
+
|
|
6589
6679
|
// src/server/utils/mask-email.ts
|
|
6590
6680
|
function maskEmail(email) {
|
|
6591
6681
|
const atIndex = email.indexOf("@");
|
|
@@ -6600,6 +6690,39 @@ function normalizeEmail(email) {
|
|
|
6600
6690
|
}
|
|
6601
6691
|
__name(normalizeEmail, "normalizeEmail");
|
|
6602
6692
|
|
|
6693
|
+
// src/server/utils/pending-logout.ts
|
|
6694
|
+
async function rememberPendingLogout(redis, key, owner, ttlSeconds, logger) {
|
|
6695
|
+
try {
|
|
6696
|
+
await redis.set(key, JSON.stringify({
|
|
6697
|
+
userId: owner.userId,
|
|
6698
|
+
tenantId: owner.tenantId
|
|
6699
|
+
}), ttlSeconds);
|
|
6700
|
+
} catch (err) {
|
|
6701
|
+
logger.warn(`logout: the owner could not be kept for a retry \u2014 ${describeChannelStatus(err)}`);
|
|
6702
|
+
}
|
|
6703
|
+
}
|
|
6704
|
+
__name(rememberPendingLogout, "rememberPendingLogout");
|
|
6705
|
+
async function settlePendingLogout(redis, key, fromSession, owner, ttlSeconds, logger) {
|
|
6706
|
+
try {
|
|
6707
|
+
const removed = await redis.del(key);
|
|
6708
|
+
return fromSession || removed;
|
|
6709
|
+
} catch (err) {
|
|
6710
|
+
logger.warn(`logout: the retry marker could not be cleared \u2014 ${describeChannelStatus(err)}`);
|
|
6711
|
+
if (!fromSession) throw new AuthException(AUTH_ERROR_CODES.INTERNAL);
|
|
6712
|
+
return confirmNoStaleMarker(redis, key, owner, ttlSeconds, logger);
|
|
6713
|
+
}
|
|
6714
|
+
}
|
|
6715
|
+
__name(settlePendingLogout, "settlePendingLogout");
|
|
6716
|
+
async function confirmNoStaleMarker(redis, key, owner, ttlSeconds, logger) {
|
|
6717
|
+
try {
|
|
6718
|
+
if (await redis.get(key) === null) return true;
|
|
6719
|
+
} catch {
|
|
6720
|
+
await rememberPendingLogout(redis, key, owner, ttlSeconds, logger);
|
|
6721
|
+
}
|
|
6722
|
+
throw new AuthException(AUTH_ERROR_CODES.INTERNAL);
|
|
6723
|
+
}
|
|
6724
|
+
__name(confirmNoStaleMarker, "confirmNoStaleMarker");
|
|
6725
|
+
|
|
6603
6726
|
// src/server/utils/resolve-tenant-id.ts
|
|
6604
6727
|
async function resolveTenantId(dtoTenantId, req, resolver) {
|
|
6605
6728
|
if (resolver) {
|
|
@@ -6646,7 +6769,7 @@ function tenantScoped(user, tenantId) {
|
|
|
6646
6769
|
__name(tenantScoped, "tenantScoped");
|
|
6647
6770
|
|
|
6648
6771
|
// src/server/services/auth.service.ts
|
|
6649
|
-
function
|
|
6772
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
6650
6773
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6651
6774
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
6652
6775
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -6659,13 +6782,13 @@ function _ts_decorate19(decorators, target, key, desc) {
|
|
|
6659
6782
|
}
|
|
6660
6783
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6661
6784
|
}
|
|
6662
|
-
__name(
|
|
6663
|
-
function
|
|
6785
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
6786
|
+
function _ts_metadata19(metadataKey, metadataValue) {
|
|
6664
6787
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
6665
6788
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
6666
6789
|
}
|
|
6667
6790
|
}
|
|
6668
|
-
__name(
|
|
6791
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
6669
6792
|
function _ts_param14(paramIndex, decorator) {
|
|
6670
6793
|
return function(target, key) {
|
|
6671
6794
|
decorator(target, key, paramIndex);
|
|
@@ -7040,39 +7163,87 @@ var AuthService = class _AuthService {
|
|
|
7040
7163
|
*/
|
|
7041
7164
|
async logout(accessToken, rawRefreshToken) {
|
|
7042
7165
|
const sessionHash = sha256(rawRefreshToken);
|
|
7043
|
-
const
|
|
7166
|
+
const markerKey = logoutPendingKey("dashboard", sessionHash);
|
|
7167
|
+
const live = await this.redis.readSessionOwner(`rt:${sessionHash}`);
|
|
7168
|
+
const fromSession = live.userId !== "";
|
|
7169
|
+
const { userId, tenantId } = fromSession ? live : await this.redis.readSessionOwner(markerKey);
|
|
7044
7170
|
this.logger.log(`logout: userId=${logSafe(userId || "(no live session)")}`);
|
|
7045
|
-
|
|
7171
|
+
const failures = await settleWrites([
|
|
7172
|
+
...this.blacklistWrites(accessToken),
|
|
7173
|
+
() => this.redis.del(`rt:${sessionHash}`),
|
|
7174
|
+
() => this.redis.del(`rp:${sessionHash}`)
|
|
7175
|
+
]);
|
|
7176
|
+
await this.revokeSessionMetadata(userId, tenantId, sessionHash);
|
|
7177
|
+
const markerTtl = logoutPendingTtlSeconds(this.options.jwt.accessExpiresIn);
|
|
7178
|
+
if (failures.length > 0 && fromSession) {
|
|
7179
|
+
await rememberPendingLogout(this.redis, markerKey, {
|
|
7180
|
+
userId,
|
|
7181
|
+
tenantId
|
|
7182
|
+
}, markerTtl, this.logger);
|
|
7183
|
+
}
|
|
7184
|
+
raiseFirst(failures);
|
|
7185
|
+
if (userId !== "" && await settlePendingLogout(this.redis, markerKey, fromSession, {
|
|
7186
|
+
userId,
|
|
7187
|
+
tenantId
|
|
7188
|
+
}, markerTtl, this.logger)) {
|
|
7189
|
+
this.emitLogout(userId, tenantId);
|
|
7190
|
+
}
|
|
7191
|
+
return userId;
|
|
7192
|
+
}
|
|
7193
|
+
/**
|
|
7194
|
+
* The access-token blacklist write for a logout, or none when there is nothing to revoke.
|
|
7195
|
+
*
|
|
7196
|
+
* Verifies signature and algorithm but not expiry: an expired token is the normal case here, a
|
|
7197
|
+
* forged one must not blacklist an id it does not own. Only the verification is tolerant.
|
|
7198
|
+
*
|
|
7199
|
+
* @param accessToken - Raw access token; absent, malformed or expired yields no write.
|
|
7200
|
+
* @returns The writes to hand to `settleWrites`.
|
|
7201
|
+
*/
|
|
7202
|
+
blacklistWrites(accessToken) {
|
|
7046
7203
|
try {
|
|
7047
7204
|
const payload = this.tokenManager.verifyIgnoringExpiry(accessToken);
|
|
7048
7205
|
const remainingTtl = payload.exp - Math.floor(Date.now() / 1e3);
|
|
7049
7206
|
if (remainingTtl > 0) {
|
|
7050
|
-
|
|
7207
|
+
return [
|
|
7051
7208
|
() => this.redis.set(`rv:${payload.jti}`, "1", remainingTtl)
|
|
7052
7209
|
];
|
|
7053
7210
|
}
|
|
7054
7211
|
} catch {
|
|
7055
7212
|
}
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7213
|
+
return [];
|
|
7214
|
+
}
|
|
7215
|
+
/**
|
|
7216
|
+
* Cleans up the session's metadata through `SessionService.revokeSession()`.
|
|
7217
|
+
*
|
|
7218
|
+
* It performs an atomic SISMEMBER ownership check before deleting `sd:{hash}` and SREMing from
|
|
7219
|
+
* `sess:{userId}`. The `rt:{hash}` DEL already ran — revokeSession's internal DEL is a no-op
|
|
7220
|
+
* (Redis DEL is idempotent when the key is absent). SESSION_NOT_FOUND means the session was
|
|
7221
|
+
* evicted, already revoked, or the refresh token does not belong to this user — in all cases
|
|
7222
|
+
* authentication is already invalidated.
|
|
7223
|
+
*
|
|
7224
|
+
* The tenant is REQUIRED to name the index, and it comes off the record rather than from the
|
|
7225
|
+
* caller. A record without one is a pre-upgrade write: the contract lists `tenantId` among the
|
|
7226
|
+
* refresh session's fields, so a live record always has it. Skipping the call is the honest end
|
|
7227
|
+
* for one that does not — `rt:{hash}` is already deleted, so the session is dead either way, and
|
|
7228
|
+
* guessing a tenant would name an index belonging to nobody while reading like a revocation that
|
|
7229
|
+
* happened.
|
|
7230
|
+
*
|
|
7231
|
+
* @param userId - The owner, empty when none is known.
|
|
7232
|
+
* @param tenantId - The owner's tenant, absent when the record carried none.
|
|
7233
|
+
* @param sessionHash - The SHA-256 of the raw refresh token.
|
|
7234
|
+
*/
|
|
7235
|
+
async revokeSessionMetadata(userId, tenantId, sessionHash) {
|
|
7236
|
+
if (!this.options.sessions.enabled || !userId || tenantId === void 0) return;
|
|
7237
|
+
await this.sessionService.revokeSession({
|
|
7238
|
+
userId,
|
|
7239
|
+
tenantId,
|
|
7240
|
+
sessionHash
|
|
7241
|
+
}).catch((err) => {
|
|
7242
|
+
const errCode = err instanceof AuthException ? err.getResponse().error.code : void 0;
|
|
7243
|
+
if (errCode !== AUTH_ERROR_CODES.SESSION_NOT_FOUND) {
|
|
7244
|
+
this.logger.warn(`logout: session cleanup failed \u2014 ${describeChannelStatus(err)}`);
|
|
7245
|
+
}
|
|
7246
|
+
});
|
|
7076
7247
|
}
|
|
7077
7248
|
/**
|
|
7078
7249
|
* Announces a completed logout, the only hook `AuthService.logout` emits.
|
|
@@ -7662,7 +7833,7 @@ var AuthService = class _AuthService {
|
|
|
7662
7833
|
})();
|
|
7663
7834
|
}
|
|
7664
7835
|
};
|
|
7665
|
-
AuthService =
|
|
7836
|
+
AuthService = _ts_decorate20([
|
|
7666
7837
|
Injectable(),
|
|
7667
7838
|
_ts_param14(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
7668
7839
|
_ts_param14(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
@@ -7677,8 +7848,8 @@ AuthService = _ts_decorate19([
|
|
|
7677
7848
|
_ts_param14(8, Inject(OtpService)),
|
|
7678
7849
|
_ts_param14(9, Inject(SessionService)),
|
|
7679
7850
|
_ts_param14(10, Inject(AccountStatusService)),
|
|
7680
|
-
|
|
7681
|
-
|
|
7851
|
+
_ts_metadata19("design:type", Function),
|
|
7852
|
+
_ts_metadata19("design:paramtypes", [
|
|
7682
7853
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
7683
7854
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
7684
7855
|
Object,
|
|
@@ -7702,7 +7873,7 @@ __name(toSafeUser2, "toSafeUser");
|
|
|
7702
7873
|
var WS_TICKET_TTL_SECONDS = 30;
|
|
7703
7874
|
|
|
7704
7875
|
// src/server/services/ws-ticket.service.ts
|
|
7705
|
-
function
|
|
7876
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
7706
7877
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7707
7878
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
7708
7879
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7715,13 +7886,13 @@ function _ts_decorate20(decorators, target, key, desc) {
|
|
|
7715
7886
|
}
|
|
7716
7887
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7717
7888
|
}
|
|
7718
|
-
__name(
|
|
7719
|
-
function
|
|
7889
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
7890
|
+
function _ts_metadata20(metadataKey, metadataValue) {
|
|
7720
7891
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
7721
7892
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
7722
7893
|
}
|
|
7723
7894
|
}
|
|
7724
|
-
__name(
|
|
7895
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
7725
7896
|
function _ts_param15(paramIndex, decorator) {
|
|
7726
7897
|
return function(target, key) {
|
|
7727
7898
|
decorator(target, key, paramIndex);
|
|
@@ -7861,14 +8032,14 @@ var WsTicketService = class _WsTicketService {
|
|
|
7861
8032
|
return snapshot;
|
|
7862
8033
|
}
|
|
7863
8034
|
};
|
|
7864
|
-
WsTicketService =
|
|
8035
|
+
WsTicketService = _ts_decorate21([
|
|
7865
8036
|
Injectable(),
|
|
7866
8037
|
_ts_param15(0, Inject(AuthRedisService)),
|
|
7867
8038
|
_ts_param15(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
7868
8039
|
_ts_param15(2, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
7869
8040
|
_ts_param15(3, Inject(AuthRevocationService)),
|
|
7870
|
-
|
|
7871
|
-
|
|
8041
|
+
_ts_metadata20("design:type", Function),
|
|
8042
|
+
_ts_metadata20("design:paramtypes", [
|
|
7872
8043
|
typeof AuthRedisService === "undefined" ? Object : AuthRedisService,
|
|
7873
8044
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
7874
8045
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
@@ -7877,7 +8048,7 @@ WsTicketService = _ts_decorate20([
|
|
|
7877
8048
|
], WsTicketService);
|
|
7878
8049
|
|
|
7879
8050
|
// src/server/controllers/auth.controller.ts
|
|
7880
|
-
function
|
|
8051
|
+
function _ts_decorate22(decorators, target, key, desc) {
|
|
7881
8052
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7882
8053
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
7883
8054
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7890,13 +8061,13 @@ function _ts_decorate21(decorators, target, key, desc) {
|
|
|
7890
8061
|
}
|
|
7891
8062
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7892
8063
|
}
|
|
7893
|
-
__name(
|
|
7894
|
-
function
|
|
8064
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
8065
|
+
function _ts_metadata21(metadataKey, metadataValue) {
|
|
7895
8066
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
7896
8067
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
7897
8068
|
}
|
|
7898
8069
|
}
|
|
7899
|
-
__name(
|
|
8070
|
+
__name(_ts_metadata21, "_ts_metadata");
|
|
7900
8071
|
function _ts_param16(paramIndex, decorator) {
|
|
7901
8072
|
return function(target, key) {
|
|
7902
8073
|
decorator(target, key, paramIndex);
|
|
@@ -8055,7 +8226,7 @@ var AuthController = class {
|
|
|
8055
8226
|
await this.authService.resendVerificationEmail(dto.tenantId, dto.email, req);
|
|
8056
8227
|
}
|
|
8057
8228
|
};
|
|
8058
|
-
|
|
8229
|
+
_ts_decorate22([
|
|
8059
8230
|
Public(),
|
|
8060
8231
|
Throttle(AUTH_THROTTLE_CONFIGS.register),
|
|
8061
8232
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.register),
|
|
@@ -8065,15 +8236,15 @@ _ts_decorate21([
|
|
|
8065
8236
|
_ts_param16(2, Res({
|
|
8066
8237
|
passthrough: true
|
|
8067
8238
|
})),
|
|
8068
|
-
|
|
8069
|
-
|
|
8239
|
+
_ts_metadata21("design:type", Function),
|
|
8240
|
+
_ts_metadata21("design:paramtypes", [
|
|
8070
8241
|
typeof RegisterDto === "undefined" ? Object : RegisterDto,
|
|
8071
8242
|
typeof Request === "undefined" ? Object : Request,
|
|
8072
8243
|
typeof Response === "undefined" ? Object : Response
|
|
8073
8244
|
]),
|
|
8074
|
-
|
|
8245
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8075
8246
|
], AuthController.prototype, "register", null);
|
|
8076
|
-
|
|
8247
|
+
_ts_decorate22([
|
|
8077
8248
|
Public(),
|
|
8078
8249
|
Throttle(AUTH_THROTTLE_CONFIGS.login),
|
|
8079
8250
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.login),
|
|
@@ -8084,72 +8255,75 @@ _ts_decorate21([
|
|
|
8084
8255
|
_ts_param16(2, Res({
|
|
8085
8256
|
passthrough: true
|
|
8086
8257
|
})),
|
|
8087
|
-
|
|
8088
|
-
|
|
8258
|
+
_ts_metadata21("design:type", Function),
|
|
8259
|
+
_ts_metadata21("design:paramtypes", [
|
|
8089
8260
|
typeof LoginDto === "undefined" ? Object : LoginDto,
|
|
8090
8261
|
typeof Request === "undefined" ? Object : Request,
|
|
8091
8262
|
typeof Response === "undefined" ? Object : Response
|
|
8092
8263
|
]),
|
|
8093
|
-
|
|
8264
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8094
8265
|
], AuthController.prototype, "login", null);
|
|
8095
|
-
|
|
8266
|
+
_ts_decorate22([
|
|
8096
8267
|
Public(),
|
|
8097
8268
|
Throttle(AUTH_THROTTLE_CONFIGS.logout),
|
|
8098
8269
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.logout),
|
|
8099
8270
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
8271
|
+
RequestEncoding("unchecked"),
|
|
8100
8272
|
Post("logout"),
|
|
8101
8273
|
_ts_param16(0, Req()),
|
|
8102
8274
|
_ts_param16(1, Res({
|
|
8103
8275
|
passthrough: true
|
|
8104
8276
|
})),
|
|
8105
|
-
|
|
8106
|
-
|
|
8277
|
+
_ts_metadata21("design:type", Function),
|
|
8278
|
+
_ts_metadata21("design:paramtypes", [
|
|
8107
8279
|
typeof Request === "undefined" ? Object : Request,
|
|
8108
8280
|
typeof Response === "undefined" ? Object : Response
|
|
8109
8281
|
]),
|
|
8110
|
-
|
|
8282
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8111
8283
|
], AuthController.prototype, "logout", null);
|
|
8112
|
-
|
|
8284
|
+
_ts_decorate22([
|
|
8113
8285
|
Public(),
|
|
8114
8286
|
Throttle(AUTH_THROTTLE_CONFIGS.refresh),
|
|
8115
8287
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.refresh),
|
|
8116
8288
|
HttpCode(HttpStatus.OK),
|
|
8289
|
+
RequestEncoding("unchecked"),
|
|
8117
8290
|
Post("refresh"),
|
|
8118
8291
|
_ts_param16(0, Req()),
|
|
8119
8292
|
_ts_param16(1, Res({
|
|
8120
8293
|
passthrough: true
|
|
8121
8294
|
})),
|
|
8122
|
-
|
|
8123
|
-
|
|
8295
|
+
_ts_metadata21("design:type", Function),
|
|
8296
|
+
_ts_metadata21("design:paramtypes", [
|
|
8124
8297
|
typeof Request === "undefined" ? Object : Request,
|
|
8125
8298
|
typeof Response === "undefined" ? Object : Response
|
|
8126
8299
|
]),
|
|
8127
|
-
|
|
8300
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8128
8301
|
], AuthController.prototype, "refresh", null);
|
|
8129
|
-
|
|
8302
|
+
_ts_decorate22([
|
|
8130
8303
|
UseGuards(JwtAuthGuard),
|
|
8131
8304
|
Get("me"),
|
|
8132
8305
|
_ts_param16(0, CurrentUser()),
|
|
8133
|
-
|
|
8134
|
-
|
|
8306
|
+
_ts_metadata21("design:type", Function),
|
|
8307
|
+
_ts_metadata21("design:paramtypes", [
|
|
8135
8308
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload
|
|
8136
8309
|
]),
|
|
8137
|
-
|
|
8310
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8138
8311
|
], AuthController.prototype, "me", null);
|
|
8139
|
-
|
|
8312
|
+
_ts_decorate22([
|
|
8140
8313
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
8141
8314
|
Throttle(AUTH_THROTTLE_CONFIGS.wsTicket),
|
|
8142
8315
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.wsTicket),
|
|
8316
|
+
RequestEncoding("unchecked"),
|
|
8143
8317
|
Post("ws-ticket"),
|
|
8144
8318
|
HttpCode(HttpStatus.OK),
|
|
8145
8319
|
_ts_param16(0, CurrentUser()),
|
|
8146
|
-
|
|
8147
|
-
|
|
8320
|
+
_ts_metadata21("design:type", Function),
|
|
8321
|
+
_ts_metadata21("design:paramtypes", [
|
|
8148
8322
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload
|
|
8149
8323
|
]),
|
|
8150
|
-
|
|
8324
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8151
8325
|
], AuthController.prototype, "wsTicket", null);
|
|
8152
|
-
|
|
8326
|
+
_ts_decorate22([
|
|
8153
8327
|
Public(),
|
|
8154
8328
|
Throttle(AUTH_THROTTLE_CONFIGS.verifyEmail),
|
|
8155
8329
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.verifyEmail),
|
|
@@ -8157,14 +8331,14 @@ _ts_decorate21([
|
|
|
8157
8331
|
Post("verify-email"),
|
|
8158
8332
|
_ts_param16(0, Body()),
|
|
8159
8333
|
_ts_param16(1, Req()),
|
|
8160
|
-
|
|
8161
|
-
|
|
8334
|
+
_ts_metadata21("design:type", Function),
|
|
8335
|
+
_ts_metadata21("design:paramtypes", [
|
|
8162
8336
|
typeof VerifyEmailDto === "undefined" ? Object : VerifyEmailDto,
|
|
8163
8337
|
typeof Request === "undefined" ? Object : Request
|
|
8164
8338
|
]),
|
|
8165
|
-
|
|
8339
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8166
8340
|
], AuthController.prototype, "verifyEmail", null);
|
|
8167
|
-
|
|
8341
|
+
_ts_decorate22([
|
|
8168
8342
|
Public(),
|
|
8169
8343
|
Throttle(AUTH_THROTTLE_CONFIGS.resendVerification),
|
|
8170
8344
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.resendVerification),
|
|
@@ -8172,29 +8346,29 @@ _ts_decorate21([
|
|
|
8172
8346
|
Post("resend-verification"),
|
|
8173
8347
|
_ts_param16(0, Body()),
|
|
8174
8348
|
_ts_param16(1, Req()),
|
|
8175
|
-
|
|
8176
|
-
|
|
8349
|
+
_ts_metadata21("design:type", Function),
|
|
8350
|
+
_ts_metadata21("design:paramtypes", [
|
|
8177
8351
|
typeof ResendVerificationDto === "undefined" ? Object : ResendVerificationDto,
|
|
8178
8352
|
typeof Request === "undefined" ? Object : Request
|
|
8179
8353
|
]),
|
|
8180
|
-
|
|
8354
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8181
8355
|
], AuthController.prototype, "resendVerification", null);
|
|
8182
|
-
AuthController =
|
|
8356
|
+
AuthController = _ts_decorate22([
|
|
8183
8357
|
UseInterceptors(NoStoreInterceptor),
|
|
8184
8358
|
Controller(),
|
|
8185
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
8359
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
8186
8360
|
UsePipes(createAuthValidationPipe()),
|
|
8187
8361
|
_ts_param16(0, Inject(AuthService)),
|
|
8188
8362
|
_ts_param16(1, Inject(TokenDeliveryService)),
|
|
8189
8363
|
_ts_param16(2, Inject(WsTicketService)),
|
|
8190
|
-
|
|
8191
|
-
|
|
8364
|
+
_ts_metadata21("design:type", Function),
|
|
8365
|
+
_ts_metadata21("design:paramtypes", [
|
|
8192
8366
|
typeof AuthService === "undefined" ? Object : AuthService,
|
|
8193
8367
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService,
|
|
8194
8368
|
typeof WsTicketService === "undefined" ? Object : WsTicketService
|
|
8195
8369
|
])
|
|
8196
8370
|
], AuthController);
|
|
8197
|
-
function
|
|
8371
|
+
function _ts_decorate23(decorators, target, key, desc) {
|
|
8198
8372
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8199
8373
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8200
8374
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8207,13 +8381,13 @@ function _ts_decorate22(decorators, target, key, desc) {
|
|
|
8207
8381
|
}
|
|
8208
8382
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8209
8383
|
}
|
|
8210
|
-
__name(
|
|
8211
|
-
function
|
|
8384
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
8385
|
+
function _ts_metadata22(metadataKey, metadataValue) {
|
|
8212
8386
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8213
8387
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8214
8388
|
}
|
|
8215
8389
|
}
|
|
8216
|
-
__name(
|
|
8390
|
+
__name(_ts_metadata22, "_ts_metadata");
|
|
8217
8391
|
var ChangeEmailDto = class {
|
|
8218
8392
|
static {
|
|
8219
8393
|
__name(this, "ChangeEmailDto");
|
|
@@ -8233,20 +8407,20 @@ var ChangeEmailDto = class {
|
|
|
8233
8407
|
*/
|
|
8234
8408
|
currentPassword;
|
|
8235
8409
|
};
|
|
8236
|
-
|
|
8410
|
+
_ts_decorate23([
|
|
8237
8411
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
8238
8412
|
IsEmail(),
|
|
8239
8413
|
IsNotEmpty(),
|
|
8240
8414
|
MaxLength(255),
|
|
8241
|
-
|
|
8415
|
+
_ts_metadata22("design:type", String)
|
|
8242
8416
|
], ChangeEmailDto.prototype, "newEmail", void 0);
|
|
8243
|
-
|
|
8417
|
+
_ts_decorate23([
|
|
8244
8418
|
IsString(),
|
|
8245
8419
|
MinLength(1),
|
|
8246
8420
|
MaxLength(128),
|
|
8247
|
-
|
|
8421
|
+
_ts_metadata22("design:type", String)
|
|
8248
8422
|
], ChangeEmailDto.prototype, "currentPassword", void 0);
|
|
8249
|
-
function
|
|
8423
|
+
function _ts_decorate24(decorators, target, key, desc) {
|
|
8250
8424
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8251
8425
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8252
8426
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8259,13 +8433,13 @@ function _ts_decorate23(decorators, target, key, desc) {
|
|
|
8259
8433
|
}
|
|
8260
8434
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8261
8435
|
}
|
|
8262
|
-
__name(
|
|
8263
|
-
function
|
|
8436
|
+
__name(_ts_decorate24, "_ts_decorate");
|
|
8437
|
+
function _ts_metadata23(metadataKey, metadataValue) {
|
|
8264
8438
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8265
8439
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8266
8440
|
}
|
|
8267
8441
|
}
|
|
8268
|
-
__name(
|
|
8442
|
+
__name(_ts_metadata23, "_ts_metadata");
|
|
8269
8443
|
var ConfirmEmailChangeDto = class {
|
|
8270
8444
|
static {
|
|
8271
8445
|
__name(this, "ConfirmEmailChangeDto");
|
|
@@ -8278,13 +8452,13 @@ var ConfirmEmailChangeDto = class {
|
|
|
8278
8452
|
*/
|
|
8279
8453
|
token;
|
|
8280
8454
|
};
|
|
8281
|
-
|
|
8455
|
+
_ts_decorate24([
|
|
8282
8456
|
IsString(),
|
|
8283
8457
|
IsNotEmpty(),
|
|
8284
8458
|
Length(64, 64),
|
|
8285
|
-
|
|
8459
|
+
_ts_metadata23("design:type", String)
|
|
8286
8460
|
], ConfirmEmailChangeDto.prototype, "token", void 0);
|
|
8287
|
-
function
|
|
8461
|
+
function _ts_decorate25(decorators, target, key, desc) {
|
|
8288
8462
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8289
8463
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8290
8464
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8297,13 +8471,13 @@ function _ts_decorate24(decorators, target, key, desc) {
|
|
|
8297
8471
|
}
|
|
8298
8472
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8299
8473
|
}
|
|
8300
|
-
__name(
|
|
8301
|
-
function
|
|
8474
|
+
__name(_ts_decorate25, "_ts_decorate");
|
|
8475
|
+
function _ts_metadata24(metadataKey, metadataValue) {
|
|
8302
8476
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8303
8477
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8304
8478
|
}
|
|
8305
8479
|
}
|
|
8306
|
-
__name(
|
|
8480
|
+
__name(_ts_metadata24, "_ts_metadata");
|
|
8307
8481
|
function _ts_param17(paramIndex, decorator) {
|
|
8308
8482
|
return function(target, key) {
|
|
8309
8483
|
decorator(target, key, paramIndex);
|
|
@@ -8541,7 +8715,7 @@ var EmailChangeService = class _EmailChangeService {
|
|
|
8541
8715
|
}
|
|
8542
8716
|
}
|
|
8543
8717
|
};
|
|
8544
|
-
EmailChangeService =
|
|
8718
|
+
EmailChangeService = _ts_decorate25([
|
|
8545
8719
|
Injectable(),
|
|
8546
8720
|
_ts_param17(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
8547
8721
|
_ts_param17(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
@@ -8549,8 +8723,8 @@ EmailChangeService = _ts_decorate24([
|
|
|
8549
8723
|
_ts_param17(3, Inject(PasswordService)),
|
|
8550
8724
|
_ts_param17(4, Inject(AuthRedisService)),
|
|
8551
8725
|
_ts_param17(5, Inject(BruteForceService)),
|
|
8552
|
-
|
|
8553
|
-
|
|
8726
|
+
_ts_metadata24("design:type", Function),
|
|
8727
|
+
_ts_metadata24("design:paramtypes", [
|
|
8554
8728
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
8555
8729
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
8556
8730
|
typeof IEmailProvider === "undefined" ? Object : IEmailProvider,
|
|
@@ -8561,7 +8735,7 @@ EmailChangeService = _ts_decorate24([
|
|
|
8561
8735
|
], EmailChangeService);
|
|
8562
8736
|
|
|
8563
8737
|
// src/server/controllers/email-change.controller.ts
|
|
8564
|
-
function
|
|
8738
|
+
function _ts_decorate26(decorators, target, key, desc) {
|
|
8565
8739
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8566
8740
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8567
8741
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8574,13 +8748,13 @@ function _ts_decorate25(decorators, target, key, desc) {
|
|
|
8574
8748
|
}
|
|
8575
8749
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8576
8750
|
}
|
|
8577
|
-
__name(
|
|
8578
|
-
function
|
|
8751
|
+
__name(_ts_decorate26, "_ts_decorate");
|
|
8752
|
+
function _ts_metadata25(metadataKey, metadataValue) {
|
|
8579
8753
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8580
8754
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8581
8755
|
}
|
|
8582
8756
|
}
|
|
8583
|
-
__name(
|
|
8757
|
+
__name(_ts_metadata25, "_ts_metadata");
|
|
8584
8758
|
function _ts_param18(paramIndex, decorator) {
|
|
8585
8759
|
return function(target, key) {
|
|
8586
8760
|
decorator(target, key, paramIndex);
|
|
@@ -8633,7 +8807,7 @@ var EmailChangeController = class {
|
|
|
8633
8807
|
await this.emailChangeService.confirmChange(dto);
|
|
8634
8808
|
}
|
|
8635
8809
|
};
|
|
8636
|
-
|
|
8810
|
+
_ts_decorate26([
|
|
8637
8811
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
8638
8812
|
Throttle(AUTH_THROTTLE_CONFIGS.emailChangeRequest),
|
|
8639
8813
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.emailChangeRequest),
|
|
@@ -8641,38 +8815,38 @@ _ts_decorate25([
|
|
|
8641
8815
|
Post("change"),
|
|
8642
8816
|
_ts_param18(0, Body()),
|
|
8643
8817
|
_ts_param18(1, CurrentUser()),
|
|
8644
|
-
|
|
8645
|
-
|
|
8818
|
+
_ts_metadata25("design:type", Function),
|
|
8819
|
+
_ts_metadata25("design:paramtypes", [
|
|
8646
8820
|
typeof ChangeEmailDto === "undefined" ? Object : ChangeEmailDto,
|
|
8647
8821
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload
|
|
8648
8822
|
]),
|
|
8649
|
-
|
|
8823
|
+
_ts_metadata25("design:returntype", Promise)
|
|
8650
8824
|
], EmailChangeController.prototype, "requestChange", null);
|
|
8651
|
-
|
|
8825
|
+
_ts_decorate26([
|
|
8652
8826
|
Public(),
|
|
8653
8827
|
Throttle(AUTH_THROTTLE_CONFIGS.emailChangeConfirm),
|
|
8654
8828
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.emailChangeConfirm),
|
|
8655
8829
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
8656
8830
|
Post("change/confirm"),
|
|
8657
8831
|
_ts_param18(0, Body()),
|
|
8658
|
-
|
|
8659
|
-
|
|
8832
|
+
_ts_metadata25("design:type", Function),
|
|
8833
|
+
_ts_metadata25("design:paramtypes", [
|
|
8660
8834
|
typeof ConfirmEmailChangeDto === "undefined" ? Object : ConfirmEmailChangeDto
|
|
8661
8835
|
]),
|
|
8662
|
-
|
|
8836
|
+
_ts_metadata25("design:returntype", Promise)
|
|
8663
8837
|
], EmailChangeController.prototype, "confirmChange", null);
|
|
8664
|
-
EmailChangeController =
|
|
8838
|
+
EmailChangeController = _ts_decorate26([
|
|
8665
8839
|
UseInterceptors(NoStoreInterceptor),
|
|
8666
8840
|
Controller("email"),
|
|
8667
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
8841
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
8668
8842
|
UsePipes(createAuthValidationPipe()),
|
|
8669
8843
|
_ts_param18(0, Inject(EmailChangeService)),
|
|
8670
|
-
|
|
8671
|
-
|
|
8844
|
+
_ts_metadata25("design:type", Function),
|
|
8845
|
+
_ts_metadata25("design:paramtypes", [
|
|
8672
8846
|
typeof EmailChangeService === "undefined" ? Object : EmailChangeService
|
|
8673
8847
|
])
|
|
8674
8848
|
], EmailChangeController);
|
|
8675
|
-
function
|
|
8849
|
+
function _ts_decorate27(decorators, target, key, desc) {
|
|
8676
8850
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8677
8851
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8678
8852
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8685,13 +8859,13 @@ function _ts_decorate26(decorators, target, key, desc) {
|
|
|
8685
8859
|
}
|
|
8686
8860
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8687
8861
|
}
|
|
8688
|
-
__name(
|
|
8689
|
-
function
|
|
8862
|
+
__name(_ts_decorate27, "_ts_decorate");
|
|
8863
|
+
function _ts_metadata26(metadataKey, metadataValue) {
|
|
8690
8864
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8691
8865
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8692
8866
|
}
|
|
8693
8867
|
}
|
|
8694
|
-
__name(
|
|
8868
|
+
__name(_ts_metadata26, "_ts_metadata");
|
|
8695
8869
|
var AcceptInvitationDto = class {
|
|
8696
8870
|
static {
|
|
8697
8871
|
__name(this, "AcceptInvitationDto");
|
|
@@ -8730,24 +8904,24 @@ var AcceptInvitationDto = class {
|
|
|
8730
8904
|
*/
|
|
8731
8905
|
password;
|
|
8732
8906
|
};
|
|
8733
|
-
|
|
8907
|
+
_ts_decorate27([
|
|
8734
8908
|
IsString(),
|
|
8735
8909
|
IsNotEmpty(),
|
|
8736
8910
|
Length(64, 64),
|
|
8737
|
-
|
|
8911
|
+
_ts_metadata26("design:type", String)
|
|
8738
8912
|
], AcceptInvitationDto.prototype, "token", void 0);
|
|
8739
|
-
|
|
8913
|
+
_ts_decorate27([
|
|
8740
8914
|
IsString(),
|
|
8741
8915
|
IsNotEmpty(),
|
|
8742
8916
|
Length(2, 100),
|
|
8743
|
-
|
|
8917
|
+
_ts_metadata26("design:type", String)
|
|
8744
8918
|
], AcceptInvitationDto.prototype, "name", void 0);
|
|
8745
|
-
|
|
8919
|
+
_ts_decorate27([
|
|
8746
8920
|
IsString(),
|
|
8747
8921
|
Length(8, 128),
|
|
8748
|
-
|
|
8922
|
+
_ts_metadata26("design:type", String)
|
|
8749
8923
|
], AcceptInvitationDto.prototype, "password", void 0);
|
|
8750
|
-
function
|
|
8924
|
+
function _ts_decorate28(decorators, target, key, desc) {
|
|
8751
8925
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8752
8926
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8753
8927
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8760,13 +8934,13 @@ function _ts_decorate27(decorators, target, key, desc) {
|
|
|
8760
8934
|
}
|
|
8761
8935
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8762
8936
|
}
|
|
8763
|
-
__name(
|
|
8764
|
-
function
|
|
8937
|
+
__name(_ts_decorate28, "_ts_decorate");
|
|
8938
|
+
function _ts_metadata27(metadataKey, metadataValue) {
|
|
8765
8939
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8766
8940
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8767
8941
|
}
|
|
8768
8942
|
}
|
|
8769
|
-
__name(
|
|
8943
|
+
__name(_ts_metadata27, "_ts_metadata");
|
|
8770
8944
|
var CreateInvitationDto = class {
|
|
8771
8945
|
static {
|
|
8772
8946
|
__name(this, "CreateInvitationDto");
|
|
@@ -8797,27 +8971,27 @@ var CreateInvitationDto = class {
|
|
|
8797
8971
|
*/
|
|
8798
8972
|
tenantName;
|
|
8799
8973
|
};
|
|
8800
|
-
|
|
8974
|
+
_ts_decorate28([
|
|
8801
8975
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
8802
8976
|
IsEmail(),
|
|
8803
8977
|
IsNotEmpty(),
|
|
8804
8978
|
MaxLength(255),
|
|
8805
|
-
|
|
8979
|
+
_ts_metadata27("design:type", String)
|
|
8806
8980
|
], CreateInvitationDto.prototype, "email", void 0);
|
|
8807
|
-
|
|
8981
|
+
_ts_decorate28([
|
|
8808
8982
|
IsString(),
|
|
8809
8983
|
IsNotEmpty(),
|
|
8810
8984
|
MaxLength(64),
|
|
8811
|
-
|
|
8985
|
+
_ts_metadata27("design:type", String)
|
|
8812
8986
|
], CreateInvitationDto.prototype, "role", void 0);
|
|
8813
|
-
|
|
8987
|
+
_ts_decorate28([
|
|
8814
8988
|
IsOptional(),
|
|
8815
8989
|
IsString(),
|
|
8816
8990
|
IsNotEmpty(),
|
|
8817
8991
|
MaxLength(128),
|
|
8818
|
-
|
|
8992
|
+
_ts_metadata27("design:type", String)
|
|
8819
8993
|
], CreateInvitationDto.prototype, "tenantName", void 0);
|
|
8820
|
-
function
|
|
8994
|
+
function _ts_decorate29(decorators, target, key, desc) {
|
|
8821
8995
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8822
8996
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8823
8997
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8830,13 +9004,13 @@ function _ts_decorate28(decorators, target, key, desc) {
|
|
|
8830
9004
|
}
|
|
8831
9005
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8832
9006
|
}
|
|
8833
|
-
__name(
|
|
8834
|
-
function
|
|
9007
|
+
__name(_ts_decorate29, "_ts_decorate");
|
|
9008
|
+
function _ts_metadata28(metadataKey, metadataValue) {
|
|
8835
9009
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8836
9010
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8837
9011
|
}
|
|
8838
9012
|
}
|
|
8839
|
-
__name(
|
|
9013
|
+
__name(_ts_metadata28, "_ts_metadata");
|
|
8840
9014
|
var RevokeInvitationDto = class {
|
|
8841
9015
|
static {
|
|
8842
9016
|
__name(this, "RevokeInvitationDto");
|
|
@@ -8848,14 +9022,14 @@ var RevokeInvitationDto = class {
|
|
|
8848
9022
|
*/
|
|
8849
9023
|
email;
|
|
8850
9024
|
};
|
|
8851
|
-
|
|
9025
|
+
_ts_decorate29([
|
|
8852
9026
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
8853
9027
|
IsEmail(),
|
|
8854
9028
|
IsNotEmpty(),
|
|
8855
9029
|
MaxLength(255),
|
|
8856
|
-
|
|
9030
|
+
_ts_metadata28("design:type", String)
|
|
8857
9031
|
], RevokeInvitationDto.prototype, "email", void 0);
|
|
8858
|
-
function
|
|
9032
|
+
function _ts_decorate30(decorators, target, key, desc) {
|
|
8859
9033
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8860
9034
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8861
9035
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8868,13 +9042,13 @@ function _ts_decorate29(decorators, target, key, desc) {
|
|
|
8868
9042
|
}
|
|
8869
9043
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8870
9044
|
}
|
|
8871
|
-
__name(
|
|
8872
|
-
function
|
|
9045
|
+
__name(_ts_decorate30, "_ts_decorate");
|
|
9046
|
+
function _ts_metadata29(metadataKey, metadataValue) {
|
|
8873
9047
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8874
9048
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8875
9049
|
}
|
|
8876
9050
|
}
|
|
8877
|
-
__name(
|
|
9051
|
+
__name(_ts_metadata29, "_ts_metadata");
|
|
8878
9052
|
function _ts_param19(paramIndex, decorator) {
|
|
8879
9053
|
return function(target, key) {
|
|
8880
9054
|
decorator(target, key, paramIndex);
|
|
@@ -9357,7 +9531,7 @@ var InvitationService = class _InvitationService {
|
|
|
9357
9531
|
return result;
|
|
9358
9532
|
}
|
|
9359
9533
|
};
|
|
9360
|
-
InvitationService =
|
|
9534
|
+
InvitationService = _ts_decorate30([
|
|
9361
9535
|
Injectable(),
|
|
9362
9536
|
_ts_param19(0, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
9363
9537
|
_ts_param19(1, Inject(BYMAX_AUTH_EMAIL_PROVIDER)),
|
|
@@ -9367,8 +9541,8 @@ InvitationService = _ts_decorate29([
|
|
|
9367
9541
|
_ts_param19(5, Inject(SessionService)),
|
|
9368
9542
|
_ts_param19(6, Inject(TokenManagerService)),
|
|
9369
9543
|
_ts_param19(7, Inject(BYMAX_AUTH_OPTIONS)),
|
|
9370
|
-
|
|
9371
|
-
|
|
9544
|
+
_ts_metadata29("design:type", Function),
|
|
9545
|
+
_ts_metadata29("design:paramtypes", [
|
|
9372
9546
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
9373
9547
|
typeof IEmailProvider === "undefined" ? Object : IEmailProvider,
|
|
9374
9548
|
typeof IAuthHooks === "undefined" ? Object : IAuthHooks,
|
|
@@ -9381,7 +9555,7 @@ InvitationService = _ts_decorate29([
|
|
|
9381
9555
|
], InvitationService);
|
|
9382
9556
|
|
|
9383
9557
|
// src/server/controllers/invitation.controller.ts
|
|
9384
|
-
function
|
|
9558
|
+
function _ts_decorate31(decorators, target, key, desc) {
|
|
9385
9559
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9386
9560
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9387
9561
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9394,13 +9568,13 @@ function _ts_decorate30(decorators, target, key, desc) {
|
|
|
9394
9568
|
}
|
|
9395
9569
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9396
9570
|
}
|
|
9397
|
-
__name(
|
|
9398
|
-
function
|
|
9571
|
+
__name(_ts_decorate31, "_ts_decorate");
|
|
9572
|
+
function _ts_metadata30(metadataKey, metadataValue) {
|
|
9399
9573
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9400
9574
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9401
9575
|
}
|
|
9402
9576
|
}
|
|
9403
|
-
__name(
|
|
9577
|
+
__name(_ts_metadata30, "_ts_metadata");
|
|
9404
9578
|
function _ts_param20(paramIndex, decorator) {
|
|
9405
9579
|
return function(target, key) {
|
|
9406
9580
|
decorator(target, key, paramIndex);
|
|
@@ -9482,7 +9656,7 @@ var InvitationController = class {
|
|
|
9482
9656
|
return this.tokenDelivery.deliverAuthResponse(res, result, req);
|
|
9483
9657
|
}
|
|
9484
9658
|
};
|
|
9485
|
-
|
|
9659
|
+
_ts_decorate31([
|
|
9486
9660
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
9487
9661
|
Throttle(AUTH_THROTTLE_CONFIGS.invitationCreate),
|
|
9488
9662
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.invitationCreate),
|
|
@@ -9490,14 +9664,14 @@ _ts_decorate30([
|
|
|
9490
9664
|
Post(),
|
|
9491
9665
|
_ts_param20(0, Body()),
|
|
9492
9666
|
_ts_param20(1, CurrentUser()),
|
|
9493
|
-
|
|
9494
|
-
|
|
9667
|
+
_ts_metadata30("design:type", Function),
|
|
9668
|
+
_ts_metadata30("design:paramtypes", [
|
|
9495
9669
|
typeof CreateInvitationDto === "undefined" ? Object : CreateInvitationDto,
|
|
9496
9670
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload
|
|
9497
9671
|
]),
|
|
9498
|
-
|
|
9672
|
+
_ts_metadata30("design:returntype", Promise)
|
|
9499
9673
|
], InvitationController.prototype, "invite", null);
|
|
9500
|
-
|
|
9674
|
+
_ts_decorate31([
|
|
9501
9675
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
9502
9676
|
Throttle(AUTH_THROTTLE_CONFIGS.invitationRevoke),
|
|
9503
9677
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.invitationRevoke),
|
|
@@ -9505,14 +9679,14 @@ _ts_decorate30([
|
|
|
9505
9679
|
Post("revoke"),
|
|
9506
9680
|
_ts_param20(0, Body()),
|
|
9507
9681
|
_ts_param20(1, CurrentUser()),
|
|
9508
|
-
|
|
9509
|
-
|
|
9682
|
+
_ts_metadata30("design:type", Function),
|
|
9683
|
+
_ts_metadata30("design:paramtypes", [
|
|
9510
9684
|
typeof RevokeInvitationDto === "undefined" ? Object : RevokeInvitationDto,
|
|
9511
9685
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload
|
|
9512
9686
|
]),
|
|
9513
|
-
|
|
9687
|
+
_ts_metadata30("design:returntype", Promise)
|
|
9514
9688
|
], InvitationController.prototype, "revoke", null);
|
|
9515
|
-
|
|
9689
|
+
_ts_decorate31([
|
|
9516
9690
|
Public(),
|
|
9517
9691
|
Throttle(AUTH_THROTTLE_CONFIGS.invitationAccept),
|
|
9518
9692
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.invitationAccept),
|
|
@@ -9523,23 +9697,23 @@ _ts_decorate30([
|
|
|
9523
9697
|
_ts_param20(2, Res({
|
|
9524
9698
|
passthrough: true
|
|
9525
9699
|
})),
|
|
9526
|
-
|
|
9527
|
-
|
|
9700
|
+
_ts_metadata30("design:type", Function),
|
|
9701
|
+
_ts_metadata30("design:paramtypes", [
|
|
9528
9702
|
typeof AcceptInvitationDto === "undefined" ? Object : AcceptInvitationDto,
|
|
9529
9703
|
typeof Request === "undefined" ? Object : Request,
|
|
9530
9704
|
typeof Response === "undefined" ? Object : Response
|
|
9531
9705
|
]),
|
|
9532
|
-
|
|
9706
|
+
_ts_metadata30("design:returntype", Promise)
|
|
9533
9707
|
], InvitationController.prototype, "accept", null);
|
|
9534
|
-
InvitationController =
|
|
9708
|
+
InvitationController = _ts_decorate31([
|
|
9535
9709
|
UseInterceptors(NoStoreInterceptor),
|
|
9536
9710
|
Controller("invitations"),
|
|
9537
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
9711
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
9538
9712
|
UsePipes(createAuthValidationPipe()),
|
|
9539
9713
|
_ts_param20(0, Inject(InvitationService)),
|
|
9540
9714
|
_ts_param20(1, Inject(TokenDeliveryService)),
|
|
9541
|
-
|
|
9542
|
-
|
|
9715
|
+
_ts_metadata30("design:type", Function),
|
|
9716
|
+
_ts_metadata30("design:paramtypes", [
|
|
9543
9717
|
typeof InvitationService === "undefined" ? Object : InvitationService,
|
|
9544
9718
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService
|
|
9545
9719
|
])
|
|
@@ -9550,7 +9724,7 @@ var MFA_TEMP_COOKIE_NAME = "mfa_temp_token";
|
|
|
9550
9724
|
var MFA_TEMP_COOKIE_MAX_AGE_SECONDS = 300;
|
|
9551
9725
|
var SKIP_MFA_KEY = /* @__PURE__ */ Symbol("skipMfa");
|
|
9552
9726
|
var SkipMfa = /* @__PURE__ */ __name(() => SetMetadata(SKIP_MFA_KEY, true), "SkipMfa");
|
|
9553
|
-
function
|
|
9727
|
+
function _ts_decorate32(decorators, target, key, desc) {
|
|
9554
9728
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9555
9729
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9556
9730
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9563,13 +9737,13 @@ function _ts_decorate31(decorators, target, key, desc) {
|
|
|
9563
9737
|
}
|
|
9564
9738
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9565
9739
|
}
|
|
9566
|
-
__name(
|
|
9567
|
-
function
|
|
9740
|
+
__name(_ts_decorate32, "_ts_decorate");
|
|
9741
|
+
function _ts_metadata31(metadataKey, metadataValue) {
|
|
9568
9742
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9569
9743
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9570
9744
|
}
|
|
9571
9745
|
}
|
|
9572
|
-
__name(
|
|
9746
|
+
__name(_ts_metadata31, "_ts_metadata");
|
|
9573
9747
|
var MfaChallengeDto = class {
|
|
9574
9748
|
static {
|
|
9575
9749
|
__name(this, "MfaChallengeDto");
|
|
@@ -9605,23 +9779,23 @@ var MfaChallengeDto = class {
|
|
|
9605
9779
|
*/
|
|
9606
9780
|
code;
|
|
9607
9781
|
};
|
|
9608
|
-
|
|
9782
|
+
_ts_decorate32([
|
|
9609
9783
|
IsOptional(),
|
|
9610
9784
|
IsString(),
|
|
9611
9785
|
IsNotEmpty(),
|
|
9612
9786
|
MaxLength(512),
|
|
9613
|
-
|
|
9787
|
+
_ts_metadata31("design:type", String)
|
|
9614
9788
|
], MfaChallengeDto.prototype, "mfaTempToken", void 0);
|
|
9615
|
-
|
|
9789
|
+
_ts_decorate32([
|
|
9616
9790
|
Matches(/^(\d{6}|[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4})$/, {
|
|
9617
9791
|
message: "code must be a 6-digit TOTP code or a recovery code in XXXX-XXXX-XXXX-XXXX-XXXX-XXXX format"
|
|
9618
9792
|
}),
|
|
9619
9793
|
IsString(),
|
|
9620
9794
|
IsNotEmpty(),
|
|
9621
9795
|
MaxLength(29),
|
|
9622
|
-
|
|
9796
|
+
_ts_metadata31("design:type", String)
|
|
9623
9797
|
], MfaChallengeDto.prototype, "code", void 0);
|
|
9624
|
-
function
|
|
9798
|
+
function _ts_decorate33(decorators, target, key, desc) {
|
|
9625
9799
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9626
9800
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9627
9801
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9634,13 +9808,13 @@ function _ts_decorate32(decorators, target, key, desc) {
|
|
|
9634
9808
|
}
|
|
9635
9809
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9636
9810
|
}
|
|
9637
|
-
__name(
|
|
9638
|
-
function
|
|
9811
|
+
__name(_ts_decorate33, "_ts_decorate");
|
|
9812
|
+
function _ts_metadata32(metadataKey, metadataValue) {
|
|
9639
9813
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9640
9814
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9641
9815
|
}
|
|
9642
9816
|
}
|
|
9643
|
-
__name(
|
|
9817
|
+
__name(_ts_metadata32, "_ts_metadata");
|
|
9644
9818
|
var MfaDisableDto = class {
|
|
9645
9819
|
static {
|
|
9646
9820
|
__name(this, "MfaDisableDto");
|
|
@@ -9654,16 +9828,16 @@ var MfaDisableDto = class {
|
|
|
9654
9828
|
*/
|
|
9655
9829
|
code;
|
|
9656
9830
|
};
|
|
9657
|
-
|
|
9831
|
+
_ts_decorate33([
|
|
9658
9832
|
MaxLength(6),
|
|
9659
9833
|
Matches(/^\d{6}$/, {
|
|
9660
9834
|
message: "code must be exactly 6 digits"
|
|
9661
9835
|
}),
|
|
9662
9836
|
IsString(),
|
|
9663
9837
|
IsNotEmpty(),
|
|
9664
|
-
|
|
9838
|
+
_ts_metadata32("design:type", String)
|
|
9665
9839
|
], MfaDisableDto.prototype, "code", void 0);
|
|
9666
|
-
function
|
|
9840
|
+
function _ts_decorate34(decorators, target, key, desc) {
|
|
9667
9841
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9668
9842
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9669
9843
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9676,13 +9850,13 @@ function _ts_decorate33(decorators, target, key, desc) {
|
|
|
9676
9850
|
}
|
|
9677
9851
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9678
9852
|
}
|
|
9679
|
-
__name(
|
|
9680
|
-
function
|
|
9853
|
+
__name(_ts_decorate34, "_ts_decorate");
|
|
9854
|
+
function _ts_metadata33(metadataKey, metadataValue) {
|
|
9681
9855
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9682
9856
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9683
9857
|
}
|
|
9684
9858
|
}
|
|
9685
|
-
__name(
|
|
9859
|
+
__name(_ts_metadata33, "_ts_metadata");
|
|
9686
9860
|
var MfaRegenerateRecoveryCodesDto = class {
|
|
9687
9861
|
static {
|
|
9688
9862
|
__name(this, "MfaRegenerateRecoveryCodesDto");
|
|
@@ -9696,16 +9870,16 @@ var MfaRegenerateRecoveryCodesDto = class {
|
|
|
9696
9870
|
*/
|
|
9697
9871
|
code;
|
|
9698
9872
|
};
|
|
9699
|
-
|
|
9873
|
+
_ts_decorate34([
|
|
9700
9874
|
MaxLength(6),
|
|
9701
9875
|
Matches(/^\d{6}$/, {
|
|
9702
9876
|
message: "code must be exactly 6 digits"
|
|
9703
9877
|
}),
|
|
9704
9878
|
IsString(),
|
|
9705
9879
|
IsNotEmpty(),
|
|
9706
|
-
|
|
9880
|
+
_ts_metadata33("design:type", String)
|
|
9707
9881
|
], MfaRegenerateRecoveryCodesDto.prototype, "code", void 0);
|
|
9708
|
-
function
|
|
9882
|
+
function _ts_decorate35(decorators, target, key, desc) {
|
|
9709
9883
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9710
9884
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9711
9885
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9718,13 +9892,13 @@ function _ts_decorate34(decorators, target, key, desc) {
|
|
|
9718
9892
|
}
|
|
9719
9893
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9720
9894
|
}
|
|
9721
|
-
__name(
|
|
9722
|
-
function
|
|
9895
|
+
__name(_ts_decorate35, "_ts_decorate");
|
|
9896
|
+
function _ts_metadata34(metadataKey, metadataValue) {
|
|
9723
9897
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9724
9898
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9725
9899
|
}
|
|
9726
9900
|
}
|
|
9727
|
-
__name(
|
|
9901
|
+
__name(_ts_metadata34, "_ts_metadata");
|
|
9728
9902
|
var MfaSetupDto = class {
|
|
9729
9903
|
static {
|
|
9730
9904
|
__name(this, "MfaSetupDto");
|
|
@@ -9748,14 +9922,14 @@ var MfaSetupDto = class {
|
|
|
9748
9922
|
*/
|
|
9749
9923
|
password;
|
|
9750
9924
|
};
|
|
9751
|
-
|
|
9925
|
+
_ts_decorate35([
|
|
9752
9926
|
IsOptional(),
|
|
9753
9927
|
IsString(),
|
|
9754
9928
|
MinLength(1),
|
|
9755
9929
|
MaxLength(128),
|
|
9756
|
-
|
|
9930
|
+
_ts_metadata34("design:type", String)
|
|
9757
9931
|
], MfaSetupDto.prototype, "password", void 0);
|
|
9758
|
-
function
|
|
9932
|
+
function _ts_decorate36(decorators, target, key, desc) {
|
|
9759
9933
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9760
9934
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9761
9935
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9768,13 +9942,13 @@ function _ts_decorate35(decorators, target, key, desc) {
|
|
|
9768
9942
|
}
|
|
9769
9943
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9770
9944
|
}
|
|
9771
|
-
__name(
|
|
9772
|
-
function
|
|
9945
|
+
__name(_ts_decorate36, "_ts_decorate");
|
|
9946
|
+
function _ts_metadata35(metadataKey, metadataValue) {
|
|
9773
9947
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9774
9948
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9775
9949
|
}
|
|
9776
9950
|
}
|
|
9777
|
-
__name(
|
|
9951
|
+
__name(_ts_metadata35, "_ts_metadata");
|
|
9778
9952
|
var MfaVerifyDto = class {
|
|
9779
9953
|
static {
|
|
9780
9954
|
__name(this, "MfaVerifyDto");
|
|
@@ -9787,14 +9961,14 @@ var MfaVerifyDto = class {
|
|
|
9787
9961
|
*/
|
|
9788
9962
|
code;
|
|
9789
9963
|
};
|
|
9790
|
-
|
|
9964
|
+
_ts_decorate36([
|
|
9791
9965
|
MaxLength(6),
|
|
9792
9966
|
Matches(/^\d{6}$/, {
|
|
9793
9967
|
message: "code must be exactly 6 digits"
|
|
9794
9968
|
}),
|
|
9795
9969
|
IsString(),
|
|
9796
9970
|
IsNotEmpty(),
|
|
9797
|
-
|
|
9971
|
+
_ts_metadata35("design:type", String)
|
|
9798
9972
|
], MfaVerifyDto.prototype, "code", void 0);
|
|
9799
9973
|
var IV_LENGTH = 12;
|
|
9800
9974
|
var AUTH_TAG_BYTE_LENGTH = 16;
|
|
@@ -9858,7 +10032,7 @@ function runDetached(logger, run, failure) {
|
|
|
9858
10032
|
__name(runDetached, "runDetached");
|
|
9859
10033
|
|
|
9860
10034
|
// src/server/services/mfa.service.ts
|
|
9861
|
-
function
|
|
10035
|
+
function _ts_decorate37(decorators, target, key, desc) {
|
|
9862
10036
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9863
10037
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9864
10038
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9871,13 +10045,13 @@ function _ts_decorate36(decorators, target, key, desc) {
|
|
|
9871
10045
|
}
|
|
9872
10046
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9873
10047
|
}
|
|
9874
|
-
__name(
|
|
9875
|
-
function
|
|
10048
|
+
__name(_ts_decorate37, "_ts_decorate");
|
|
10049
|
+
function _ts_metadata36(metadataKey, metadataValue) {
|
|
9876
10050
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9877
10051
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9878
10052
|
}
|
|
9879
10053
|
}
|
|
9880
|
-
__name(
|
|
10054
|
+
__name(_ts_metadata36, "_ts_metadata");
|
|
9881
10055
|
function _ts_param21(paramIndex, decorator) {
|
|
9882
10056
|
return function(target, key) {
|
|
9883
10057
|
decorator(target, key, paramIndex);
|
|
@@ -9959,29 +10133,28 @@ var MfaService = class _MfaService {
|
|
|
9959
10133
|
* Detached from the challenge it follows: the user is already authenticated and the retired
|
|
9960
10134
|
* key still opens the secret, so a failure here costs the migration and nothing else.
|
|
9961
10135
|
*
|
|
10136
|
+
* The write replaces the whole MFA record, so it runs as a serialized transition and lands only
|
|
10137
|
+
* on a record that still holds this secret. One that no longer does was disabled or re-enrolled
|
|
10138
|
+
* since, and writing the re-encrypted old secret over it would restore a factor the user removed
|
|
10139
|
+
* and unspend the recovery codes they replaced. The comparison is on the decrypted secret, not
|
|
10140
|
+
* the ciphertext: a sibling challenge that only re-encrypted the same secret changes the
|
|
10141
|
+
* ciphertext and nothing else, and must not be mistaken for a re-enrolment.
|
|
10142
|
+
*
|
|
9962
10143
|
* @param userId - The account whose stored secret is being re-encrypted.
|
|
9963
10144
|
* @param context - Which identity plane the account belongs to.
|
|
9964
10145
|
* @param secretBase32 - The decrypted secret.
|
|
9965
|
-
* @param recoveryCodes - The stored recovery digests, written back unchanged.
|
|
9966
10146
|
* @param tenantId - The tenant the account belongs to, so the write is scoped like the read.
|
|
9967
10147
|
*/
|
|
9968
|
-
async reencryptSecret(userId, context, secretBase32,
|
|
9969
|
-
const update = {
|
|
9970
|
-
mfaEnabled: true,
|
|
9971
|
-
mfaSecret: this.encryptSecret(secretBase32),
|
|
9972
|
-
mfaRecoveryCodes: recoveryCodes
|
|
9973
|
-
};
|
|
10148
|
+
async reencryptSecret(userId, context, secretBase32, tenantId) {
|
|
9974
10149
|
try {
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
});
|
|
9984
|
-
}
|
|
10150
|
+
await this.transitionMfaRecord(context, userId, tenantId, (current) => {
|
|
10151
|
+
if (!current.mfaEnabled || !this.holdsSecret(current.mfaSecret, secretBase32)) return null;
|
|
10152
|
+
return {
|
|
10153
|
+
mfaEnabled: true,
|
|
10154
|
+
mfaSecret: this.encryptSecret(secretBase32),
|
|
10155
|
+
mfaRecoveryCodes: current.mfaRecoveryCodes ?? []
|
|
10156
|
+
};
|
|
10157
|
+
});
|
|
9985
10158
|
} catch (err) {
|
|
9986
10159
|
this.logger.error(`re-encryption under the current MFA key failed: ${describeChannelStatus(err)}`);
|
|
9987
10160
|
}
|
|
@@ -10075,6 +10248,20 @@ var MfaService = class _MfaService {
|
|
|
10075
10248
|
}
|
|
10076
10249
|
}
|
|
10077
10250
|
/**
|
|
10251
|
+
* Whether `stored` decrypts, under the current or a retired key, to `secretBase32`.
|
|
10252
|
+
*
|
|
10253
|
+
* Compares plaintext, so a record that was only re-encrypted still matches and one holding a
|
|
10254
|
+
* different secret does not. A ciphertext no key opens does not match either.
|
|
10255
|
+
*/
|
|
10256
|
+
holdsSecret(stored, secretBase32) {
|
|
10257
|
+
if (!stored) return false;
|
|
10258
|
+
try {
|
|
10259
|
+
return timingSafeCompare(this.decryptWithRotation(stored).secret, secretBase32);
|
|
10260
|
+
} catch {
|
|
10261
|
+
return false;
|
|
10262
|
+
}
|
|
10263
|
+
}
|
|
10264
|
+
/**
|
|
10078
10265
|
* Encrypts a TOTP secret for storage in the database using AES-256-GCM.
|
|
10079
10266
|
*/
|
|
10080
10267
|
encryptSecret(secret) {
|
|
@@ -10525,6 +10712,7 @@ var MfaService = class _MfaService {
|
|
|
10525
10712
|
[];
|
|
10526
10713
|
await this.transitionMfaRecord(context, userId, tenantId, (current) => {
|
|
10527
10714
|
if (!current.mfaEnabled) return null;
|
|
10715
|
+
if (!this.holdsSecret(current.mfaSecret, secretBase32)) return null;
|
|
10528
10716
|
const currentCodes = current.mfaRecoveryCodes ?? [];
|
|
10529
10717
|
const spentDigest = existingCodes[usedRecoveryIndex] ?? "";
|
|
10530
10718
|
const liveIndex = currentCodes.indexOf(spentDigest);
|
|
@@ -10542,7 +10730,7 @@ var MfaService = class _MfaService {
|
|
|
10542
10730
|
};
|
|
10543
10731
|
});
|
|
10544
10732
|
} else if (encryptedUnderRetiredKey) {
|
|
10545
|
-
void this.reencryptSecret(userId, context, secretBase32,
|
|
10733
|
+
void this.reencryptSecret(userId, context, secretBase32, tenantId);
|
|
10546
10734
|
}
|
|
10547
10735
|
this.logger.log(`challenge: MFA challenge passed userId=${logSafe(userId)} context=${context}`);
|
|
10548
10736
|
if (context === "dashboard") {
|
|
@@ -11107,7 +11295,7 @@ var MfaService = class _MfaService {
|
|
|
11107
11295
|
return admin;
|
|
11108
11296
|
}
|
|
11109
11297
|
};
|
|
11110
|
-
MfaService =
|
|
11298
|
+
MfaService = _ts_decorate37([
|
|
11111
11299
|
Injectable(),
|
|
11112
11300
|
_ts_param21(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
11113
11301
|
_ts_param21(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
@@ -11120,8 +11308,8 @@ MfaService = _ts_decorate36([
|
|
|
11120
11308
|
_ts_param21(7, Inject(SessionService)),
|
|
11121
11309
|
_ts_param21(8, Inject(BYMAX_AUTH_EMAIL_PROVIDER)),
|
|
11122
11310
|
_ts_param21(9, Inject(BYMAX_AUTH_HOOKS)),
|
|
11123
|
-
|
|
11124
|
-
|
|
11311
|
+
_ts_metadata36("design:type", Function),
|
|
11312
|
+
_ts_metadata36("design:paramtypes", [
|
|
11125
11313
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
11126
11314
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
11127
11315
|
Object,
|
|
@@ -11136,7 +11324,7 @@ MfaService = _ts_decorate36([
|
|
|
11136
11324
|
], MfaService);
|
|
11137
11325
|
|
|
11138
11326
|
// src/server/controllers/mfa.controller.ts
|
|
11139
|
-
function
|
|
11327
|
+
function _ts_decorate38(decorators, target, key, desc) {
|
|
11140
11328
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11141
11329
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11142
11330
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11149,13 +11337,13 @@ function _ts_decorate37(decorators, target, key, desc) {
|
|
|
11149
11337
|
}
|
|
11150
11338
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11151
11339
|
}
|
|
11152
|
-
__name(
|
|
11153
|
-
function
|
|
11340
|
+
__name(_ts_decorate38, "_ts_decorate");
|
|
11341
|
+
function _ts_metadata37(metadataKey, metadataValue) {
|
|
11154
11342
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11155
11343
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11156
11344
|
}
|
|
11157
11345
|
}
|
|
11158
|
-
__name(
|
|
11346
|
+
__name(_ts_metadata37, "_ts_metadata");
|
|
11159
11347
|
function _ts_param22(paramIndex, decorator) {
|
|
11160
11348
|
return function(target, key) {
|
|
11161
11349
|
decorator(target, key, paramIndex);
|
|
@@ -11350,21 +11538,22 @@ var MfaController = class {
|
|
|
11350
11538
|
return this.mfaService.regenerateRecoveryCodes(user.sub, dto.code, ip, userAgent, "dashboard", user.tenantId);
|
|
11351
11539
|
}
|
|
11352
11540
|
};
|
|
11353
|
-
|
|
11541
|
+
_ts_decorate38([
|
|
11354
11542
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
11355
11543
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaSetup),
|
|
11356
11544
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaSetup),
|
|
11545
|
+
RequestEncoding("when-body"),
|
|
11357
11546
|
Post("setup"),
|
|
11358
11547
|
_ts_param22(0, CurrentUser()),
|
|
11359
11548
|
_ts_param22(1, Body()),
|
|
11360
|
-
|
|
11361
|
-
|
|
11549
|
+
_ts_metadata37("design:type", Function),
|
|
11550
|
+
_ts_metadata37("design:paramtypes", [
|
|
11362
11551
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
11363
11552
|
typeof MfaSetupDto === "undefined" ? Object : MfaSetupDto
|
|
11364
11553
|
]),
|
|
11365
|
-
|
|
11554
|
+
_ts_metadata37("design:returntype", Promise)
|
|
11366
11555
|
], MfaController.prototype, "setup", null);
|
|
11367
|
-
|
|
11556
|
+
_ts_decorate38([
|
|
11368
11557
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
11369
11558
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaVerifyEnable),
|
|
11370
11559
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaVerifyEnable),
|
|
@@ -11373,15 +11562,15 @@ _ts_decorate37([
|
|
|
11373
11562
|
_ts_param22(0, CurrentUser()),
|
|
11374
11563
|
_ts_param22(1, Body()),
|
|
11375
11564
|
_ts_param22(2, Req()),
|
|
11376
|
-
|
|
11377
|
-
|
|
11565
|
+
_ts_metadata37("design:type", Function),
|
|
11566
|
+
_ts_metadata37("design:paramtypes", [
|
|
11378
11567
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
11379
11568
|
typeof MfaVerifyDto === "undefined" ? Object : MfaVerifyDto,
|
|
11380
11569
|
typeof Request === "undefined" ? Object : Request
|
|
11381
11570
|
]),
|
|
11382
|
-
|
|
11571
|
+
_ts_metadata37("design:returntype", Promise)
|
|
11383
11572
|
], MfaController.prototype, "verifyEnable", null);
|
|
11384
|
-
|
|
11573
|
+
_ts_decorate38([
|
|
11385
11574
|
Public(),
|
|
11386
11575
|
SkipMfa(),
|
|
11387
11576
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaChallenge),
|
|
@@ -11393,15 +11582,15 @@ _ts_decorate37([
|
|
|
11393
11582
|
_ts_param22(2, Res({
|
|
11394
11583
|
passthrough: true
|
|
11395
11584
|
})),
|
|
11396
|
-
|
|
11397
|
-
|
|
11585
|
+
_ts_metadata37("design:type", Function),
|
|
11586
|
+
_ts_metadata37("design:paramtypes", [
|
|
11398
11587
|
typeof MfaChallengeDto === "undefined" ? Object : MfaChallengeDto,
|
|
11399
11588
|
typeof Request === "undefined" ? Object : Request,
|
|
11400
11589
|
typeof Response === "undefined" ? Object : Response
|
|
11401
11590
|
]),
|
|
11402
|
-
|
|
11591
|
+
_ts_metadata37("design:returntype", Promise)
|
|
11403
11592
|
], MfaController.prototype, "challenge", null);
|
|
11404
|
-
|
|
11593
|
+
_ts_decorate38([
|
|
11405
11594
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
11406
11595
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
11407
11596
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
@@ -11410,15 +11599,15 @@ _ts_decorate37([
|
|
|
11410
11599
|
_ts_param22(0, CurrentUser()),
|
|
11411
11600
|
_ts_param22(1, Body()),
|
|
11412
11601
|
_ts_param22(2, Req()),
|
|
11413
|
-
|
|
11414
|
-
|
|
11602
|
+
_ts_metadata37("design:type", Function),
|
|
11603
|
+
_ts_metadata37("design:paramtypes", [
|
|
11415
11604
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
11416
11605
|
typeof MfaDisableDto === "undefined" ? Object : MfaDisableDto,
|
|
11417
11606
|
typeof Request === "undefined" ? Object : Request
|
|
11418
11607
|
]),
|
|
11419
|
-
|
|
11608
|
+
_ts_metadata37("design:returntype", Promise)
|
|
11420
11609
|
], MfaController.prototype, "disable", null);
|
|
11421
|
-
|
|
11610
|
+
_ts_decorate38([
|
|
11422
11611
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
11423
11612
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
11424
11613
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
@@ -11427,33 +11616,33 @@ _ts_decorate37([
|
|
|
11427
11616
|
_ts_param22(0, CurrentUser()),
|
|
11428
11617
|
_ts_param22(1, Body()),
|
|
11429
11618
|
_ts_param22(2, Req()),
|
|
11430
|
-
|
|
11431
|
-
|
|
11619
|
+
_ts_metadata37("design:type", Function),
|
|
11620
|
+
_ts_metadata37("design:paramtypes", [
|
|
11432
11621
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
11433
11622
|
typeof MfaRegenerateRecoveryCodesDto === "undefined" ? Object : MfaRegenerateRecoveryCodesDto,
|
|
11434
11623
|
typeof Request === "undefined" ? Object : Request
|
|
11435
11624
|
]),
|
|
11436
|
-
|
|
11625
|
+
_ts_metadata37("design:returntype", Promise)
|
|
11437
11626
|
], MfaController.prototype, "regenerateRecoveryCodes", null);
|
|
11438
|
-
MfaController =
|
|
11627
|
+
MfaController = _ts_decorate38([
|
|
11439
11628
|
UseInterceptors(NoStoreInterceptor),
|
|
11440
11629
|
Controller("mfa"),
|
|
11441
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
11630
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
11442
11631
|
UsePipes(createAuthValidationPipe({
|
|
11443
11632
|
forbidUnknownValues: true
|
|
11444
11633
|
})),
|
|
11445
11634
|
_ts_param22(0, Inject(MfaService)),
|
|
11446
11635
|
_ts_param22(1, Inject(TokenDeliveryService)),
|
|
11447
11636
|
_ts_param22(2, Inject(BYMAX_AUTH_OPTIONS)),
|
|
11448
|
-
|
|
11449
|
-
|
|
11637
|
+
_ts_metadata37("design:type", Function),
|
|
11638
|
+
_ts_metadata37("design:paramtypes", [
|
|
11450
11639
|
typeof MfaService === "undefined" ? Object : MfaService,
|
|
11451
11640
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService,
|
|
11452
11641
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
11453
11642
|
])
|
|
11454
11643
|
], MfaController);
|
|
11455
11644
|
var Authenticated = /* @__PURE__ */ __name(() => SetMetadata(IS_PUBLIC_KEY, false), "Authenticated");
|
|
11456
|
-
function
|
|
11645
|
+
function _ts_decorate39(decorators, target, key, desc) {
|
|
11457
11646
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11458
11647
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11459
11648
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11466,13 +11655,13 @@ function _ts_decorate38(decorators, target, key, desc) {
|
|
|
11466
11655
|
}
|
|
11467
11656
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11468
11657
|
}
|
|
11469
|
-
__name(
|
|
11470
|
-
function
|
|
11658
|
+
__name(_ts_decorate39, "_ts_decorate");
|
|
11659
|
+
function _ts_metadata38(metadataKey, metadataValue) {
|
|
11471
11660
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11472
11661
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11473
11662
|
}
|
|
11474
11663
|
}
|
|
11475
|
-
__name(
|
|
11664
|
+
__name(_ts_metadata38, "_ts_metadata");
|
|
11476
11665
|
var ChangePasswordDto = class {
|
|
11477
11666
|
static {
|
|
11478
11667
|
__name(this, "ChangePasswordDto");
|
|
@@ -11525,26 +11714,26 @@ var ChangePasswordDto = class {
|
|
|
11525
11714
|
*/
|
|
11526
11715
|
refreshToken;
|
|
11527
11716
|
};
|
|
11528
|
-
|
|
11717
|
+
_ts_decorate39([
|
|
11529
11718
|
IsString(),
|
|
11530
11719
|
MinLength(1),
|
|
11531
11720
|
MaxLength(128),
|
|
11532
|
-
|
|
11721
|
+
_ts_metadata38("design:type", String)
|
|
11533
11722
|
], ChangePasswordDto.prototype, "currentPassword", void 0);
|
|
11534
|
-
|
|
11723
|
+
_ts_decorate39([
|
|
11535
11724
|
IsString(),
|
|
11536
11725
|
MinLength(8),
|
|
11537
11726
|
MaxLength(128),
|
|
11538
|
-
|
|
11727
|
+
_ts_metadata38("design:type", String)
|
|
11539
11728
|
], ChangePasswordDto.prototype, "newPassword", void 0);
|
|
11540
|
-
|
|
11729
|
+
_ts_decorate39([
|
|
11541
11730
|
IsOptional(),
|
|
11542
11731
|
IsString(),
|
|
11543
11732
|
IsNotEmpty(),
|
|
11544
11733
|
MaxLength(2048),
|
|
11545
|
-
|
|
11734
|
+
_ts_metadata38("design:type", String)
|
|
11546
11735
|
], ChangePasswordDto.prototype, "refreshToken", void 0);
|
|
11547
|
-
function
|
|
11736
|
+
function _ts_decorate40(decorators, target, key, desc) {
|
|
11548
11737
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11549
11738
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11550
11739
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11557,13 +11746,13 @@ function _ts_decorate39(decorators, target, key, desc) {
|
|
|
11557
11746
|
}
|
|
11558
11747
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11559
11748
|
}
|
|
11560
|
-
__name(
|
|
11561
|
-
function
|
|
11749
|
+
__name(_ts_decorate40, "_ts_decorate");
|
|
11750
|
+
function _ts_metadata39(metadataKey, metadataValue) {
|
|
11562
11751
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11563
11752
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11564
11753
|
}
|
|
11565
11754
|
}
|
|
11566
|
-
__name(
|
|
11755
|
+
__name(_ts_metadata39, "_ts_metadata");
|
|
11567
11756
|
var ForgotPasswordDto = class {
|
|
11568
11757
|
static {
|
|
11569
11758
|
__name(this, "ForgotPasswordDto");
|
|
@@ -11579,13 +11768,13 @@ var ForgotPasswordDto = class {
|
|
|
11579
11768
|
*/
|
|
11580
11769
|
tenantId;
|
|
11581
11770
|
};
|
|
11582
|
-
|
|
11771
|
+
_ts_decorate40([
|
|
11583
11772
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
11584
11773
|
IsEmail(),
|
|
11585
11774
|
MaxLength(255),
|
|
11586
|
-
|
|
11775
|
+
_ts_metadata39("design:type", String)
|
|
11587
11776
|
], ForgotPasswordDto.prototype, "email", void 0);
|
|
11588
|
-
|
|
11777
|
+
_ts_decorate40([
|
|
11589
11778
|
IsOptional(),
|
|
11590
11779
|
IsString(),
|
|
11591
11780
|
IsNotEmpty(),
|
|
@@ -11593,9 +11782,9 @@ _ts_decorate39([
|
|
|
11593
11782
|
Matches(NO_CONTROL_CHARACTERS, {
|
|
11594
11783
|
message: "tenantId must not contain control characters"
|
|
11595
11784
|
}),
|
|
11596
|
-
|
|
11785
|
+
_ts_metadata39("design:type", String)
|
|
11597
11786
|
], ForgotPasswordDto.prototype, "tenantId", void 0);
|
|
11598
|
-
function
|
|
11787
|
+
function _ts_decorate41(decorators, target, key, desc) {
|
|
11599
11788
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11600
11789
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11601
11790
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11608,13 +11797,13 @@ function _ts_decorate40(decorators, target, key, desc) {
|
|
|
11608
11797
|
}
|
|
11609
11798
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11610
11799
|
}
|
|
11611
|
-
__name(
|
|
11612
|
-
function
|
|
11800
|
+
__name(_ts_decorate41, "_ts_decorate");
|
|
11801
|
+
function _ts_metadata40(metadataKey, metadataValue) {
|
|
11613
11802
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11614
11803
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11615
11804
|
}
|
|
11616
11805
|
}
|
|
11617
|
-
__name(
|
|
11806
|
+
__name(_ts_metadata40, "_ts_metadata");
|
|
11618
11807
|
var ResendOtpDto = class {
|
|
11619
11808
|
static {
|
|
11620
11809
|
__name(this, "ResendOtpDto");
|
|
@@ -11629,13 +11818,13 @@ var ResendOtpDto = class {
|
|
|
11629
11818
|
*/
|
|
11630
11819
|
tenantId;
|
|
11631
11820
|
};
|
|
11632
|
-
|
|
11821
|
+
_ts_decorate41([
|
|
11633
11822
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
11634
11823
|
IsEmail(),
|
|
11635
11824
|
MaxLength(255),
|
|
11636
|
-
|
|
11825
|
+
_ts_metadata40("design:type", String)
|
|
11637
11826
|
], ResendOtpDto.prototype, "email", void 0);
|
|
11638
|
-
|
|
11827
|
+
_ts_decorate41([
|
|
11639
11828
|
IsOptional(),
|
|
11640
11829
|
IsString(),
|
|
11641
11830
|
IsNotEmpty(),
|
|
@@ -11643,9 +11832,9 @@ _ts_decorate40([
|
|
|
11643
11832
|
Matches(NO_CONTROL_CHARACTERS, {
|
|
11644
11833
|
message: "tenantId must not contain control characters"
|
|
11645
11834
|
}),
|
|
11646
|
-
|
|
11835
|
+
_ts_metadata40("design:type", String)
|
|
11647
11836
|
], ResendOtpDto.prototype, "tenantId", void 0);
|
|
11648
|
-
function
|
|
11837
|
+
function _ts_decorate42(decorators, target, key, desc) {
|
|
11649
11838
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11650
11839
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11651
11840
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11658,13 +11847,13 @@ function _ts_decorate41(decorators, target, key, desc) {
|
|
|
11658
11847
|
}
|
|
11659
11848
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11660
11849
|
}
|
|
11661
|
-
__name(
|
|
11662
|
-
function
|
|
11850
|
+
__name(_ts_decorate42, "_ts_decorate");
|
|
11851
|
+
function _ts_metadata41(metadataKey, metadataValue) {
|
|
11663
11852
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11664
11853
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11665
11854
|
}
|
|
11666
11855
|
}
|
|
11667
|
-
__name(
|
|
11856
|
+
__name(_ts_metadata41, "_ts_metadata");
|
|
11668
11857
|
var ResetPasswordDto = class {
|
|
11669
11858
|
static {
|
|
11670
11859
|
__name(this, "ResetPasswordDto");
|
|
@@ -11711,38 +11900,38 @@ var ResetPasswordDto = class {
|
|
|
11711
11900
|
*/
|
|
11712
11901
|
tenantId;
|
|
11713
11902
|
};
|
|
11714
|
-
|
|
11903
|
+
_ts_decorate42([
|
|
11715
11904
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
11716
11905
|
IsEmail(),
|
|
11717
11906
|
MaxLength(255),
|
|
11718
|
-
|
|
11907
|
+
_ts_metadata41("design:type", String)
|
|
11719
11908
|
], ResetPasswordDto.prototype, "email", void 0);
|
|
11720
|
-
|
|
11909
|
+
_ts_decorate42([
|
|
11721
11910
|
IsString(),
|
|
11722
11911
|
MinLength(8),
|
|
11723
11912
|
MaxLength(128),
|
|
11724
|
-
|
|
11913
|
+
_ts_metadata41("design:type", String)
|
|
11725
11914
|
], ResetPasswordDto.prototype, "newPassword", void 0);
|
|
11726
|
-
|
|
11915
|
+
_ts_decorate42([
|
|
11727
11916
|
IsOptional(),
|
|
11728
11917
|
IsString(),
|
|
11729
11918
|
IsNotEmpty(),
|
|
11730
11919
|
MaxLength(2048),
|
|
11731
|
-
|
|
11920
|
+
_ts_metadata41("design:type", String)
|
|
11732
11921
|
], ResetPasswordDto.prototype, "token", void 0);
|
|
11733
|
-
|
|
11922
|
+
_ts_decorate42([
|
|
11734
11923
|
IsOptional(),
|
|
11735
11924
|
IsString(),
|
|
11736
11925
|
Length(4, 8),
|
|
11737
|
-
|
|
11926
|
+
_ts_metadata41("design:type", String)
|
|
11738
11927
|
], ResetPasswordDto.prototype, "otp", void 0);
|
|
11739
|
-
|
|
11928
|
+
_ts_decorate42([
|
|
11740
11929
|
IsOptional(),
|
|
11741
11930
|
IsString(),
|
|
11742
11931
|
Length(64, 64),
|
|
11743
|
-
|
|
11932
|
+
_ts_metadata41("design:type", String)
|
|
11744
11933
|
], ResetPasswordDto.prototype, "verifiedToken", void 0);
|
|
11745
|
-
|
|
11934
|
+
_ts_decorate42([
|
|
11746
11935
|
IsOptional(),
|
|
11747
11936
|
IsString(),
|
|
11748
11937
|
IsNotEmpty(),
|
|
@@ -11750,9 +11939,9 @@ _ts_decorate41([
|
|
|
11750
11939
|
Matches(NO_CONTROL_CHARACTERS, {
|
|
11751
11940
|
message: "tenantId must not contain control characters"
|
|
11752
11941
|
}),
|
|
11753
|
-
|
|
11942
|
+
_ts_metadata41("design:type", String)
|
|
11754
11943
|
], ResetPasswordDto.prototype, "tenantId", void 0);
|
|
11755
|
-
function
|
|
11944
|
+
function _ts_decorate43(decorators, target, key, desc) {
|
|
11756
11945
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11757
11946
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11758
11947
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11765,13 +11954,13 @@ function _ts_decorate42(decorators, target, key, desc) {
|
|
|
11765
11954
|
}
|
|
11766
11955
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11767
11956
|
}
|
|
11768
|
-
__name(
|
|
11769
|
-
function
|
|
11957
|
+
__name(_ts_decorate43, "_ts_decorate");
|
|
11958
|
+
function _ts_metadata42(metadataKey, metadataValue) {
|
|
11770
11959
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11771
11960
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11772
11961
|
}
|
|
11773
11962
|
}
|
|
11774
|
-
__name(
|
|
11963
|
+
__name(_ts_metadata42, "_ts_metadata");
|
|
11775
11964
|
var VerifyOtpDto = class {
|
|
11776
11965
|
static {
|
|
11777
11966
|
__name(this, "VerifyOtpDto");
|
|
@@ -11793,18 +11982,18 @@ var VerifyOtpDto = class {
|
|
|
11793
11982
|
*/
|
|
11794
11983
|
tenantId;
|
|
11795
11984
|
};
|
|
11796
|
-
|
|
11985
|
+
_ts_decorate43([
|
|
11797
11986
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
11798
11987
|
IsEmail(),
|
|
11799
11988
|
MaxLength(255),
|
|
11800
|
-
|
|
11989
|
+
_ts_metadata42("design:type", String)
|
|
11801
11990
|
], VerifyOtpDto.prototype, "email", void 0);
|
|
11802
|
-
|
|
11991
|
+
_ts_decorate43([
|
|
11803
11992
|
IsString(),
|
|
11804
11993
|
Length(4, 8),
|
|
11805
|
-
|
|
11994
|
+
_ts_metadata42("design:type", String)
|
|
11806
11995
|
], VerifyOtpDto.prototype, "otp", void 0);
|
|
11807
|
-
|
|
11996
|
+
_ts_decorate43([
|
|
11808
11997
|
IsOptional(),
|
|
11809
11998
|
IsString(),
|
|
11810
11999
|
IsNotEmpty(),
|
|
@@ -11812,9 +12001,54 @@ _ts_decorate42([
|
|
|
11812
12001
|
Matches(NO_CONTROL_CHARACTERS, {
|
|
11813
12002
|
message: "tenantId must not contain control characters"
|
|
11814
12003
|
}),
|
|
11815
|
-
|
|
12004
|
+
_ts_metadata42("design:type", String)
|
|
11816
12005
|
], VerifyOtpDto.prototype, "tenantId", void 0);
|
|
11817
|
-
|
|
12006
|
+
|
|
12007
|
+
// src/server/utils/answer-reset-request.ts
|
|
12008
|
+
async function answerResetRequest(deps, request) {
|
|
12009
|
+
const { redis, logger } = deps;
|
|
12010
|
+
const { label, cooldownKey, start } = request;
|
|
12011
|
+
const holdFloor = /* @__PURE__ */ __name(() => sleep(Math.max(0, request.floorMs - (Date.now() - start))), "holdFloor");
|
|
12012
|
+
const releaseCooldown = /* @__PURE__ */ __name(async () => {
|
|
12013
|
+
try {
|
|
12014
|
+
await redis.del(cooldownKey);
|
|
12015
|
+
} catch (err) {
|
|
12016
|
+
logger.error(`${label}: cooldown release failed: ${describeChannelStatus(err)}`);
|
|
12017
|
+
}
|
|
12018
|
+
}, "releaseCooldown");
|
|
12019
|
+
let claimed;
|
|
12020
|
+
try {
|
|
12021
|
+
claimed = await redis.setnx(cooldownKey, request.cooldownSeconds);
|
|
12022
|
+
} catch (err) {
|
|
12023
|
+
logger.error(`${label}: cooldown store failed: ${describeChannelStatus(err)}`);
|
|
12024
|
+
await holdFloor();
|
|
12025
|
+
throw new AuthException(AUTH_ERROR_CODES.INTERNAL);
|
|
12026
|
+
}
|
|
12027
|
+
if (!claimed) {
|
|
12028
|
+
await holdFloor();
|
|
12029
|
+
return;
|
|
12030
|
+
}
|
|
12031
|
+
let account;
|
|
12032
|
+
try {
|
|
12033
|
+
account = await request.findAccount();
|
|
12034
|
+
} catch (err) {
|
|
12035
|
+
logger.error(`${label}: account lookup failed: ${describeChannelStatus(err)}`);
|
|
12036
|
+
await releaseCooldown();
|
|
12037
|
+
await holdFloor();
|
|
12038
|
+
throw new AuthException(AUTH_ERROR_CODES.INTERNAL);
|
|
12039
|
+
}
|
|
12040
|
+
try {
|
|
12041
|
+
if (account && !request.isBlocked(account.status)) await request.issue(account.id);
|
|
12042
|
+
} catch (err) {
|
|
12043
|
+
logger.error(`${label}: unexpected error: ${describeChannelStatus(err)}`);
|
|
12044
|
+
await releaseCooldown();
|
|
12045
|
+
}
|
|
12046
|
+
await holdFloor();
|
|
12047
|
+
}
|
|
12048
|
+
__name(answerResetRequest, "answerResetRequest");
|
|
12049
|
+
|
|
12050
|
+
// src/server/services/password-reset.service.ts
|
|
12051
|
+
function _ts_decorate44(decorators, target, key, desc) {
|
|
11818
12052
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11819
12053
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11820
12054
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11827,13 +12061,13 @@ function _ts_decorate43(decorators, target, key, desc) {
|
|
|
11827
12061
|
}
|
|
11828
12062
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11829
12063
|
}
|
|
11830
|
-
__name(
|
|
11831
|
-
function
|
|
12064
|
+
__name(_ts_decorate44, "_ts_decorate");
|
|
12065
|
+
function _ts_metadata43(metadataKey, metadataValue) {
|
|
11832
12066
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11833
12067
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11834
12068
|
}
|
|
11835
12069
|
}
|
|
11836
|
-
__name(
|
|
12070
|
+
__name(_ts_metadata43, "_ts_metadata");
|
|
11837
12071
|
function _ts_param23(paramIndex, decorator) {
|
|
11838
12072
|
return function(target, key) {
|
|
11839
12073
|
decorator(target, key, paramIndex);
|
|
@@ -11879,12 +12113,14 @@ var PasswordResetService = class _PasswordResetService {
|
|
|
11879
12113
|
* inactive, or suspended), issues a reset token or OTP (depending on
|
|
11880
12114
|
* `options.passwordReset.method`) and sends it via the email provider.
|
|
11881
12115
|
*
|
|
11882
|
-
* **
|
|
12116
|
+
* **Resolves the same way** whether or not the account exists:
|
|
11883
12117
|
* - The email does not exist in the tenant.
|
|
11884
12118
|
* - The account is blocked.
|
|
11885
|
-
* -
|
|
12119
|
+
* - Issuing or storing the code, or the email provider, fails for an account that exists.
|
|
11886
12120
|
*
|
|
11887
|
-
*
|
|
12121
|
+
* A failure that is the same for every address, the resend-cooldown store or the account
|
|
12122
|
+
* lookup, throws `INTERNAL` (500) after the floor, and the cooldown this call took is
|
|
12123
|
+
* released. This anti-enumeration design ensures the response cannot be used to probe
|
|
11888
12124
|
* whether an email address is registered.
|
|
11889
12125
|
*
|
|
11890
12126
|
* Timing normalization: the method always takes at least {@link ANTI_ENUM_MIN_MS}
|
|
@@ -11900,30 +12136,8 @@ var PasswordResetService = class _PasswordResetService {
|
|
|
11900
12136
|
email: normalizeEmail(dto.email)
|
|
11901
12137
|
};
|
|
11902
12138
|
const start = Date.now();
|
|
11903
|
-
const
|
|
11904
|
-
|
|
11905
|
-
if (!wasSet) {
|
|
11906
|
-
await sleep(Math.max(0, ANTI_ENUM_MIN_MS2 - (Date.now() - start)));
|
|
11907
|
-
return;
|
|
11908
|
-
}
|
|
11909
|
-
try {
|
|
11910
|
-
const user = tenantScoped(await this.userRepo.findByEmail({
|
|
11911
|
-
email: dto.email,
|
|
11912
|
-
tenantId
|
|
11913
|
-
}), tenantId);
|
|
11914
|
-
if (user && !this.isBlocked(user.status)) {
|
|
11915
|
-
const { method } = this.options.passwordReset;
|
|
11916
|
-
if (method === "otp") {
|
|
11917
|
-
await this.sendOtp(dto.email, tenantId, user.id);
|
|
11918
|
-
} else {
|
|
11919
|
-
await this.sendToken(dto.email, tenantId, user.id);
|
|
11920
|
-
}
|
|
11921
|
-
}
|
|
11922
|
-
} catch (err) {
|
|
11923
|
-
this.logger.error(`initiateReset: unexpected error: ${describeChannelStatus(err)}`);
|
|
11924
|
-
} finally {
|
|
11925
|
-
await sleep(Math.max(0, ANTI_ENUM_MIN_MS2 - (Date.now() - start)));
|
|
11926
|
-
}
|
|
12139
|
+
const { method } = this.options.passwordReset;
|
|
12140
|
+
await this.answerResetRequest("initiateReset", dto.email, tenantId, start, (userId) => method === "otp" ? this.sendOtp(dto.email, tenantId, userId) : this.sendToken(dto.email, tenantId, userId));
|
|
11927
12141
|
}
|
|
11928
12142
|
/**
|
|
11929
12143
|
* Resets the user's password using a verified proof (token, OTP, or verifiedToken).
|
|
@@ -12029,8 +12243,9 @@ var PasswordResetService = class _PasswordResetService {
|
|
|
12029
12243
|
* Requests a new password-reset OTP for the given email address.
|
|
12030
12244
|
*
|
|
12031
12245
|
* Subject to an atomic 60-second cooldown enforced via a Redis NX key to
|
|
12032
|
-
* prevent OTP flooding.
|
|
12033
|
-
*
|
|
12246
|
+
* prevent OTP flooding. Resolves the same way whether or not the user exists —
|
|
12247
|
+
* anti-enumeration principle; a failure of the cooldown store or the account lookup
|
|
12248
|
+
* throws `INTERNAL` (500) after the floor and releases the cooldown.
|
|
12034
12249
|
*
|
|
12035
12250
|
* Timing normalization: always takes at least {@link ANTI_ENUM_MIN_MS} ms.
|
|
12036
12251
|
*
|
|
@@ -12044,26 +12259,29 @@ var PasswordResetService = class _PasswordResetService {
|
|
|
12044
12259
|
email: normalizeEmail(dto.email)
|
|
12045
12260
|
};
|
|
12046
12261
|
const start = Date.now();
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
|
|
12262
|
+
await this.answerResetRequest("resendOtp", dto.email, tenantId, start, (userId) => this.sendOtp(dto.email, tenantId, userId));
|
|
12263
|
+
}
|
|
12264
|
+
// ---------------------------------------------------------------------------
|
|
12265
|
+
// Private helpers — reset requests
|
|
12266
|
+
// ---------------------------------------------------------------------------
|
|
12267
|
+
/** Runs one `forgot-password` or `resend-otp` request through the shared failure rule. */
|
|
12268
|
+
answerResetRequest(label, email, tenantId, start, issue) {
|
|
12269
|
+
return answerResetRequest({
|
|
12270
|
+
redis: this.redis,
|
|
12271
|
+
logger: this.logger
|
|
12272
|
+
}, {
|
|
12273
|
+
label,
|
|
12274
|
+
cooldownKey: `resend:${PASSWORD_RESET_PURPOSE}:${this.otpIdentifier(tenantId, email)}`,
|
|
12275
|
+
cooldownSeconds: RESEND_COOLDOWN_SECONDS,
|
|
12276
|
+
floorMs: ANTI_ENUM_MIN_MS2,
|
|
12277
|
+
start,
|
|
12278
|
+
findAccount: /* @__PURE__ */ __name(async () => tenantScoped(await this.userRepo.findByEmail({
|
|
12279
|
+
email,
|
|
12057
12280
|
tenantId
|
|
12058
|
-
}), tenantId)
|
|
12059
|
-
|
|
12060
|
-
|
|
12061
|
-
|
|
12062
|
-
} catch (err) {
|
|
12063
|
-
this.logger.error(`resendOtp: unexpected error: ${describeChannelStatus(err)}`);
|
|
12064
|
-
} finally {
|
|
12065
|
-
await sleep(Math.max(0, ANTI_ENUM_MIN_MS2 - (Date.now() - start)));
|
|
12066
|
-
}
|
|
12281
|
+
}), tenantId), "findAccount"),
|
|
12282
|
+
isBlocked: /* @__PURE__ */ __name((status) => this.isBlocked(status), "isBlocked"),
|
|
12283
|
+
issue
|
|
12284
|
+
});
|
|
12067
12285
|
}
|
|
12068
12286
|
// ---------------------------------------------------------------------------
|
|
12069
12287
|
// Private helpers — reset paths
|
|
@@ -12449,7 +12667,7 @@ var PasswordResetService = class _PasswordResetService {
|
|
|
12449
12667
|
};
|
|
12450
12668
|
}
|
|
12451
12669
|
};
|
|
12452
|
-
PasswordResetService =
|
|
12670
|
+
PasswordResetService = _ts_decorate44([
|
|
12453
12671
|
Injectable(),
|
|
12454
12672
|
_ts_param23(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
12455
12673
|
_ts_param23(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
@@ -12462,8 +12680,8 @@ PasswordResetService = _ts_decorate43([
|
|
|
12462
12680
|
_ts_param23(6, Inject(AuthRedisService)),
|
|
12463
12681
|
_ts_param23(7, Inject(SessionService)),
|
|
12464
12682
|
_ts_param23(8, Inject(BruteForceService)),
|
|
12465
|
-
|
|
12466
|
-
|
|
12683
|
+
_ts_metadata43("design:type", Function),
|
|
12684
|
+
_ts_metadata43("design:paramtypes", [
|
|
12467
12685
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
12468
12686
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
12469
12687
|
Object,
|
|
@@ -12482,7 +12700,7 @@ function toSafeUser3(user) {
|
|
|
12482
12700
|
__name(toSafeUser3, "toSafeUser");
|
|
12483
12701
|
|
|
12484
12702
|
// src/server/controllers/password-reset.controller.ts
|
|
12485
|
-
function
|
|
12703
|
+
function _ts_decorate45(decorators, target, key, desc) {
|
|
12486
12704
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12487
12705
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
12488
12706
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -12495,13 +12713,13 @@ function _ts_decorate44(decorators, target, key, desc) {
|
|
|
12495
12713
|
}
|
|
12496
12714
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12497
12715
|
}
|
|
12498
|
-
__name(
|
|
12499
|
-
function
|
|
12716
|
+
__name(_ts_decorate45, "_ts_decorate");
|
|
12717
|
+
function _ts_metadata44(metadataKey, metadataValue) {
|
|
12500
12718
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
12501
12719
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
12502
12720
|
}
|
|
12503
12721
|
}
|
|
12504
|
-
__name(
|
|
12722
|
+
__name(_ts_metadata44, "_ts_metadata");
|
|
12505
12723
|
function _ts_param24(paramIndex, decorator) {
|
|
12506
12724
|
return function(target, key) {
|
|
12507
12725
|
decorator(target, key, paramIndex);
|
|
@@ -12525,8 +12743,9 @@ var PasswordResetController = class {
|
|
|
12525
12743
|
* Initiates a password reset for the given email address.
|
|
12526
12744
|
*
|
|
12527
12745
|
* Sends a reset token or OTP to the user's email if the account exists and
|
|
12528
|
-
* is eligible.
|
|
12529
|
-
* (anti-enumeration; the body is pinned by the wire contract).
|
|
12746
|
+
* is eligible. Answers `200 OK` with an empty JSON object whether or not the account exists
|
|
12747
|
+
* (anti-enumeration; the body is pinned by the wire contract). Only a failure that is the same
|
|
12748
|
+
* for every address, the cooldown store or the account lookup, answers `500` `auth.internal`.
|
|
12530
12749
|
*
|
|
12531
12750
|
* @param dto - Validated DTO with `email` and `tenantId`.
|
|
12532
12751
|
* @returns An empty object.
|
|
@@ -12613,8 +12832,9 @@ var PasswordResetController = class {
|
|
|
12613
12832
|
* Re-sends the password-reset OTP for the given email address.
|
|
12614
12833
|
*
|
|
12615
12834
|
* Subject to a 60-second atomic cooldown per `(tenantId, email)` pair.
|
|
12616
|
-
*
|
|
12617
|
-
* the body is pinned by the wire contract).
|
|
12835
|
+
* Answers `200 OK` with an empty JSON object whether or not the account exists
|
|
12836
|
+
* (anti-enumeration; the body is pinned by the wire contract). Only a failure that is the same
|
|
12837
|
+
* for every address, the cooldown store or the account lookup, answers `500` `auth.internal`.
|
|
12618
12838
|
*
|
|
12619
12839
|
* @param dto - Validated DTO with `email` and `tenantId`.
|
|
12620
12840
|
* @returns An empty object.
|
|
@@ -12624,35 +12844,35 @@ var PasswordResetController = class {
|
|
|
12624
12844
|
return {};
|
|
12625
12845
|
}
|
|
12626
12846
|
};
|
|
12627
|
-
|
|
12847
|
+
_ts_decorate45([
|
|
12628
12848
|
Throttle(AUTH_THROTTLE_CONFIGS.forgotPassword),
|
|
12629
12849
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.forgotPassword),
|
|
12630
12850
|
HttpCode(HttpStatus.OK),
|
|
12631
12851
|
Post("forgot-password"),
|
|
12632
12852
|
_ts_param24(0, Body()),
|
|
12633
12853
|
_ts_param24(1, Req()),
|
|
12634
|
-
|
|
12635
|
-
|
|
12854
|
+
_ts_metadata44("design:type", Function),
|
|
12855
|
+
_ts_metadata44("design:paramtypes", [
|
|
12636
12856
|
typeof ForgotPasswordDto === "undefined" ? Object : ForgotPasswordDto,
|
|
12637
12857
|
typeof Request === "undefined" ? Object : Request
|
|
12638
12858
|
]),
|
|
12639
|
-
|
|
12859
|
+
_ts_metadata44("design:returntype", Promise)
|
|
12640
12860
|
], PasswordResetController.prototype, "forgotPassword", null);
|
|
12641
|
-
|
|
12861
|
+
_ts_decorate45([
|
|
12642
12862
|
Throttle(AUTH_THROTTLE_CONFIGS.resetPassword),
|
|
12643
12863
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.resetPassword),
|
|
12644
12864
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
12645
12865
|
Post("reset-password"),
|
|
12646
12866
|
_ts_param24(0, Body()),
|
|
12647
12867
|
_ts_param24(1, Req()),
|
|
12648
|
-
|
|
12649
|
-
|
|
12868
|
+
_ts_metadata44("design:type", Function),
|
|
12869
|
+
_ts_metadata44("design:paramtypes", [
|
|
12650
12870
|
typeof ResetPasswordDto === "undefined" ? Object : ResetPasswordDto,
|
|
12651
12871
|
typeof Request === "undefined" ? Object : Request
|
|
12652
12872
|
]),
|
|
12653
|
-
|
|
12873
|
+
_ts_metadata44("design:returntype", Promise)
|
|
12654
12874
|
], PasswordResetController.prototype, "resetPassword", null);
|
|
12655
|
-
|
|
12875
|
+
_ts_decorate45([
|
|
12656
12876
|
Authenticated(),
|
|
12657
12877
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
12658
12878
|
Throttle(AUTH_THROTTLE_CONFIGS.changePassword),
|
|
@@ -12662,57 +12882,57 @@ _ts_decorate44([
|
|
|
12662
12882
|
_ts_param24(0, CurrentUser()),
|
|
12663
12883
|
_ts_param24(1, Body()),
|
|
12664
12884
|
_ts_param24(2, Req()),
|
|
12665
|
-
|
|
12666
|
-
|
|
12885
|
+
_ts_metadata44("design:type", Function),
|
|
12886
|
+
_ts_metadata44("design:paramtypes", [
|
|
12667
12887
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
12668
12888
|
typeof ChangePasswordDto === "undefined" ? Object : ChangePasswordDto,
|
|
12669
12889
|
typeof Request === "undefined" ? Object : Request
|
|
12670
12890
|
]),
|
|
12671
|
-
|
|
12891
|
+
_ts_metadata44("design:returntype", Promise)
|
|
12672
12892
|
], PasswordResetController.prototype, "changePassword", null);
|
|
12673
|
-
|
|
12893
|
+
_ts_decorate45([
|
|
12674
12894
|
Throttle(AUTH_THROTTLE_CONFIGS.verifyOtp),
|
|
12675
12895
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.verifyOtp),
|
|
12676
12896
|
HttpCode(HttpStatus.OK),
|
|
12677
12897
|
Post("verify-otp"),
|
|
12678
12898
|
_ts_param24(0, Body()),
|
|
12679
12899
|
_ts_param24(1, Req()),
|
|
12680
|
-
|
|
12681
|
-
|
|
12900
|
+
_ts_metadata44("design:type", Function),
|
|
12901
|
+
_ts_metadata44("design:paramtypes", [
|
|
12682
12902
|
typeof VerifyOtpDto === "undefined" ? Object : VerifyOtpDto,
|
|
12683
12903
|
typeof Request === "undefined" ? Object : Request
|
|
12684
12904
|
]),
|
|
12685
|
-
|
|
12905
|
+
_ts_metadata44("design:returntype", Promise)
|
|
12686
12906
|
], PasswordResetController.prototype, "verifyOtp", null);
|
|
12687
|
-
|
|
12907
|
+
_ts_decorate45([
|
|
12688
12908
|
Throttle(AUTH_THROTTLE_CONFIGS.resendPasswordOtp),
|
|
12689
12909
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.resendPasswordOtp),
|
|
12690
12910
|
HttpCode(HttpStatus.OK),
|
|
12691
12911
|
Post("resend-otp"),
|
|
12692
12912
|
_ts_param24(0, Body()),
|
|
12693
12913
|
_ts_param24(1, Req()),
|
|
12694
|
-
|
|
12695
|
-
|
|
12914
|
+
_ts_metadata44("design:type", Function),
|
|
12915
|
+
_ts_metadata44("design:paramtypes", [
|
|
12696
12916
|
typeof ResendOtpDto === "undefined" ? Object : ResendOtpDto,
|
|
12697
12917
|
typeof Request === "undefined" ? Object : Request
|
|
12698
12918
|
]),
|
|
12699
|
-
|
|
12919
|
+
_ts_metadata44("design:returntype", Promise)
|
|
12700
12920
|
], PasswordResetController.prototype, "resendOtp", null);
|
|
12701
|
-
PasswordResetController =
|
|
12921
|
+
PasswordResetController = _ts_decorate45([
|
|
12702
12922
|
Public(),
|
|
12703
12923
|
UseInterceptors(NoStoreInterceptor),
|
|
12704
12924
|
Controller("password"),
|
|
12705
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
12925
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
12706
12926
|
UsePipes(createAuthValidationPipe()),
|
|
12707
12927
|
_ts_param24(0, Inject(PasswordResetService)),
|
|
12708
12928
|
_ts_param24(1, Inject(TokenDeliveryService)),
|
|
12709
|
-
|
|
12710
|
-
|
|
12929
|
+
_ts_metadata44("design:type", Function),
|
|
12930
|
+
_ts_metadata44("design:paramtypes", [
|
|
12711
12931
|
typeof PasswordResetService === "undefined" ? Object : PasswordResetService,
|
|
12712
12932
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService
|
|
12713
12933
|
])
|
|
12714
12934
|
], PasswordResetController);
|
|
12715
|
-
function
|
|
12935
|
+
function _ts_decorate46(decorators, target, key, desc) {
|
|
12716
12936
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12717
12937
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
12718
12938
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -12725,13 +12945,13 @@ function _ts_decorate45(decorators, target, key, desc) {
|
|
|
12725
12945
|
}
|
|
12726
12946
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12727
12947
|
}
|
|
12728
|
-
__name(
|
|
12729
|
-
function
|
|
12948
|
+
__name(_ts_decorate46, "_ts_decorate");
|
|
12949
|
+
function _ts_metadata45(metadataKey, metadataValue) {
|
|
12730
12950
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
12731
12951
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
12732
12952
|
}
|
|
12733
12953
|
}
|
|
12734
|
-
__name(
|
|
12954
|
+
__name(_ts_metadata45, "_ts_metadata");
|
|
12735
12955
|
var PlatformLoginDto = class {
|
|
12736
12956
|
static {
|
|
12737
12957
|
__name(this, "PlatformLoginDto");
|
|
@@ -12759,14 +12979,14 @@ var PlatformLoginDto = class {
|
|
|
12759
12979
|
*/
|
|
12760
12980
|
password;
|
|
12761
12981
|
};
|
|
12762
|
-
|
|
12982
|
+
_ts_decorate46([
|
|
12763
12983
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
12764
12984
|
IsEmail(),
|
|
12765
12985
|
IsNotEmpty(),
|
|
12766
12986
|
MaxLength(255),
|
|
12767
|
-
|
|
12987
|
+
_ts_metadata45("design:type", String)
|
|
12768
12988
|
], PlatformLoginDto.prototype, "email", void 0);
|
|
12769
|
-
|
|
12989
|
+
_ts_decorate46([
|
|
12770
12990
|
IsString(),
|
|
12771
12991
|
IsNotEmpty(),
|
|
12772
12992
|
Matches(/\S/, {
|
|
@@ -12774,9 +12994,9 @@ _ts_decorate45([
|
|
|
12774
12994
|
}),
|
|
12775
12995
|
MinLength(1),
|
|
12776
12996
|
MaxLength(128),
|
|
12777
|
-
|
|
12997
|
+
_ts_metadata45("design:type", String)
|
|
12778
12998
|
], PlatformLoginDto.prototype, "password", void 0);
|
|
12779
|
-
function
|
|
12999
|
+
function _ts_decorate47(decorators, target, key, desc) {
|
|
12780
13000
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12781
13001
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
12782
13002
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -12789,13 +13009,13 @@ function _ts_decorate46(decorators, target, key, desc) {
|
|
|
12789
13009
|
}
|
|
12790
13010
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12791
13011
|
}
|
|
12792
|
-
__name(
|
|
12793
|
-
function
|
|
13012
|
+
__name(_ts_decorate47, "_ts_decorate");
|
|
13013
|
+
function _ts_metadata46(metadataKey, metadataValue) {
|
|
12794
13014
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
12795
13015
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
12796
13016
|
}
|
|
12797
13017
|
}
|
|
12798
|
-
__name(
|
|
13018
|
+
__name(_ts_metadata46, "_ts_metadata");
|
|
12799
13019
|
function _ts_param25(paramIndex, decorator) {
|
|
12800
13020
|
return function(target, key) {
|
|
12801
13021
|
decorator(target, key, paramIndex);
|
|
@@ -12847,15 +13067,15 @@ var JwtPlatformGuard = class {
|
|
|
12847
13067
|
return true;
|
|
12848
13068
|
}
|
|
12849
13069
|
};
|
|
12850
|
-
JwtPlatformGuard =
|
|
13070
|
+
JwtPlatformGuard = _ts_decorate47([
|
|
12851
13071
|
Injectable(),
|
|
12852
13072
|
_ts_param25(0, Inject(JwtService)),
|
|
12853
13073
|
_ts_param25(1, Inject(TokenDeliveryService)),
|
|
12854
13074
|
_ts_param25(2, Inject(AuthRevocationService)),
|
|
12855
13075
|
_ts_param25(3, Inject(Reflector)),
|
|
12856
13076
|
_ts_param25(4, Inject(BYMAX_AUTH_OPTIONS)),
|
|
12857
|
-
|
|
12858
|
-
|
|
13077
|
+
_ts_metadata46("design:type", Function),
|
|
13078
|
+
_ts_metadata46("design:paramtypes", [
|
|
12859
13079
|
typeof JwtService === "undefined" ? Object : JwtService,
|
|
12860
13080
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService,
|
|
12861
13081
|
typeof AuthRevocationService === "undefined" ? Object : AuthRevocationService,
|
|
@@ -12863,7 +13083,7 @@ JwtPlatformGuard = _ts_decorate46([
|
|
|
12863
13083
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
12864
13084
|
])
|
|
12865
13085
|
], JwtPlatformGuard);
|
|
12866
|
-
function
|
|
13086
|
+
function _ts_decorate48(decorators, target, key, desc) {
|
|
12867
13087
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12868
13088
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
12869
13089
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -12876,13 +13096,13 @@ function _ts_decorate47(decorators, target, key, desc) {
|
|
|
12876
13096
|
}
|
|
12877
13097
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12878
13098
|
}
|
|
12879
|
-
__name(
|
|
12880
|
-
function
|
|
13099
|
+
__name(_ts_decorate48, "_ts_decorate");
|
|
13100
|
+
function _ts_metadata47(metadataKey, metadataValue) {
|
|
12881
13101
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
12882
13102
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
12883
13103
|
}
|
|
12884
13104
|
}
|
|
12885
|
-
__name(
|
|
13105
|
+
__name(_ts_metadata47, "_ts_metadata");
|
|
12886
13106
|
function _ts_param26(paramIndex, decorator) {
|
|
12887
13107
|
return function(target, key) {
|
|
12888
13108
|
decorator(target, key, paramIndex);
|
|
@@ -12987,36 +13207,64 @@ var PlatformAuthService = class _PlatformAuthService {
|
|
|
12987
13207
|
*/
|
|
12988
13208
|
async logout(accessToken, rawRefreshToken) {
|
|
12989
13209
|
const tokenHash = sha256(rawRefreshToken);
|
|
12990
|
-
const
|
|
13210
|
+
const markerKey = logoutPendingKey("platform", tokenHash);
|
|
13211
|
+
const live = await this.redis.readSessionOwner(`prt:${tokenHash}`);
|
|
13212
|
+
const fromSession = live.userId !== "";
|
|
13213
|
+
const { userId } = fromSession ? live : await this.redis.readSessionOwner(markerKey);
|
|
12991
13214
|
this.logger.log(`logout: adminId=${logSafe(userId || "(no live session)")}`);
|
|
12992
|
-
let blacklist = [];
|
|
12993
|
-
try {
|
|
12994
|
-
const payload = this.tokenManager.verifyPlatformIgnoringExpiry(accessToken);
|
|
12995
|
-
const remainingTtl = payload.exp - Math.floor(Date.now() / 1e3);
|
|
12996
|
-
if (remainingTtl > 0) {
|
|
12997
|
-
blacklist = [
|
|
12998
|
-
() => this.redis.set(`rv:${payload.jti}`, "1", remainingTtl)
|
|
12999
|
-
];
|
|
13000
|
-
}
|
|
13001
|
-
} catch {
|
|
13002
|
-
}
|
|
13003
13215
|
const index = userId ? sessionIndexKey("platform", userId, this.options.hmacKey, void 0) : "";
|
|
13004
13216
|
const prune = /* @__PURE__ */ __name((member) => index === "" ? [] : [
|
|
13005
13217
|
() => this.redis.srem(index, member)
|
|
13006
13218
|
], "prune");
|
|
13007
13219
|
const failures = await settleWrites([
|
|
13008
|
-
...
|
|
13220
|
+
...this.blacklistWrites(accessToken),
|
|
13009
13221
|
settleAfter(() => this.redis.del("prt:" + tokenHash), [
|
|
13010
13222
|
...prune("prt:" + tokenHash),
|
|
13011
13223
|
() => this.redis.del("psd:" + tokenHash)
|
|
13012
13224
|
]),
|
|
13013
13225
|
settleAfter(() => this.redis.del("prp:" + tokenHash), prune("prp:" + tokenHash))
|
|
13014
13226
|
]);
|
|
13227
|
+
const markerTtl = logoutPendingTtlSeconds(this.options.jwt.accessExpiresIn);
|
|
13228
|
+
if (failures.length > 0 && fromSession) {
|
|
13229
|
+
await rememberPendingLogout(this.redis, markerKey, {
|
|
13230
|
+
userId,
|
|
13231
|
+
tenantId: void 0
|
|
13232
|
+
}, markerTtl, this.logger);
|
|
13233
|
+
}
|
|
13015
13234
|
raiseFirst(failures);
|
|
13016
|
-
this.
|
|
13235
|
+
if (userId !== "" && await settlePendingLogout(this.redis, markerKey, fromSession, {
|
|
13236
|
+
userId,
|
|
13237
|
+
tenantId: void 0
|
|
13238
|
+
}, markerTtl, this.logger)) {
|
|
13239
|
+
this.emitPlatformLogout(userId);
|
|
13240
|
+
}
|
|
13017
13241
|
return userId;
|
|
13018
13242
|
}
|
|
13019
13243
|
/**
|
|
13244
|
+
* The access-token blacklist write for a platform logout, or none when there is nothing to
|
|
13245
|
+
* revoke.
|
|
13246
|
+
*
|
|
13247
|
+
* Verifies signature and algorithm but not expiry: an expired token is the normal case here, a
|
|
13248
|
+
* forged one must not be able to blacklist an id it does not own. Only the verification is
|
|
13249
|
+
* tolerant: a token nobody can verify has nothing to blacklist, but a refused write is not.
|
|
13250
|
+
*
|
|
13251
|
+
* @param accessToken - Raw platform access token; absent, malformed or expired yields no write.
|
|
13252
|
+
* @returns The writes to hand to `settleWrites`.
|
|
13253
|
+
*/
|
|
13254
|
+
blacklistWrites(accessToken) {
|
|
13255
|
+
try {
|
|
13256
|
+
const payload = this.tokenManager.verifyPlatformIgnoringExpiry(accessToken);
|
|
13257
|
+
const remainingTtl = payload.exp - Math.floor(Date.now() / 1e3);
|
|
13258
|
+
if (remainingTtl > 0) {
|
|
13259
|
+
return [
|
|
13260
|
+
() => this.redis.set(`rv:${payload.jti}`, "1", remainingTtl)
|
|
13261
|
+
];
|
|
13262
|
+
}
|
|
13263
|
+
} catch {
|
|
13264
|
+
}
|
|
13265
|
+
return [];
|
|
13266
|
+
}
|
|
13267
|
+
/**
|
|
13020
13268
|
* Announces a completed platform logout, the only hook `PlatformAuthService` emits.
|
|
13021
13269
|
*
|
|
13022
13270
|
* Owns three concerns a reader of `logout` does not need: whether a hook is registered, the
|
|
@@ -13153,7 +13401,7 @@ var PlatformAuthService = class _PlatformAuthService {
|
|
|
13153
13401
|
await this.redis.bumpUserTokenEpoch(userId, void 0, "platform");
|
|
13154
13402
|
}
|
|
13155
13403
|
};
|
|
13156
|
-
PlatformAuthService =
|
|
13404
|
+
PlatformAuthService = _ts_decorate48([
|
|
13157
13405
|
Injectable(),
|
|
13158
13406
|
_ts_param26(0, Inject(BYMAX_AUTH_PLATFORM_USER_REPOSITORY)),
|
|
13159
13407
|
_ts_param26(1, Inject(PasswordService)),
|
|
@@ -13163,8 +13411,8 @@ PlatformAuthService = _ts_decorate47([
|
|
|
13163
13411
|
_ts_param26(5, Inject(BYMAX_AUTH_OPTIONS)),
|
|
13164
13412
|
_ts_param26(6, Inject(BYMAX_AUTH_HOOKS)),
|
|
13165
13413
|
_ts_param26(6, Optional()),
|
|
13166
|
-
|
|
13167
|
-
|
|
13414
|
+
_ts_metadata47("design:type", Function),
|
|
13415
|
+
_ts_metadata47("design:paramtypes", [
|
|
13168
13416
|
typeof IPlatformUserRepository === "undefined" ? Object : IPlatformUserRepository,
|
|
13169
13417
|
typeof PasswordService === "undefined" ? Object : PasswordService,
|
|
13170
13418
|
typeof TokenManagerService === "undefined" ? Object : TokenManagerService,
|
|
@@ -13176,7 +13424,7 @@ PlatformAuthService = _ts_decorate47([
|
|
|
13176
13424
|
], PlatformAuthService);
|
|
13177
13425
|
|
|
13178
13426
|
// src/server/controllers/platform-auth.controller.ts
|
|
13179
|
-
function
|
|
13427
|
+
function _ts_decorate49(decorators, target, key, desc) {
|
|
13180
13428
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
13181
13429
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
13182
13430
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13189,13 +13437,13 @@ function _ts_decorate48(decorators, target, key, desc) {
|
|
|
13189
13437
|
}
|
|
13190
13438
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13191
13439
|
}
|
|
13192
|
-
__name(
|
|
13193
|
-
function
|
|
13440
|
+
__name(_ts_decorate49, "_ts_decorate");
|
|
13441
|
+
function _ts_metadata48(metadataKey, metadataValue) {
|
|
13194
13442
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
13195
13443
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
13196
13444
|
}
|
|
13197
13445
|
}
|
|
13198
|
-
__name(
|
|
13446
|
+
__name(_ts_metadata48, "_ts_metadata");
|
|
13199
13447
|
function _ts_param27(paramIndex, decorator) {
|
|
13200
13448
|
return function(target, key) {
|
|
13201
13449
|
decorator(target, key, paramIndex);
|
|
@@ -13347,7 +13595,7 @@ var PlatformAuthController = class {
|
|
|
13347
13595
|
await this.platformAuthService.revokeAllPlatformSessions(user.sub);
|
|
13348
13596
|
}
|
|
13349
13597
|
};
|
|
13350
|
-
|
|
13598
|
+
_ts_decorate49([
|
|
13351
13599
|
Public(),
|
|
13352
13600
|
Throttle(AUTH_THROTTLE_CONFIGS.platformLogin),
|
|
13353
13601
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.platformLogin),
|
|
@@ -13355,14 +13603,14 @@ _ts_decorate48([
|
|
|
13355
13603
|
Post("login"),
|
|
13356
13604
|
_ts_param27(0, Body()),
|
|
13357
13605
|
_ts_param27(1, Req()),
|
|
13358
|
-
|
|
13359
|
-
|
|
13606
|
+
_ts_metadata48("design:type", Function),
|
|
13607
|
+
_ts_metadata48("design:paramtypes", [
|
|
13360
13608
|
typeof PlatformLoginDto === "undefined" ? Object : PlatformLoginDto,
|
|
13361
13609
|
typeof Request === "undefined" ? Object : Request
|
|
13362
13610
|
]),
|
|
13363
|
-
|
|
13611
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13364
13612
|
], PlatformAuthController.prototype, "login", null);
|
|
13365
|
-
|
|
13613
|
+
_ts_decorate49([
|
|
13366
13614
|
Public(),
|
|
13367
13615
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaChallenge),
|
|
13368
13616
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaChallenge),
|
|
@@ -13370,78 +13618,80 @@ _ts_decorate48([
|
|
|
13370
13618
|
Post("mfa/challenge"),
|
|
13371
13619
|
_ts_param27(0, Body()),
|
|
13372
13620
|
_ts_param27(1, Req()),
|
|
13373
|
-
|
|
13374
|
-
|
|
13621
|
+
_ts_metadata48("design:type", Function),
|
|
13622
|
+
_ts_metadata48("design:paramtypes", [
|
|
13375
13623
|
typeof MfaChallengeDto === "undefined" ? Object : MfaChallengeDto,
|
|
13376
13624
|
typeof Request === "undefined" ? Object : Request
|
|
13377
13625
|
]),
|
|
13378
|
-
|
|
13626
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13379
13627
|
], PlatformAuthController.prototype, "mfaChallenge", null);
|
|
13380
|
-
|
|
13628
|
+
_ts_decorate49([
|
|
13381
13629
|
UseGuards(JwtPlatformGuard),
|
|
13382
13630
|
Get("me"),
|
|
13383
13631
|
_ts_param27(0, CurrentUser()),
|
|
13384
|
-
|
|
13385
|
-
|
|
13632
|
+
_ts_metadata48("design:type", Function),
|
|
13633
|
+
_ts_metadata48("design:paramtypes", [
|
|
13386
13634
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload
|
|
13387
13635
|
]),
|
|
13388
|
-
|
|
13636
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13389
13637
|
], PlatformAuthController.prototype, "me", null);
|
|
13390
|
-
|
|
13638
|
+
_ts_decorate49([
|
|
13391
13639
|
Public(),
|
|
13392
13640
|
Throttle(AUTH_THROTTLE_CONFIGS.logout),
|
|
13393
13641
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.logout),
|
|
13394
13642
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
13643
|
+
RequestEncoding("unchecked"),
|
|
13395
13644
|
Post("logout"),
|
|
13396
13645
|
_ts_param27(0, Req()),
|
|
13397
|
-
|
|
13398
|
-
|
|
13646
|
+
_ts_metadata48("design:type", Function),
|
|
13647
|
+
_ts_metadata48("design:paramtypes", [
|
|
13399
13648
|
typeof Request === "undefined" ? Object : Request
|
|
13400
13649
|
]),
|
|
13401
|
-
|
|
13650
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13402
13651
|
], PlatformAuthController.prototype, "logout", null);
|
|
13403
|
-
|
|
13652
|
+
_ts_decorate49([
|
|
13404
13653
|
Public(),
|
|
13405
13654
|
Throttle(AUTH_THROTTLE_CONFIGS.refresh),
|
|
13406
13655
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.refresh),
|
|
13407
13656
|
HttpCode(HttpStatus.OK),
|
|
13657
|
+
RequestEncoding("unchecked"),
|
|
13408
13658
|
Post("refresh"),
|
|
13409
13659
|
_ts_param27(0, Req()),
|
|
13410
|
-
|
|
13411
|
-
|
|
13660
|
+
_ts_metadata48("design:type", Function),
|
|
13661
|
+
_ts_metadata48("design:paramtypes", [
|
|
13412
13662
|
typeof Request === "undefined" ? Object : Request
|
|
13413
13663
|
]),
|
|
13414
|
-
|
|
13664
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13415
13665
|
], PlatformAuthController.prototype, "refresh", null);
|
|
13416
|
-
|
|
13666
|
+
_ts_decorate49([
|
|
13417
13667
|
UseGuards(JwtPlatformGuard),
|
|
13418
13668
|
Throttle(AUTH_THROTTLE_CONFIGS.revokeAllSessions),
|
|
13419
13669
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.revokeAllSessions),
|
|
13420
13670
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
13421
13671
|
Delete("sessions"),
|
|
13422
13672
|
_ts_param27(0, CurrentUser()),
|
|
13423
|
-
|
|
13424
|
-
|
|
13673
|
+
_ts_metadata48("design:type", Function),
|
|
13674
|
+
_ts_metadata48("design:paramtypes", [
|
|
13425
13675
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload
|
|
13426
13676
|
]),
|
|
13427
|
-
|
|
13677
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13428
13678
|
], PlatformAuthController.prototype, "revokeSessions", null);
|
|
13429
|
-
PlatformAuthController =
|
|
13679
|
+
PlatformAuthController = _ts_decorate49([
|
|
13430
13680
|
UseInterceptors(NoStoreInterceptor),
|
|
13431
13681
|
Controller("platform"),
|
|
13432
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
13682
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
13433
13683
|
UsePipes(createAuthValidationPipe()),
|
|
13434
13684
|
_ts_param27(0, Inject(PlatformAuthService)),
|
|
13435
13685
|
_ts_param27(1, Inject(MfaService)),
|
|
13436
13686
|
_ts_param27(2, Inject(TokenDeliveryService)),
|
|
13437
|
-
|
|
13438
|
-
|
|
13687
|
+
_ts_metadata48("design:type", Function),
|
|
13688
|
+
_ts_metadata48("design:paramtypes", [
|
|
13439
13689
|
typeof PlatformAuthService === "undefined" ? Object : PlatformAuthService,
|
|
13440
13690
|
typeof MfaService === "undefined" ? Object : MfaService,
|
|
13441
13691
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService
|
|
13442
13692
|
])
|
|
13443
13693
|
], PlatformAuthController);
|
|
13444
|
-
function
|
|
13694
|
+
function _ts_decorate50(decorators, target, key, desc) {
|
|
13445
13695
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
13446
13696
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
13447
13697
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13454,13 +13704,13 @@ function _ts_decorate49(decorators, target, key, desc) {
|
|
|
13454
13704
|
}
|
|
13455
13705
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13456
13706
|
}
|
|
13457
|
-
__name(
|
|
13458
|
-
function
|
|
13707
|
+
__name(_ts_decorate50, "_ts_decorate");
|
|
13708
|
+
function _ts_metadata49(metadataKey, metadataValue) {
|
|
13459
13709
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
13460
13710
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
13461
13711
|
}
|
|
13462
13712
|
}
|
|
13463
|
-
__name(
|
|
13713
|
+
__name(_ts_metadata49, "_ts_metadata");
|
|
13464
13714
|
function _ts_param28(paramIndex, decorator) {
|
|
13465
13715
|
return function(target, key) {
|
|
13466
13716
|
decorator(target, key, paramIndex);
|
|
@@ -13545,21 +13795,22 @@ var PlatformMfaController = class {
|
|
|
13545
13795
|
return this.mfaService.regenerateRecoveryCodes(user.sub, dto.code, ip, userAgent, "platform");
|
|
13546
13796
|
}
|
|
13547
13797
|
};
|
|
13548
|
-
|
|
13798
|
+
_ts_decorate50([
|
|
13549
13799
|
UseGuards(JwtPlatformGuard),
|
|
13550
13800
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaSetup),
|
|
13551
13801
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaSetup),
|
|
13802
|
+
RequestEncoding("when-body"),
|
|
13552
13803
|
Post("setup"),
|
|
13553
13804
|
_ts_param28(0, CurrentUser()),
|
|
13554
13805
|
_ts_param28(1, Body()),
|
|
13555
|
-
|
|
13556
|
-
|
|
13806
|
+
_ts_metadata49("design:type", Function),
|
|
13807
|
+
_ts_metadata49("design:paramtypes", [
|
|
13557
13808
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload,
|
|
13558
13809
|
typeof MfaSetupDto === "undefined" ? Object : MfaSetupDto
|
|
13559
13810
|
]),
|
|
13560
|
-
|
|
13811
|
+
_ts_metadata49("design:returntype", Promise)
|
|
13561
13812
|
], PlatformMfaController.prototype, "setup", null);
|
|
13562
|
-
|
|
13813
|
+
_ts_decorate50([
|
|
13563
13814
|
UseGuards(JwtPlatformGuard),
|
|
13564
13815
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaVerifyEnable),
|
|
13565
13816
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaVerifyEnable),
|
|
@@ -13568,15 +13819,15 @@ _ts_decorate49([
|
|
|
13568
13819
|
_ts_param28(0, CurrentUser()),
|
|
13569
13820
|
_ts_param28(1, Body()),
|
|
13570
13821
|
_ts_param28(2, Req()),
|
|
13571
|
-
|
|
13572
|
-
|
|
13822
|
+
_ts_metadata49("design:type", Function),
|
|
13823
|
+
_ts_metadata49("design:paramtypes", [
|
|
13573
13824
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload,
|
|
13574
13825
|
typeof MfaVerifyDto === "undefined" ? Object : MfaVerifyDto,
|
|
13575
13826
|
typeof Request === "undefined" ? Object : Request
|
|
13576
13827
|
]),
|
|
13577
|
-
|
|
13828
|
+
_ts_metadata49("design:returntype", Promise)
|
|
13578
13829
|
], PlatformMfaController.prototype, "verifyEnable", null);
|
|
13579
|
-
|
|
13830
|
+
_ts_decorate50([
|
|
13580
13831
|
UseGuards(JwtPlatformGuard),
|
|
13581
13832
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
13582
13833
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
@@ -13585,15 +13836,15 @@ _ts_decorate49([
|
|
|
13585
13836
|
_ts_param28(0, CurrentUser()),
|
|
13586
13837
|
_ts_param28(1, Body()),
|
|
13587
13838
|
_ts_param28(2, Req()),
|
|
13588
|
-
|
|
13589
|
-
|
|
13839
|
+
_ts_metadata49("design:type", Function),
|
|
13840
|
+
_ts_metadata49("design:paramtypes", [
|
|
13590
13841
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload,
|
|
13591
13842
|
typeof MfaDisableDto === "undefined" ? Object : MfaDisableDto,
|
|
13592
13843
|
typeof Request === "undefined" ? Object : Request
|
|
13593
13844
|
]),
|
|
13594
|
-
|
|
13845
|
+
_ts_metadata49("design:returntype", Promise)
|
|
13595
13846
|
], PlatformMfaController.prototype, "disable", null);
|
|
13596
|
-
|
|
13847
|
+
_ts_decorate50([
|
|
13597
13848
|
UseGuards(JwtPlatformGuard),
|
|
13598
13849
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
13599
13850
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
@@ -13602,28 +13853,28 @@ _ts_decorate49([
|
|
|
13602
13853
|
_ts_param28(0, CurrentUser()),
|
|
13603
13854
|
_ts_param28(1, Body()),
|
|
13604
13855
|
_ts_param28(2, Req()),
|
|
13605
|
-
|
|
13606
|
-
|
|
13856
|
+
_ts_metadata49("design:type", Function),
|
|
13857
|
+
_ts_metadata49("design:paramtypes", [
|
|
13607
13858
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload,
|
|
13608
13859
|
typeof MfaRegenerateRecoveryCodesDto === "undefined" ? Object : MfaRegenerateRecoveryCodesDto,
|
|
13609
13860
|
typeof Request === "undefined" ? Object : Request
|
|
13610
13861
|
]),
|
|
13611
|
-
|
|
13862
|
+
_ts_metadata49("design:returntype", Promise)
|
|
13612
13863
|
], PlatformMfaController.prototype, "regenerateRecoveryCodes", null);
|
|
13613
|
-
PlatformMfaController =
|
|
13864
|
+
PlatformMfaController = _ts_decorate50([
|
|
13614
13865
|
UseInterceptors(NoStoreInterceptor),
|
|
13615
13866
|
Controller("platform/mfa"),
|
|
13616
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
13867
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
13617
13868
|
UsePipes(createAuthValidationPipe({
|
|
13618
13869
|
forbidUnknownValues: true
|
|
13619
13870
|
})),
|
|
13620
13871
|
_ts_param28(0, Inject(MfaService)),
|
|
13621
|
-
|
|
13622
|
-
|
|
13872
|
+
_ts_metadata49("design:type", Function),
|
|
13873
|
+
_ts_metadata49("design:paramtypes", [
|
|
13623
13874
|
typeof MfaService === "undefined" ? Object : MfaService
|
|
13624
13875
|
])
|
|
13625
13876
|
], PlatformMfaController);
|
|
13626
|
-
function
|
|
13877
|
+
function _ts_decorate51(decorators, target, key, desc) {
|
|
13627
13878
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
13628
13879
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
13629
13880
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13636,13 +13887,13 @@ function _ts_decorate50(decorators, target, key, desc) {
|
|
|
13636
13887
|
}
|
|
13637
13888
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13638
13889
|
}
|
|
13639
|
-
__name(
|
|
13640
|
-
function
|
|
13890
|
+
__name(_ts_decorate51, "_ts_decorate");
|
|
13891
|
+
function _ts_metadata50(metadataKey, metadataValue) {
|
|
13641
13892
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
13642
13893
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
13643
13894
|
}
|
|
13644
13895
|
}
|
|
13645
|
-
__name(
|
|
13896
|
+
__name(_ts_metadata50, "_ts_metadata");
|
|
13646
13897
|
function _ts_param29(paramIndex, decorator) {
|
|
13647
13898
|
return function(target, key) {
|
|
13648
13899
|
decorator(target, key, paramIndex);
|
|
@@ -13748,63 +13999,64 @@ var SessionController = class {
|
|
|
13748
13999
|
});
|
|
13749
14000
|
}
|
|
13750
14001
|
};
|
|
13751
|
-
|
|
14002
|
+
_ts_decorate51([
|
|
13752
14003
|
Throttle(AUTH_THROTTLE_CONFIGS.listSessions),
|
|
13753
14004
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.listSessions),
|
|
13754
14005
|
Get(),
|
|
13755
14006
|
_ts_param29(0, CurrentUser()),
|
|
13756
14007
|
_ts_param29(1, Req()),
|
|
13757
|
-
|
|
13758
|
-
|
|
14008
|
+
_ts_metadata50("design:type", Function),
|
|
14009
|
+
_ts_metadata50("design:paramtypes", [
|
|
13759
14010
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
13760
14011
|
typeof Request === "undefined" ? Object : Request
|
|
13761
14012
|
]),
|
|
13762
|
-
|
|
14013
|
+
_ts_metadata50("design:returntype", Promise)
|
|
13763
14014
|
], SessionController.prototype, "listSessions", null);
|
|
13764
|
-
|
|
14015
|
+
_ts_decorate51([
|
|
13765
14016
|
Throttle(AUTH_THROTTLE_CONFIGS.revokeAllSessions),
|
|
13766
14017
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.revokeAllSessions),
|
|
13767
14018
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
14019
|
+
RequestEncoding("unchecked"),
|
|
13768
14020
|
Post("revoke-all"),
|
|
13769
14021
|
_ts_param29(0, CurrentUser()),
|
|
13770
14022
|
_ts_param29(1, Req()),
|
|
13771
|
-
|
|
13772
|
-
|
|
14023
|
+
_ts_metadata50("design:type", Function),
|
|
14024
|
+
_ts_metadata50("design:paramtypes", [
|
|
13773
14025
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
13774
14026
|
typeof Request === "undefined" ? Object : Request
|
|
13775
14027
|
]),
|
|
13776
|
-
|
|
14028
|
+
_ts_metadata50("design:returntype", Promise)
|
|
13777
14029
|
], SessionController.prototype, "revokeAllSessions", null);
|
|
13778
|
-
|
|
14030
|
+
_ts_decorate51([
|
|
13779
14031
|
Throttle(AUTH_THROTTLE_CONFIGS.revokeSession),
|
|
13780
14032
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.revokeSession),
|
|
13781
14033
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
13782
14034
|
Delete(":id"),
|
|
13783
14035
|
_ts_param29(0, CurrentUser()),
|
|
13784
14036
|
_ts_param29(1, Param("id")),
|
|
13785
|
-
|
|
13786
|
-
|
|
14037
|
+
_ts_metadata50("design:type", Function),
|
|
14038
|
+
_ts_metadata50("design:paramtypes", [
|
|
13787
14039
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
13788
14040
|
String
|
|
13789
14041
|
]),
|
|
13790
|
-
|
|
14042
|
+
_ts_metadata50("design:returntype", Promise)
|
|
13791
14043
|
], SessionController.prototype, "revokeSession", null);
|
|
13792
|
-
SessionController =
|
|
14044
|
+
SessionController = _ts_decorate51([
|
|
13793
14045
|
UseInterceptors(NoStoreInterceptor),
|
|
13794
14046
|
Controller("sessions"),
|
|
13795
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard, JwtAuthGuard, UserStatusGuard),
|
|
14047
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard, JwtAuthGuard, UserStatusGuard),
|
|
13796
14048
|
UsePipes(createAuthValidationPipe()),
|
|
13797
14049
|
_ts_param29(0, Inject(SessionService)),
|
|
13798
14050
|
_ts_param29(1, Inject(TokenDeliveryService)),
|
|
13799
|
-
|
|
13800
|
-
|
|
14051
|
+
_ts_metadata50("design:type", Function),
|
|
14052
|
+
_ts_metadata50("design:paramtypes", [
|
|
13801
14053
|
typeof SessionService === "undefined" ? Object : SessionService,
|
|
13802
14054
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService
|
|
13803
14055
|
])
|
|
13804
14056
|
], SessionController);
|
|
13805
14057
|
var API_KEY_SCOPES_KEY = /* @__PURE__ */ Symbol("bymax:apiKeyScopes");
|
|
13806
14058
|
var ApiKeyScopes = /* @__PURE__ */ __name((...scopes) => SetMetadata(API_KEY_SCOPES_KEY, scopes), "ApiKeyScopes");
|
|
13807
|
-
function
|
|
14059
|
+
function _ts_decorate52(decorators, target, key, desc) {
|
|
13808
14060
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
13809
14061
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
13810
14062
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13817,13 +14069,13 @@ function _ts_decorate51(decorators, target, key, desc) {
|
|
|
13817
14069
|
}
|
|
13818
14070
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13819
14071
|
}
|
|
13820
|
-
__name(
|
|
13821
|
-
function
|
|
14072
|
+
__name(_ts_decorate52, "_ts_decorate");
|
|
14073
|
+
function _ts_metadata51(metadataKey, metadataValue) {
|
|
13822
14074
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
13823
14075
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
13824
14076
|
}
|
|
13825
14077
|
}
|
|
13826
|
-
__name(
|
|
14078
|
+
__name(_ts_metadata51, "_ts_metadata");
|
|
13827
14079
|
function _ts_param30(paramIndex, decorator) {
|
|
13828
14080
|
return function(target, key) {
|
|
13829
14081
|
decorator(target, key, paramIndex);
|
|
@@ -13890,12 +14142,12 @@ var ApiKeyLastUsedService = class _ApiKeyLastUsedService {
|
|
|
13890
14142
|
await this.flush();
|
|
13891
14143
|
}
|
|
13892
14144
|
};
|
|
13893
|
-
ApiKeyLastUsedService =
|
|
14145
|
+
ApiKeyLastUsedService = _ts_decorate52([
|
|
13894
14146
|
Injectable(),
|
|
13895
14147
|
_ts_param30(0, Inject(BYMAX_AUTH_API_KEY_REPOSITORY)),
|
|
13896
14148
|
_ts_param30(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
13897
|
-
|
|
13898
|
-
|
|
14149
|
+
_ts_metadata51("design:type", Function),
|
|
14150
|
+
_ts_metadata51("design:paramtypes", [
|
|
13899
14151
|
typeof IApiKeyRepository === "undefined" ? Object : IApiKeyRepository,
|
|
13900
14152
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
13901
14153
|
])
|
|
@@ -13944,7 +14196,7 @@ function digestsMatch(computed, stored) {
|
|
|
13944
14196
|
__name(digestsMatch, "digestsMatch");
|
|
13945
14197
|
|
|
13946
14198
|
// src/server/services/api-key-verifier.service.ts
|
|
13947
|
-
function
|
|
14199
|
+
function _ts_decorate53(decorators, target, key, desc) {
|
|
13948
14200
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
13949
14201
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
13950
14202
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13957,13 +14209,13 @@ function _ts_decorate52(decorators, target, key, desc) {
|
|
|
13957
14209
|
}
|
|
13958
14210
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13959
14211
|
}
|
|
13960
|
-
__name(
|
|
13961
|
-
function
|
|
14212
|
+
__name(_ts_decorate53, "_ts_decorate");
|
|
14213
|
+
function _ts_metadata52(metadataKey, metadataValue) {
|
|
13962
14214
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
13963
14215
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
13964
14216
|
}
|
|
13965
14217
|
}
|
|
13966
|
-
__name(
|
|
14218
|
+
__name(_ts_metadata52, "_ts_metadata");
|
|
13967
14219
|
function _ts_param31(paramIndex, decorator) {
|
|
13968
14220
|
return function(target, key) {
|
|
13969
14221
|
decorator(target, key, paramIndex);
|
|
@@ -14029,14 +14281,14 @@ var ApiKeyVerifierService = class {
|
|
|
14029
14281
|
return null;
|
|
14030
14282
|
}
|
|
14031
14283
|
};
|
|
14032
|
-
ApiKeyVerifierService =
|
|
14284
|
+
ApiKeyVerifierService = _ts_decorate53([
|
|
14033
14285
|
Injectable(),
|
|
14034
14286
|
_ts_param31(0, Inject(BYMAX_AUTH_API_KEY_REPOSITORY)),
|
|
14035
14287
|
_ts_param31(1, Inject(BYMAX_AUTH_API_KEY_CLOCK)),
|
|
14036
14288
|
_ts_param31(2, Inject(BYMAX_AUTH_OPTIONS)),
|
|
14037
14289
|
_ts_param31(3, Inject(ApiKeyLastUsedService)),
|
|
14038
|
-
|
|
14039
|
-
|
|
14290
|
+
_ts_metadata52("design:type", Function),
|
|
14291
|
+
_ts_metadata52("design:paramtypes", [
|
|
14040
14292
|
typeof IApiKeyRepository === "undefined" ? Object : IApiKeyRepository,
|
|
14041
14293
|
typeof ApiKeyClock === "undefined" ? Object : ApiKeyClock,
|
|
14042
14294
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
@@ -14045,7 +14297,7 @@ ApiKeyVerifierService = _ts_decorate52([
|
|
|
14045
14297
|
], ApiKeyVerifierService);
|
|
14046
14298
|
|
|
14047
14299
|
// src/server/guards/api-key.guard.ts
|
|
14048
|
-
function
|
|
14300
|
+
function _ts_decorate54(decorators, target, key, desc) {
|
|
14049
14301
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14050
14302
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14051
14303
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14058,13 +14310,13 @@ function _ts_decorate53(decorators, target, key, desc) {
|
|
|
14058
14310
|
}
|
|
14059
14311
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14060
14312
|
}
|
|
14061
|
-
__name(
|
|
14062
|
-
function
|
|
14313
|
+
__name(_ts_decorate54, "_ts_decorate");
|
|
14314
|
+
function _ts_metadata53(metadataKey, metadataValue) {
|
|
14063
14315
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14064
14316
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14065
14317
|
}
|
|
14066
14318
|
}
|
|
14067
|
-
__name(
|
|
14319
|
+
__name(_ts_metadata53, "_ts_metadata");
|
|
14068
14320
|
function _ts_param32(paramIndex, decorator) {
|
|
14069
14321
|
return function(target, key) {
|
|
14070
14322
|
decorator(target, key, paramIndex);
|
|
@@ -14210,15 +14462,15 @@ var ApiKeyGuard = class _ApiKeyGuard {
|
|
|
14210
14462
|
};
|
|
14211
14463
|
}
|
|
14212
14464
|
};
|
|
14213
|
-
ApiKeyGuard =
|
|
14465
|
+
ApiKeyGuard = _ts_decorate54([
|
|
14214
14466
|
Injectable(),
|
|
14215
14467
|
_ts_param32(0, Inject(Reflector)),
|
|
14216
14468
|
_ts_param32(1, Inject(ApiKeyVerifierService)),
|
|
14217
14469
|
_ts_param32(2, Inject(BYMAX_AUTH_OPTIONS)),
|
|
14218
14470
|
_ts_param32(3, Inject(BYMAX_AUTH_HOOKS)),
|
|
14219
14471
|
_ts_param32(3, Optional()),
|
|
14220
|
-
|
|
14221
|
-
|
|
14472
|
+
_ts_metadata53("design:type", Function),
|
|
14473
|
+
_ts_metadata53("design:paramtypes", [
|
|
14222
14474
|
typeof Reflector === "undefined" ? Object : Reflector,
|
|
14223
14475
|
typeof ApiKeyVerifierService === "undefined" ? Object : ApiKeyVerifierService,
|
|
14224
14476
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
@@ -14230,7 +14482,7 @@ function routePattern(request) {
|
|
|
14230
14482
|
return typeof path === "string" ? path : "";
|
|
14231
14483
|
}
|
|
14232
14484
|
__name(routePattern, "routePattern");
|
|
14233
|
-
function
|
|
14485
|
+
function _ts_decorate55(decorators, target, key, desc) {
|
|
14234
14486
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14235
14487
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14236
14488
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14243,13 +14495,13 @@ function _ts_decorate54(decorators, target, key, desc) {
|
|
|
14243
14495
|
}
|
|
14244
14496
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14245
14497
|
}
|
|
14246
|
-
__name(
|
|
14247
|
-
function
|
|
14498
|
+
__name(_ts_decorate55, "_ts_decorate");
|
|
14499
|
+
function _ts_metadata54(metadataKey, metadataValue) {
|
|
14248
14500
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14249
14501
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14250
14502
|
}
|
|
14251
14503
|
}
|
|
14252
|
-
__name(
|
|
14504
|
+
__name(_ts_metadata54, "_ts_metadata");
|
|
14253
14505
|
function _ts_param33(paramIndex, decorator) {
|
|
14254
14506
|
return function(target, key) {
|
|
14255
14507
|
decorator(target, key, paramIndex);
|
|
@@ -14282,11 +14534,11 @@ var MfaRequiredGuard = class {
|
|
|
14282
14534
|
return true;
|
|
14283
14535
|
}
|
|
14284
14536
|
};
|
|
14285
|
-
MfaRequiredGuard =
|
|
14537
|
+
MfaRequiredGuard = _ts_decorate55([
|
|
14286
14538
|
Injectable(),
|
|
14287
14539
|
_ts_param33(0, Inject(Reflector)),
|
|
14288
|
-
|
|
14289
|
-
|
|
14540
|
+
_ts_metadata54("design:type", Function),
|
|
14541
|
+
_ts_metadata54("design:paramtypes", [
|
|
14290
14542
|
typeof Reflector === "undefined" ? Object : Reflector
|
|
14291
14543
|
])
|
|
14292
14544
|
], MfaRequiredGuard);
|
|
@@ -14294,7 +14546,7 @@ var PLATFORM_ROLES_KEY = /* @__PURE__ */ Symbol("platformRoles");
|
|
|
14294
14546
|
var PlatformRoles = /* @__PURE__ */ __name((...roles) => SetMetadata(PLATFORM_ROLES_KEY, roles), "PlatformRoles");
|
|
14295
14547
|
|
|
14296
14548
|
// src/server/guards/platform-roles.guard.ts
|
|
14297
|
-
function
|
|
14549
|
+
function _ts_decorate56(decorators, target, key, desc) {
|
|
14298
14550
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14299
14551
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14300
14552
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14307,13 +14559,13 @@ function _ts_decorate55(decorators, target, key, desc) {
|
|
|
14307
14559
|
}
|
|
14308
14560
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14309
14561
|
}
|
|
14310
|
-
__name(
|
|
14311
|
-
function
|
|
14562
|
+
__name(_ts_decorate56, "_ts_decorate");
|
|
14563
|
+
function _ts_metadata55(metadataKey, metadataValue) {
|
|
14312
14564
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14313
14565
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14314
14566
|
}
|
|
14315
14567
|
}
|
|
14316
|
-
__name(
|
|
14568
|
+
__name(_ts_metadata55, "_ts_metadata");
|
|
14317
14569
|
function _ts_param34(paramIndex, decorator) {
|
|
14318
14570
|
return function(target, key) {
|
|
14319
14571
|
decorator(target, key, paramIndex);
|
|
@@ -14353,12 +14605,12 @@ var PlatformRolesGuard = class {
|
|
|
14353
14605
|
return true;
|
|
14354
14606
|
}
|
|
14355
14607
|
};
|
|
14356
|
-
PlatformRolesGuard =
|
|
14608
|
+
PlatformRolesGuard = _ts_decorate56([
|
|
14357
14609
|
Injectable(),
|
|
14358
14610
|
_ts_param34(0, Inject(Reflector)),
|
|
14359
14611
|
_ts_param34(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
14360
|
-
|
|
14361
|
-
|
|
14612
|
+
_ts_metadata55("design:type", Function),
|
|
14613
|
+
_ts_metadata55("design:paramtypes", [
|
|
14362
14614
|
typeof Reflector === "undefined" ? Object : Reflector,
|
|
14363
14615
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
14364
14616
|
])
|
|
@@ -14367,7 +14619,7 @@ var ROLES_KEY = "roles";
|
|
|
14367
14619
|
var Roles = /* @__PURE__ */ __name((...roles) => SetMetadata(ROLES_KEY, roles), "Roles");
|
|
14368
14620
|
|
|
14369
14621
|
// src/server/guards/roles.guard.ts
|
|
14370
|
-
function
|
|
14622
|
+
function _ts_decorate57(decorators, target, key, desc) {
|
|
14371
14623
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14372
14624
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14373
14625
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14380,13 +14632,13 @@ function _ts_decorate56(decorators, target, key, desc) {
|
|
|
14380
14632
|
}
|
|
14381
14633
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14382
14634
|
}
|
|
14383
|
-
__name(
|
|
14384
|
-
function
|
|
14635
|
+
__name(_ts_decorate57, "_ts_decorate");
|
|
14636
|
+
function _ts_metadata56(metadataKey, metadataValue) {
|
|
14385
14637
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14386
14638
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14387
14639
|
}
|
|
14388
14640
|
}
|
|
14389
|
-
__name(
|
|
14641
|
+
__name(_ts_metadata56, "_ts_metadata");
|
|
14390
14642
|
function _ts_param35(paramIndex, decorator) {
|
|
14391
14643
|
return function(target, key) {
|
|
14392
14644
|
decorator(target, key, paramIndex);
|
|
@@ -14422,17 +14674,17 @@ var RolesGuard = class {
|
|
|
14422
14674
|
return true;
|
|
14423
14675
|
}
|
|
14424
14676
|
};
|
|
14425
|
-
RolesGuard =
|
|
14677
|
+
RolesGuard = _ts_decorate57([
|
|
14426
14678
|
Injectable(),
|
|
14427
14679
|
_ts_param35(0, Inject(Reflector)),
|
|
14428
14680
|
_ts_param35(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
14429
|
-
|
|
14430
|
-
|
|
14681
|
+
_ts_metadata56("design:type", Function),
|
|
14682
|
+
_ts_metadata56("design:paramtypes", [
|
|
14431
14683
|
typeof Reflector === "undefined" ? Object : Reflector,
|
|
14432
14684
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
14433
14685
|
])
|
|
14434
14686
|
], RolesGuard);
|
|
14435
|
-
function
|
|
14687
|
+
function _ts_decorate58(decorators, target, key, desc) {
|
|
14436
14688
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14437
14689
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14438
14690
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14445,7 +14697,7 @@ function _ts_decorate57(decorators, target, key, desc) {
|
|
|
14445
14697
|
}
|
|
14446
14698
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14447
14699
|
}
|
|
14448
|
-
__name(
|
|
14700
|
+
__name(_ts_decorate58, "_ts_decorate");
|
|
14449
14701
|
var NoOpAuthHooks = class {
|
|
14450
14702
|
static {
|
|
14451
14703
|
__name(this, "NoOpAuthHooks");
|
|
@@ -14494,7 +14746,7 @@ var NoOpAuthHooks = class {
|
|
|
14494
14746
|
};
|
|
14495
14747
|
}
|
|
14496
14748
|
};
|
|
14497
|
-
NoOpAuthHooks =
|
|
14749
|
+
NoOpAuthHooks = _ts_decorate58([
|
|
14498
14750
|
Injectable()
|
|
14499
14751
|
], NoOpAuthHooks);
|
|
14500
14752
|
|
|
@@ -14507,7 +14759,7 @@ var OAUTH_STATE_COOKIE_SAME_SITE = "lax";
|
|
|
14507
14759
|
var OAUTH_STATE_COOKIE_MAX_AGE_SECONDS = 600;
|
|
14508
14760
|
|
|
14509
14761
|
// src/server/oauth/oauth.service.ts
|
|
14510
|
-
function
|
|
14762
|
+
function _ts_decorate59(decorators, target, key, desc) {
|
|
14511
14763
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14512
14764
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14513
14765
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14520,13 +14772,13 @@ function _ts_decorate58(decorators, target, key, desc) {
|
|
|
14520
14772
|
}
|
|
14521
14773
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14522
14774
|
}
|
|
14523
|
-
__name(
|
|
14524
|
-
function
|
|
14775
|
+
__name(_ts_decorate59, "_ts_decorate");
|
|
14776
|
+
function _ts_metadata57(metadataKey, metadataValue) {
|
|
14525
14777
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14526
14778
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14527
14779
|
}
|
|
14528
14780
|
}
|
|
14529
|
-
__name(
|
|
14781
|
+
__name(_ts_metadata57, "_ts_metadata");
|
|
14530
14782
|
function _ts_param36(paramIndex, decorator) {
|
|
14531
14783
|
return function(target, key) {
|
|
14532
14784
|
decorator(target, key, paramIndex);
|
|
@@ -14826,7 +15078,7 @@ var OAuthService = class _OAuthService {
|
|
|
14826
15078
|
return plugin;
|
|
14827
15079
|
}
|
|
14828
15080
|
};
|
|
14829
|
-
OAuthService =
|
|
15081
|
+
OAuthService = _ts_decorate59([
|
|
14830
15082
|
Injectable(),
|
|
14831
15083
|
_ts_param36(0, Inject(OAUTH_PLUGINS)),
|
|
14832
15084
|
_ts_param36(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
@@ -14836,8 +15088,8 @@ OAuthService = _ts_decorate58([
|
|
|
14836
15088
|
_ts_param36(4, Inject(TokenManagerService)),
|
|
14837
15089
|
_ts_param36(5, Inject(SessionService)),
|
|
14838
15090
|
_ts_param36(6, Inject(BYMAX_AUTH_OPTIONS)),
|
|
14839
|
-
|
|
14840
|
-
|
|
15091
|
+
_ts_metadata57("design:type", Function),
|
|
15092
|
+
_ts_metadata57("design:paramtypes", [
|
|
14841
15093
|
Array,
|
|
14842
15094
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
14843
15095
|
Object,
|
|
@@ -14847,7 +15099,7 @@ OAuthService = _ts_decorate58([
|
|
|
14847
15099
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
14848
15100
|
])
|
|
14849
15101
|
], OAuthService);
|
|
14850
|
-
function
|
|
15102
|
+
function _ts_decorate60(decorators, target, key, desc) {
|
|
14851
15103
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14852
15104
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14853
15105
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14860,13 +15112,13 @@ function _ts_decorate59(decorators, target, key, desc) {
|
|
|
14860
15112
|
}
|
|
14861
15113
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14862
15114
|
}
|
|
14863
|
-
__name(
|
|
14864
|
-
function
|
|
15115
|
+
__name(_ts_decorate60, "_ts_decorate");
|
|
15116
|
+
function _ts_metadata58(metadataKey, metadataValue) {
|
|
14865
15117
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14866
15118
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14867
15119
|
}
|
|
14868
15120
|
}
|
|
14869
|
-
__name(
|
|
15121
|
+
__name(_ts_metadata58, "_ts_metadata");
|
|
14870
15122
|
var OAuthCallbackQueryDto = class {
|
|
14871
15123
|
static {
|
|
14872
15124
|
__name(this, "OAuthCallbackQueryDto");
|
|
@@ -14965,69 +15217,69 @@ var OAuthCallbackQueryDto = class {
|
|
|
14965
15217
|
*/
|
|
14966
15218
|
hd;
|
|
14967
15219
|
};
|
|
14968
|
-
|
|
15220
|
+
_ts_decorate60([
|
|
14969
15221
|
ValidateIf((query) => query.error === void 0 || query.error === null),
|
|
14970
15222
|
IsOptional(),
|
|
14971
15223
|
IsString(),
|
|
14972
15224
|
IsNotEmpty(),
|
|
14973
15225
|
MaxLength(2048),
|
|
14974
|
-
|
|
15226
|
+
_ts_metadata58("design:type", String)
|
|
14975
15227
|
], OAuthCallbackQueryDto.prototype, "code", void 0);
|
|
14976
|
-
|
|
15228
|
+
_ts_decorate60([
|
|
14977
15229
|
IsOptional(),
|
|
14978
15230
|
IsString(),
|
|
14979
15231
|
MaxLength(128),
|
|
14980
|
-
|
|
15232
|
+
_ts_metadata58("design:type", String)
|
|
14981
15233
|
], OAuthCallbackQueryDto.prototype, "error", void 0);
|
|
14982
|
-
|
|
15234
|
+
_ts_decorate60([
|
|
14983
15235
|
IsOptional(),
|
|
14984
15236
|
IsString(),
|
|
14985
15237
|
MaxLength(512),
|
|
14986
|
-
|
|
15238
|
+
_ts_metadata58("design:type", String)
|
|
14987
15239
|
], OAuthCallbackQueryDto.prototype, "error_description", void 0);
|
|
14988
|
-
|
|
15240
|
+
_ts_decorate60([
|
|
14989
15241
|
IsOptional(),
|
|
14990
15242
|
IsString(),
|
|
14991
15243
|
MaxLength(512),
|
|
14992
|
-
|
|
15244
|
+
_ts_metadata58("design:type", String)
|
|
14993
15245
|
], OAuthCallbackQueryDto.prototype, "error_uri", void 0);
|
|
14994
|
-
|
|
15246
|
+
_ts_decorate60([
|
|
14995
15247
|
IsString(),
|
|
14996
15248
|
IsNotEmpty(),
|
|
14997
15249
|
MaxLength(128),
|
|
14998
|
-
|
|
15250
|
+
_ts_metadata58("design:type", String)
|
|
14999
15251
|
], OAuthCallbackQueryDto.prototype, "state", void 0);
|
|
15000
|
-
|
|
15252
|
+
_ts_decorate60([
|
|
15001
15253
|
IsOptional(),
|
|
15002
15254
|
IsString(),
|
|
15003
15255
|
MaxLength(512),
|
|
15004
|
-
|
|
15256
|
+
_ts_metadata58("design:type", String)
|
|
15005
15257
|
], OAuthCallbackQueryDto.prototype, "iss", void 0);
|
|
15006
|
-
|
|
15258
|
+
_ts_decorate60([
|
|
15007
15259
|
IsOptional(),
|
|
15008
15260
|
IsString(),
|
|
15009
15261
|
MaxLength(2048),
|
|
15010
|
-
|
|
15262
|
+
_ts_metadata58("design:type", String)
|
|
15011
15263
|
], OAuthCallbackQueryDto.prototype, "scope", void 0);
|
|
15012
|
-
|
|
15264
|
+
_ts_decorate60([
|
|
15013
15265
|
IsOptional(),
|
|
15014
15266
|
IsString(),
|
|
15015
15267
|
MaxLength(16),
|
|
15016
|
-
|
|
15268
|
+
_ts_metadata58("design:type", String)
|
|
15017
15269
|
], OAuthCallbackQueryDto.prototype, "authuser", void 0);
|
|
15018
|
-
|
|
15270
|
+
_ts_decorate60([
|
|
15019
15271
|
IsOptional(),
|
|
15020
15272
|
IsString(),
|
|
15021
15273
|
MaxLength(64),
|
|
15022
|
-
|
|
15274
|
+
_ts_metadata58("design:type", String)
|
|
15023
15275
|
], OAuthCallbackQueryDto.prototype, "prompt", void 0);
|
|
15024
|
-
|
|
15276
|
+
_ts_decorate60([
|
|
15025
15277
|
IsOptional(),
|
|
15026
15278
|
IsString(),
|
|
15027
15279
|
MaxLength(253),
|
|
15028
|
-
|
|
15280
|
+
_ts_metadata58("design:type", String)
|
|
15029
15281
|
], OAuthCallbackQueryDto.prototype, "hd", void 0);
|
|
15030
|
-
function
|
|
15282
|
+
function _ts_decorate61(decorators, target, key, desc) {
|
|
15031
15283
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15032
15284
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
15033
15285
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -15040,13 +15292,13 @@ function _ts_decorate60(decorators, target, key, desc) {
|
|
|
15040
15292
|
}
|
|
15041
15293
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15042
15294
|
}
|
|
15043
|
-
__name(
|
|
15044
|
-
function
|
|
15295
|
+
__name(_ts_decorate61, "_ts_decorate");
|
|
15296
|
+
function _ts_metadata59(metadataKey, metadataValue) {
|
|
15045
15297
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
15046
15298
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
15047
15299
|
}
|
|
15048
15300
|
}
|
|
15049
|
-
__name(
|
|
15301
|
+
__name(_ts_metadata59, "_ts_metadata");
|
|
15050
15302
|
var OAuthInitiateQueryDto = class {
|
|
15051
15303
|
static {
|
|
15052
15304
|
__name(this, "OAuthInitiateQueryDto");
|
|
@@ -15063,7 +15315,7 @@ var OAuthInitiateQueryDto = class {
|
|
|
15063
15315
|
*/
|
|
15064
15316
|
tenantId;
|
|
15065
15317
|
};
|
|
15066
|
-
|
|
15318
|
+
_ts_decorate61([
|
|
15067
15319
|
IsOptional(),
|
|
15068
15320
|
IsString(),
|
|
15069
15321
|
IsNotEmpty(),
|
|
@@ -15071,11 +15323,11 @@ _ts_decorate60([
|
|
|
15071
15323
|
Matches(NO_CONTROL_CHARACTERS, {
|
|
15072
15324
|
message: "tenantId must not contain control characters"
|
|
15073
15325
|
}),
|
|
15074
|
-
|
|
15326
|
+
_ts_metadata59("design:type", String)
|
|
15075
15327
|
], OAuthInitiateQueryDto.prototype, "tenantId", void 0);
|
|
15076
15328
|
|
|
15077
15329
|
// src/server/oauth/oauth.controller.ts
|
|
15078
|
-
function
|
|
15330
|
+
function _ts_decorate62(decorators, target, key, desc) {
|
|
15079
15331
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15080
15332
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
15081
15333
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -15088,13 +15340,13 @@ function _ts_decorate61(decorators, target, key, desc) {
|
|
|
15088
15340
|
}
|
|
15089
15341
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15090
15342
|
}
|
|
15091
|
-
__name(
|
|
15092
|
-
function
|
|
15343
|
+
__name(_ts_decorate62, "_ts_decorate");
|
|
15344
|
+
function _ts_metadata60(metadataKey, metadataValue) {
|
|
15093
15345
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
15094
15346
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
15095
15347
|
}
|
|
15096
15348
|
}
|
|
15097
|
-
__name(
|
|
15349
|
+
__name(_ts_metadata60, "_ts_metadata");
|
|
15098
15350
|
function _ts_param37(paramIndex, decorator) {
|
|
15099
15351
|
return function(target, key) {
|
|
15100
15352
|
decorator(target, key, paramIndex);
|
|
@@ -15318,7 +15570,7 @@ var OAuthController = class _OAuthController {
|
|
|
15318
15570
|
});
|
|
15319
15571
|
}
|
|
15320
15572
|
};
|
|
15321
|
-
|
|
15573
|
+
_ts_decorate62([
|
|
15322
15574
|
Throttle(AUTH_THROTTLE_CONFIGS.oauthInitiate),
|
|
15323
15575
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.oauthInitiate),
|
|
15324
15576
|
Get(":provider"),
|
|
@@ -15328,16 +15580,16 @@ _ts_decorate61([
|
|
|
15328
15580
|
_ts_param37(3, Res({
|
|
15329
15581
|
passthrough: true
|
|
15330
15582
|
})),
|
|
15331
|
-
|
|
15332
|
-
|
|
15583
|
+
_ts_metadata60("design:type", Function),
|
|
15584
|
+
_ts_metadata60("design:paramtypes", [
|
|
15333
15585
|
String,
|
|
15334
15586
|
typeof OAuthInitiateQueryDto === "undefined" ? Object : OAuthInitiateQueryDto,
|
|
15335
15587
|
typeof Request === "undefined" ? Object : Request,
|
|
15336
15588
|
typeof Response === "undefined" ? Object : Response
|
|
15337
15589
|
]),
|
|
15338
|
-
|
|
15590
|
+
_ts_metadata60("design:returntype", Promise)
|
|
15339
15591
|
], OAuthController.prototype, "initiate", null);
|
|
15340
|
-
|
|
15592
|
+
_ts_decorate62([
|
|
15341
15593
|
Throttle(AUTH_THROTTLE_CONFIGS.oauthCallback),
|
|
15342
15594
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.oauthCallback),
|
|
15343
15595
|
HttpCode(HttpStatus.OK),
|
|
@@ -15348,29 +15600,29 @@ _ts_decorate61([
|
|
|
15348
15600
|
_ts_param37(3, Res({
|
|
15349
15601
|
passthrough: true
|
|
15350
15602
|
})),
|
|
15351
|
-
|
|
15352
|
-
|
|
15603
|
+
_ts_metadata60("design:type", Function),
|
|
15604
|
+
_ts_metadata60("design:paramtypes", [
|
|
15353
15605
|
String,
|
|
15354
15606
|
typeof OAuthCallbackQueryDto === "undefined" ? Object : OAuthCallbackQueryDto,
|
|
15355
15607
|
typeof Request === "undefined" ? Object : Request,
|
|
15356
15608
|
typeof Response === "undefined" ? Object : Response
|
|
15357
15609
|
]),
|
|
15358
|
-
|
|
15610
|
+
_ts_metadata60("design:returntype", Promise)
|
|
15359
15611
|
], OAuthController.prototype, "callback", null);
|
|
15360
|
-
OAuthController =
|
|
15612
|
+
OAuthController = _ts_decorate62([
|
|
15361
15613
|
Public(),
|
|
15362
15614
|
SkipMfa(),
|
|
15363
15615
|
UseInterceptors(NoStoreInterceptor),
|
|
15364
15616
|
Controller("oauth"),
|
|
15365
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
15617
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
15366
15618
|
UsePipes(createAuthValidationPipe({
|
|
15367
15619
|
forbidUnknownValues: true
|
|
15368
15620
|
})),
|
|
15369
15621
|
_ts_param37(0, Inject(OAuthService)),
|
|
15370
15622
|
_ts_param37(1, Inject(TokenDeliveryService)),
|
|
15371
15623
|
_ts_param37(2, Inject(BYMAX_AUTH_OPTIONS)),
|
|
15372
|
-
|
|
15373
|
-
|
|
15624
|
+
_ts_metadata60("design:type", Function),
|
|
15625
|
+
_ts_metadata60("design:paramtypes", [
|
|
15374
15626
|
typeof OAuthService === "undefined" ? Object : OAuthService,
|
|
15375
15627
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService,
|
|
15376
15628
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
@@ -15509,7 +15761,7 @@ var GoogleOAuthPlugin = class {
|
|
|
15509
15761
|
};
|
|
15510
15762
|
|
|
15511
15763
|
// src/server/oauth/oauth.module.ts
|
|
15512
|
-
function
|
|
15764
|
+
function _ts_decorate63(decorators, target, key, desc) {
|
|
15513
15765
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15514
15766
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
15515
15767
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -15522,7 +15774,7 @@ function _ts_decorate62(decorators, target, key, desc) {
|
|
|
15522
15774
|
}
|
|
15523
15775
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15524
15776
|
}
|
|
15525
|
-
__name(
|
|
15777
|
+
__name(_ts_decorate63, "_ts_decorate");
|
|
15526
15778
|
function buildOAuthPlugins(options) {
|
|
15527
15779
|
const plugins = [];
|
|
15528
15780
|
if (options.oauth?.google) {
|
|
@@ -15592,7 +15844,7 @@ var OAuthModule = class _OAuthModule {
|
|
|
15592
15844
|
};
|
|
15593
15845
|
}
|
|
15594
15846
|
};
|
|
15595
|
-
OAuthModule =
|
|
15847
|
+
OAuthModule = _ts_decorate63([
|
|
15596
15848
|
Module({})
|
|
15597
15849
|
], OAuthModule);
|
|
15598
15850
|
|
|
@@ -16487,7 +16739,7 @@ function schemesFor(options, registered, cookieDelivery, bearerDelivery) {
|
|
|
16487
16739
|
__name(schemesFor, "schemesFor");
|
|
16488
16740
|
|
|
16489
16741
|
// src/server/openapi/auth-openapi.contributor.ts
|
|
16490
|
-
function
|
|
16742
|
+
function _ts_decorate64(decorators, target, key, desc) {
|
|
16491
16743
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16492
16744
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
16493
16745
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -16500,13 +16752,13 @@ function _ts_decorate63(decorators, target, key, desc) {
|
|
|
16500
16752
|
}
|
|
16501
16753
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16502
16754
|
}
|
|
16503
|
-
__name(
|
|
16504
|
-
function
|
|
16755
|
+
__name(_ts_decorate64, "_ts_decorate");
|
|
16756
|
+
function _ts_metadata61(metadataKey, metadataValue) {
|
|
16505
16757
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
16506
16758
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
16507
16759
|
}
|
|
16508
16760
|
}
|
|
16509
|
-
__name(
|
|
16761
|
+
__name(_ts_metadata61, "_ts_metadata");
|
|
16510
16762
|
function _ts_param38(paramIndex, decorator) {
|
|
16511
16763
|
return function(target, key) {
|
|
16512
16764
|
decorator(target, key, paramIndex);
|
|
@@ -16532,18 +16784,18 @@ var AuthOpenApiContributor = class {
|
|
|
16532
16784
|
return buildAuthOpenApiFragment(this.options, this.registered);
|
|
16533
16785
|
}
|
|
16534
16786
|
};
|
|
16535
|
-
AuthOpenApiContributor =
|
|
16787
|
+
AuthOpenApiContributor = _ts_decorate64([
|
|
16536
16788
|
Injectable(),
|
|
16537
16789
|
SetMetadata(OPENAPI_CONTRIBUTOR_METADATA, true),
|
|
16538
16790
|
_ts_param38(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
16539
16791
|
_ts_param38(1, Inject(BYMAX_AUTH_REGISTERED_CONTROLLERS)),
|
|
16540
|
-
|
|
16541
|
-
|
|
16792
|
+
_ts_metadata61("design:type", Function),
|
|
16793
|
+
_ts_metadata61("design:paramtypes", [
|
|
16542
16794
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
16543
16795
|
typeof RegisteredControllers === "undefined" ? Object : RegisteredControllers
|
|
16544
16796
|
])
|
|
16545
16797
|
], AuthOpenApiContributor);
|
|
16546
|
-
function
|
|
16798
|
+
function _ts_decorate65(decorators, target, key, desc) {
|
|
16547
16799
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16548
16800
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
16549
16801
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -16556,13 +16808,13 @@ function _ts_decorate64(decorators, target, key, desc) {
|
|
|
16556
16808
|
}
|
|
16557
16809
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16558
16810
|
}
|
|
16559
|
-
__name(
|
|
16560
|
-
function
|
|
16811
|
+
__name(_ts_decorate65, "_ts_decorate");
|
|
16812
|
+
function _ts_metadata62(metadataKey, metadataValue) {
|
|
16561
16813
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
16562
16814
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
16563
16815
|
}
|
|
16564
16816
|
}
|
|
16565
|
-
__name(
|
|
16817
|
+
__name(_ts_metadata62, "_ts_metadata");
|
|
16566
16818
|
function _ts_param39(paramIndex, decorator) {
|
|
16567
16819
|
return function(target, key) {
|
|
16568
16820
|
decorator(target, key, paramIndex);
|
|
@@ -16874,16 +17126,16 @@ var CommonPasswordChecker = class {
|
|
|
16874
17126
|
return false;
|
|
16875
17127
|
}
|
|
16876
17128
|
};
|
|
16877
|
-
CommonPasswordChecker =
|
|
17129
|
+
CommonPasswordChecker = _ts_decorate65([
|
|
16878
17130
|
Injectable(),
|
|
16879
17131
|
_ts_param39(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
16880
17132
|
_ts_param39(0, Optional()),
|
|
16881
|
-
|
|
16882
|
-
|
|
17133
|
+
_ts_metadata62("design:type", Function),
|
|
17134
|
+
_ts_metadata62("design:paramtypes", [
|
|
16883
17135
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
16884
17136
|
])
|
|
16885
17137
|
], CommonPasswordChecker);
|
|
16886
|
-
function
|
|
17138
|
+
function _ts_decorate66(decorators, target, key, desc) {
|
|
16887
17139
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16888
17140
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
16889
17141
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -16896,7 +17148,7 @@ function _ts_decorate65(decorators, target, key, desc) {
|
|
|
16896
17148
|
}
|
|
16897
17149
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16898
17150
|
}
|
|
16899
|
-
__name(
|
|
17151
|
+
__name(_ts_decorate66, "_ts_decorate");
|
|
16900
17152
|
var NoOpEmailProvider = class _NoOpEmailProvider {
|
|
16901
17153
|
static {
|
|
16902
17154
|
__name(this, "NoOpEmailProvider");
|
|
@@ -16931,7 +17183,7 @@ var NoOpEmailProvider = class _NoOpEmailProvider {
|
|
|
16931
17183
|
this.logger.log(`sendInvitation \u2192 ${maskEmail(email)} (no-op)`);
|
|
16932
17184
|
}
|
|
16933
17185
|
};
|
|
16934
|
-
NoOpEmailProvider =
|
|
17186
|
+
NoOpEmailProvider = _ts_decorate66([
|
|
16935
17187
|
Injectable()
|
|
16936
17188
|
], NoOpEmailProvider);
|
|
16937
17189
|
|
|
@@ -16945,7 +17197,7 @@ var SystemApiKeyClock = class {
|
|
|
16945
17197
|
return /* @__PURE__ */ new Date();
|
|
16946
17198
|
}
|
|
16947
17199
|
};
|
|
16948
|
-
function
|
|
17200
|
+
function _ts_decorate67(decorators, target, key, desc) {
|
|
16949
17201
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16950
17202
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
16951
17203
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -16958,13 +17210,13 @@ function _ts_decorate66(decorators, target, key, desc) {
|
|
|
16958
17210
|
}
|
|
16959
17211
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16960
17212
|
}
|
|
16961
|
-
__name(
|
|
16962
|
-
function
|
|
17213
|
+
__name(_ts_decorate67, "_ts_decorate");
|
|
17214
|
+
function _ts_metadata63(metadataKey, metadataValue) {
|
|
16963
17215
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
16964
17216
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
16965
17217
|
}
|
|
16966
17218
|
}
|
|
16967
|
-
__name(
|
|
17219
|
+
__name(_ts_metadata63, "_ts_metadata");
|
|
16968
17220
|
function _ts_param40(paramIndex, decorator) {
|
|
16969
17221
|
return function(target, key) {
|
|
16970
17222
|
decorator(target, key, paramIndex);
|
|
@@ -17013,21 +17265,21 @@ var ApiKeyScopeAuditService = class {
|
|
|
17013
17265
|
}
|
|
17014
17266
|
}
|
|
17015
17267
|
};
|
|
17016
|
-
ApiKeyScopeAuditService =
|
|
17268
|
+
ApiKeyScopeAuditService = _ts_decorate67([
|
|
17017
17269
|
Injectable(),
|
|
17018
17270
|
_ts_param40(0, Inject(DiscoveryService)),
|
|
17019
17271
|
_ts_param40(1, Inject(MetadataScanner)),
|
|
17020
17272
|
_ts_param40(2, Inject(Reflector)),
|
|
17021
17273
|
_ts_param40(3, Inject(BYMAX_AUTH_OPTIONS)),
|
|
17022
|
-
|
|
17023
|
-
|
|
17274
|
+
_ts_metadata63("design:type", Function),
|
|
17275
|
+
_ts_metadata63("design:paramtypes", [
|
|
17024
17276
|
typeof DiscoveryService === "undefined" ? Object : DiscoveryService,
|
|
17025
17277
|
typeof MetadataScanner === "undefined" ? Object : MetadataScanner,
|
|
17026
17278
|
typeof Reflector === "undefined" ? Object : Reflector,
|
|
17027
17279
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
17028
17280
|
])
|
|
17029
17281
|
], ApiKeyScopeAuditService);
|
|
17030
|
-
function
|
|
17282
|
+
function _ts_decorate68(decorators, target, key, desc) {
|
|
17031
17283
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17032
17284
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
17033
17285
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -17040,13 +17292,13 @@ function _ts_decorate67(decorators, target, key, desc) {
|
|
|
17040
17292
|
}
|
|
17041
17293
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17042
17294
|
}
|
|
17043
|
-
__name(
|
|
17044
|
-
function
|
|
17295
|
+
__name(_ts_decorate68, "_ts_decorate");
|
|
17296
|
+
function _ts_metadata64(metadataKey, metadataValue) {
|
|
17045
17297
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
17046
17298
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
17047
17299
|
}
|
|
17048
17300
|
}
|
|
17049
|
-
__name(
|
|
17301
|
+
__name(_ts_metadata64, "_ts_metadata");
|
|
17050
17302
|
function _ts_param41(paramIndex, decorator) {
|
|
17051
17303
|
return function(target, key) {
|
|
17052
17304
|
decorator(target, key, paramIndex);
|
|
@@ -17181,13 +17433,13 @@ var ApiKeyService = class {
|
|
|
17181
17433
|
return value;
|
|
17182
17434
|
}
|
|
17183
17435
|
};
|
|
17184
|
-
ApiKeyService =
|
|
17436
|
+
ApiKeyService = _ts_decorate68([
|
|
17185
17437
|
Injectable(),
|
|
17186
17438
|
_ts_param41(0, Inject(BYMAX_AUTH_API_KEY_REPOSITORY)),
|
|
17187
17439
|
_ts_param41(1, Inject(BYMAX_AUTH_API_KEY_CLOCK)),
|
|
17188
17440
|
_ts_param41(2, Inject(BYMAX_AUTH_OPTIONS)),
|
|
17189
|
-
|
|
17190
|
-
|
|
17441
|
+
_ts_metadata64("design:type", Function),
|
|
17442
|
+
_ts_metadata64("design:paramtypes", [
|
|
17191
17443
|
typeof IApiKeyRepository === "undefined" ? Object : IApiKeyRepository,
|
|
17192
17444
|
typeof ApiKeyClock === "undefined" ? Object : ApiKeyClock,
|
|
17193
17445
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
@@ -17269,7 +17521,7 @@ async function assertTenantBinding(options, handshake, tenantId) {
|
|
|
17269
17521
|
__name(assertTenantBinding, "assertTenantBinding");
|
|
17270
17522
|
|
|
17271
17523
|
// src/server/services/auth-token-verifier.service.ts
|
|
17272
|
-
function
|
|
17524
|
+
function _ts_decorate69(decorators, target, key, desc) {
|
|
17273
17525
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17274
17526
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
17275
17527
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -17282,13 +17534,13 @@ function _ts_decorate68(decorators, target, key, desc) {
|
|
|
17282
17534
|
}
|
|
17283
17535
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17284
17536
|
}
|
|
17285
|
-
__name(
|
|
17286
|
-
function
|
|
17537
|
+
__name(_ts_decorate69, "_ts_decorate");
|
|
17538
|
+
function _ts_metadata65(metadataKey, metadataValue) {
|
|
17287
17539
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
17288
17540
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
17289
17541
|
}
|
|
17290
17542
|
}
|
|
17291
|
-
__name(
|
|
17543
|
+
__name(_ts_metadata65, "_ts_metadata");
|
|
17292
17544
|
function _ts_param42(paramIndex, decorator) {
|
|
17293
17545
|
return function(target, key) {
|
|
17294
17546
|
decorator(target, key, paramIndex);
|
|
@@ -17478,14 +17730,14 @@ var AuthTokenVerifierService = class _AuthTokenVerifierService {
|
|
|
17478
17730
|
}
|
|
17479
17731
|
}
|
|
17480
17732
|
};
|
|
17481
|
-
AuthTokenVerifierService =
|
|
17733
|
+
AuthTokenVerifierService = _ts_decorate69([
|
|
17482
17734
|
Injectable(),
|
|
17483
17735
|
_ts_param42(0, Inject(JwtService)),
|
|
17484
17736
|
_ts_param42(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
17485
17737
|
_ts_param42(2, Inject(AuthRevocationService)),
|
|
17486
17738
|
_ts_param42(3, Inject(AccountStatusService)),
|
|
17487
|
-
|
|
17488
|
-
|
|
17739
|
+
_ts_metadata65("design:type", Function),
|
|
17740
|
+
_ts_metadata65("design:paramtypes", [
|
|
17489
17741
|
typeof JwtService === "undefined" ? Object : JwtService,
|
|
17490
17742
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
17491
17743
|
typeof AuthRevocationService === "undefined" ? Object : AuthRevocationService,
|
|
@@ -17494,7 +17746,7 @@ AuthTokenVerifierService = _ts_decorate68([
|
|
|
17494
17746
|
], AuthTokenVerifierService);
|
|
17495
17747
|
|
|
17496
17748
|
// src/server/bymax-auth.module.ts
|
|
17497
|
-
function
|
|
17749
|
+
function _ts_decorate70(decorators, target, key, desc) {
|
|
17498
17750
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17499
17751
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
17500
17752
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -17507,7 +17759,7 @@ function _ts_decorate69(decorators, target, key, desc) {
|
|
|
17507
17759
|
}
|
|
17508
17760
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17509
17761
|
}
|
|
17510
|
-
__name(
|
|
17762
|
+
__name(_ts_decorate70, "_ts_decorate");
|
|
17511
17763
|
function hasProviderToken(providers, token) {
|
|
17512
17764
|
return providers.some((p) => {
|
|
17513
17765
|
if (typeof p === "function") return false;
|
|
@@ -17767,6 +18019,7 @@ var BymaxAuthModule = class _BymaxAuthModule {
|
|
|
17767
18019
|
AuthService,
|
|
17768
18020
|
// Guards — registered as providers so they can be applied via @UseGuards().
|
|
17769
18021
|
JwtAuthGuard,
|
|
18022
|
+
RequestEncodingGuard,
|
|
17770
18023
|
TrustedOriginGuard,
|
|
17771
18024
|
AuthRateLimitGuard,
|
|
17772
18025
|
// Response-header interceptor — every library controller applies it, so it must be
|
|
@@ -17799,6 +18052,7 @@ var BymaxAuthModule = class _BymaxAuthModule {
|
|
|
17799
18052
|
AuthService,
|
|
17800
18053
|
// Export guards so host-app modules can apply them without reimporting.
|
|
17801
18054
|
JwtAuthGuard,
|
|
18055
|
+
RequestEncodingGuard,
|
|
17802
18056
|
TrustedOriginGuard,
|
|
17803
18057
|
AuthRateLimitGuard,
|
|
17804
18058
|
RolesGuard,
|
|
@@ -17897,7 +18151,7 @@ var BymaxAuthModule = class _BymaxAuthModule {
|
|
|
17897
18151
|
};
|
|
17898
18152
|
}
|
|
17899
18153
|
};
|
|
17900
|
-
BymaxAuthModule =
|
|
18154
|
+
BymaxAuthModule = _ts_decorate70([
|
|
17901
18155
|
Module({})
|
|
17902
18156
|
], BymaxAuthModule);
|
|
17903
18157
|
|
|
@@ -18225,7 +18479,7 @@ var DefaultAuthEmailProvider = class _DefaultAuthEmailProvider {
|
|
|
18225
18479
|
}
|
|
18226
18480
|
}
|
|
18227
18481
|
};
|
|
18228
|
-
function
|
|
18482
|
+
function _ts_decorate71(decorators, target, key, desc) {
|
|
18229
18483
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18230
18484
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18231
18485
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18238,13 +18492,13 @@ function _ts_decorate70(decorators, target, key, desc) {
|
|
|
18238
18492
|
}
|
|
18239
18493
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18240
18494
|
}
|
|
18241
|
-
__name(
|
|
18242
|
-
function
|
|
18495
|
+
__name(_ts_decorate71, "_ts_decorate");
|
|
18496
|
+
function _ts_metadata66(metadataKey, metadataValue) {
|
|
18243
18497
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
18244
18498
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
18245
18499
|
}
|
|
18246
18500
|
}
|
|
18247
|
-
__name(
|
|
18501
|
+
__name(_ts_metadata66, "_ts_metadata");
|
|
18248
18502
|
var HIBP_RANGE_URL = "https://api.pwnedpasswords.com/range/";
|
|
18249
18503
|
var PREFIX_LENGTH = 5;
|
|
18250
18504
|
var DEFAULT_TIMEOUT_MS = 1500;
|
|
@@ -18301,10 +18555,10 @@ var HibpBreachChecker = class _HibpBreachChecker {
|
|
|
18301
18555
|
}
|
|
18302
18556
|
}
|
|
18303
18557
|
};
|
|
18304
|
-
HibpBreachChecker =
|
|
18558
|
+
HibpBreachChecker = _ts_decorate71([
|
|
18305
18559
|
Injectable(),
|
|
18306
|
-
|
|
18307
|
-
|
|
18560
|
+
_ts_metadata66("design:type", Function),
|
|
18561
|
+
_ts_metadata66("design:paramtypes", [
|
|
18308
18562
|
Number
|
|
18309
18563
|
])
|
|
18310
18564
|
], HibpBreachChecker);
|
|
@@ -18317,10 +18571,10 @@ var AllowAllBreachChecker = class {
|
|
|
18317
18571
|
return false;
|
|
18318
18572
|
}
|
|
18319
18573
|
};
|
|
18320
|
-
AllowAllBreachChecker =
|
|
18574
|
+
AllowAllBreachChecker = _ts_decorate71([
|
|
18321
18575
|
Injectable()
|
|
18322
18576
|
], AllowAllBreachChecker);
|
|
18323
|
-
function
|
|
18577
|
+
function _ts_decorate72(decorators, target, key, desc) {
|
|
18324
18578
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18325
18579
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18326
18580
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18333,7 +18587,7 @@ function _ts_decorate71(decorators, target, key, desc) {
|
|
|
18333
18587
|
}
|
|
18334
18588
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18335
18589
|
}
|
|
18336
|
-
__name(
|
|
18590
|
+
__name(_ts_decorate72, "_ts_decorate");
|
|
18337
18591
|
var OptionalAuthGuard = class extends JwtAuthGuard {
|
|
18338
18592
|
static {
|
|
18339
18593
|
__name(this, "OptionalAuthGuard");
|
|
@@ -18348,10 +18602,10 @@ var OptionalAuthGuard = class extends JwtAuthGuard {
|
|
|
18348
18602
|
return super.canActivate(context);
|
|
18349
18603
|
}
|
|
18350
18604
|
};
|
|
18351
|
-
OptionalAuthGuard =
|
|
18605
|
+
OptionalAuthGuard = _ts_decorate72([
|
|
18352
18606
|
Injectable()
|
|
18353
18607
|
], OptionalAuthGuard);
|
|
18354
|
-
function
|
|
18608
|
+
function _ts_decorate73(decorators, target, key, desc) {
|
|
18355
18609
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18356
18610
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18357
18611
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18364,13 +18618,13 @@ function _ts_decorate72(decorators, target, key, desc) {
|
|
|
18364
18618
|
}
|
|
18365
18619
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18366
18620
|
}
|
|
18367
|
-
__name(
|
|
18368
|
-
function
|
|
18621
|
+
__name(_ts_decorate73, "_ts_decorate");
|
|
18622
|
+
function _ts_metadata67(metadataKey, metadataValue) {
|
|
18369
18623
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
18370
18624
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
18371
18625
|
}
|
|
18372
18626
|
}
|
|
18373
|
-
__name(
|
|
18627
|
+
__name(_ts_metadata67, "_ts_metadata");
|
|
18374
18628
|
function _ts_param43(paramIndex, decorator) {
|
|
18375
18629
|
return function(target, key) {
|
|
18376
18630
|
decorator(target, key, paramIndex);
|
|
@@ -18406,11 +18660,11 @@ var SelfOrAdminGuard = class {
|
|
|
18406
18660
|
throw new AuthException(AUTH_ERROR_CODES.INSUFFICIENT_ROLE);
|
|
18407
18661
|
}
|
|
18408
18662
|
};
|
|
18409
|
-
SelfOrAdminGuard =
|
|
18663
|
+
SelfOrAdminGuard = _ts_decorate73([
|
|
18410
18664
|
Injectable(),
|
|
18411
18665
|
_ts_param43(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
18412
|
-
|
|
18413
|
-
|
|
18666
|
+
_ts_metadata67("design:type", Function),
|
|
18667
|
+
_ts_metadata67("design:paramtypes", [
|
|
18414
18668
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
18415
18669
|
])
|
|
18416
18670
|
], SelfOrAdminGuard);
|
|
@@ -18423,7 +18677,7 @@ function isHexLooking(value) {
|
|
|
18423
18677
|
return value.length === 64 && /^[a-fA-F0-9]{64}$/.test(value);
|
|
18424
18678
|
}
|
|
18425
18679
|
__name(isHexLooking, "isHexLooking");
|
|
18426
|
-
function
|
|
18680
|
+
function _ts_decorate74(decorators, target, key, desc) {
|
|
18427
18681
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18428
18682
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18429
18683
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18436,13 +18690,13 @@ function _ts_decorate73(decorators, target, key, desc) {
|
|
|
18436
18690
|
}
|
|
18437
18691
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18438
18692
|
}
|
|
18439
|
-
__name(
|
|
18440
|
-
function
|
|
18693
|
+
__name(_ts_decorate74, "_ts_decorate");
|
|
18694
|
+
function _ts_metadata68(metadataKey, metadataValue) {
|
|
18441
18695
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
18442
18696
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
18443
18697
|
}
|
|
18444
18698
|
}
|
|
18445
|
-
__name(
|
|
18699
|
+
__name(_ts_metadata68, "_ts_metadata");
|
|
18446
18700
|
function _ts_param44(paramIndex, decorator) {
|
|
18447
18701
|
return function(target, key) {
|
|
18448
18702
|
decorator(target, key, paramIndex);
|
|
@@ -18512,14 +18766,14 @@ var WsJwtGuard = class {
|
|
|
18512
18766
|
return true;
|
|
18513
18767
|
}
|
|
18514
18768
|
};
|
|
18515
|
-
WsJwtGuard =
|
|
18769
|
+
WsJwtGuard = _ts_decorate74([
|
|
18516
18770
|
Injectable(),
|
|
18517
18771
|
_ts_param44(0, Inject(JwtService)),
|
|
18518
18772
|
_ts_param44(1, Inject(AuthRevocationService)),
|
|
18519
18773
|
_ts_param44(2, Inject(WsTicketService)),
|
|
18520
18774
|
_ts_param44(3, Inject(BYMAX_AUTH_OPTIONS)),
|
|
18521
|
-
|
|
18522
|
-
|
|
18775
|
+
_ts_metadata68("design:type", Function),
|
|
18776
|
+
_ts_metadata68("design:paramtypes", [
|
|
18523
18777
|
typeof JwtService === "undefined" ? Object : JwtService,
|
|
18524
18778
|
typeof AuthRevocationService === "undefined" ? Object : AuthRevocationService,
|
|
18525
18779
|
typeof WsTicketService === "undefined" ? Object : WsTicketService,
|
|
@@ -18559,7 +18813,7 @@ function bindingInput(handshake) {
|
|
|
18559
18813
|
};
|
|
18560
18814
|
}
|
|
18561
18815
|
__name(bindingInput, "bindingInput");
|
|
18562
|
-
function
|
|
18816
|
+
function _ts_decorate75(decorators, target, key, desc) {
|
|
18563
18817
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18564
18818
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18565
18819
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18572,7 +18826,7 @@ function _ts_decorate74(decorators, target, key, desc) {
|
|
|
18572
18826
|
}
|
|
18573
18827
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18574
18828
|
}
|
|
18575
|
-
__name(
|
|
18829
|
+
__name(_ts_decorate75, "_ts_decorate");
|
|
18576
18830
|
function isAuthEnvelope(body) {
|
|
18577
18831
|
if (typeof body !== "object" || body === null) return false;
|
|
18578
18832
|
const error = body.error;
|
|
@@ -18598,6 +18852,12 @@ function bodyParserStatus(exception) {
|
|
|
18598
18852
|
return typeof status === "number" && status >= 400 && status < 500 ? status : void 0;
|
|
18599
18853
|
}
|
|
18600
18854
|
__name(bodyParserStatus, "bodyParserStatus");
|
|
18855
|
+
function isUntypedParserRefusal(exception) {
|
|
18856
|
+
if (!(exception instanceof Error)) return false;
|
|
18857
|
+
const { status, statusCode, expose, type } = exception;
|
|
18858
|
+
return status === HttpStatus.BAD_REQUEST && statusCode === HttpStatus.BAD_REQUEST && expose === true && type === void 0;
|
|
18859
|
+
}
|
|
18860
|
+
__name(isUntypedParserRefusal, "isUntypedParserRefusal");
|
|
18601
18861
|
function bodyParserMessage(status) {
|
|
18602
18862
|
if (status === HttpStatus.PAYLOAD_TOO_LARGE) return "Request entity too large";
|
|
18603
18863
|
if (status === HttpStatus.UNSUPPORTED_MEDIA_TYPE) return "Unsupported media type";
|
|
@@ -18663,6 +18923,16 @@ var AuthExceptionFilter = class _AuthExceptionFilter {
|
|
|
18663
18923
|
});
|
|
18664
18924
|
return;
|
|
18665
18925
|
}
|
|
18926
|
+
if (isUntypedParserRefusal(exception) && http.getRequest().route === void 0) {
|
|
18927
|
+
res.status(HttpStatus.BAD_REQUEST).json({
|
|
18928
|
+
error: {
|
|
18929
|
+
code: AUTH_ERROR_CODES.VALIDATION,
|
|
18930
|
+
message: MALFORMED_REQUEST_MESSAGE,
|
|
18931
|
+
details: null
|
|
18932
|
+
}
|
|
18933
|
+
});
|
|
18934
|
+
return;
|
|
18935
|
+
}
|
|
18666
18936
|
this.logger.error(`unhandled exception: ${describeChannelStatus(exception)}`);
|
|
18667
18937
|
res.status(HttpStatus.INTERNAL_SERVER_ERROR).json({
|
|
18668
18938
|
error: {
|
|
@@ -18675,10 +18945,10 @@ var AuthExceptionFilter = class _AuthExceptionFilter {
|
|
|
18675
18945
|
});
|
|
18676
18946
|
}
|
|
18677
18947
|
};
|
|
18678
|
-
AuthExceptionFilter =
|
|
18948
|
+
AuthExceptionFilter = _ts_decorate75([
|
|
18679
18949
|
Catch()
|
|
18680
18950
|
], AuthExceptionFilter);
|
|
18681
|
-
function
|
|
18951
|
+
function _ts_decorate76(decorators, target, key, desc) {
|
|
18682
18952
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18683
18953
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18684
18954
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18691,7 +18961,7 @@ function _ts_decorate75(decorators, target, key, desc) {
|
|
|
18691
18961
|
}
|
|
18692
18962
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18693
18963
|
}
|
|
18694
|
-
__name(
|
|
18964
|
+
__name(_ts_decorate76, "_ts_decorate");
|
|
18695
18965
|
function isEmittingClient(client) {
|
|
18696
18966
|
return typeof client?.emit === "function";
|
|
18697
18967
|
}
|
|
@@ -18735,10 +19005,10 @@ var WsAuthExceptionFilter = class _WsAuthExceptionFilter {
|
|
|
18735
19005
|
this.logger.error(`refused a request on a client this filter cannot answer: ${describeChannelStatus(exception)}`);
|
|
18736
19006
|
}
|
|
18737
19007
|
};
|
|
18738
|
-
WsAuthExceptionFilter =
|
|
19008
|
+
WsAuthExceptionFilter = _ts_decorate76([
|
|
18739
19009
|
Catch(AuthException)
|
|
18740
19010
|
], WsAuthExceptionFilter);
|
|
18741
19011
|
var ServiceKey = /* @__PURE__ */ __name((...scopes) => applyDecorators(SetMetadata(IS_PUBLIC_KEY, true), ApiKeyScopes(...scopes), UseGuards(ApiKeyGuard)), "ServiceKey");
|
|
18742
19012
|
var CurrentApiKey = createParamDecorator((_data, ctx) => ctx.switchToHttp().getRequest().apiKey);
|
|
18743
19013
|
|
|
18744
|
-
export { API_KEY_MAX_LABEL_LENGTH, API_KEY_MAX_OVERLAP_SECONDS, AUTH_EMAIL_KINDS, AUTH_ERROR_CODES, AUTH_ERROR_MESSAGES, AUTH_ERROR_STATUS, AUTH_SECURITY_SCHEMES, AUTH_THROTTLE_CONFIGS, AcceptInvitationDto, AccountStatusService, AllowAllBreachChecker, ApiKeyGuard, ApiKeyScopes, ApiKeyService, AuthException, AuthExceptionFilter, AuthRateLimit, AuthRateLimitGuard, AuthRevocationService, AuthService, AuthTokenVerifierService, Authenticated, BYMAX_AUTH_API_KEY_CLOCK, BYMAX_AUTH_API_KEY_REPOSITORY, BYMAX_AUTH_BREACH_CHECKER, BYMAX_AUTH_EMAIL_PROVIDER, BYMAX_AUTH_HOOKS, BYMAX_AUTH_OPTIONS, BYMAX_AUTH_PLATFORM_USER_REPOSITORY, BYMAX_AUTH_REDIS_CLIENT, BYMAX_AUTH_USER_REPOSITORY, BruteForceService, BymaxAuthModule, ChangePasswordDto, CommonPasswordChecker, CreateInvitationDto, CurrentApiKey, CurrentUser, DefaultAuthEmailProvider, EmailChangeService, ForgotPasswordDto, HibpBreachChecker, IS_PUBLIC_KEY, InvitationService, JwtAuthGuard, JwtPlatformGuard, LoginDto, MfaChallengeDto, MfaDisableDto, MfaRegenerateRecoveryCodesDto, MfaRequiredGuard, MfaService, MfaVerifyDto, NoOpAuthHooks, NoOpEmailProvider, OAuthService, OptionalAuthGuard, OtpService, PLATFORM_ROLES_KEY, PasswordResetService, PlatformAuthService, PlatformLoginDto, PlatformRoles, PlatformRolesGuard, Public, ROLES_KEY, RegisterDto, ResendOtpDto, ResendVerificationDto, ResetPasswordDto, Roles, RolesGuard, SKIP_MFA_KEY, SelfOrAdminGuard, ServiceKey, SessionService, SkipMfa, TokenDeliveryService, TrustedOriginGuard, UserStatusGuard, VerifyEmailDto, VerifyOtpDto, WS_TICKET_TTL_SECONDS, WsAuthExceptionFilter, WsJwtGuard, WsTicketService, authDocumentSecurity, createAuthValidationPipe, decrypt, describeChannelStatus, describeError, encrypt, generateSecureToken, hasRole, hmacSha256, redactSecrets, reduceToBaseWord, sanitizeHeaders, sha256, sleep, timingSafeCompare };
|
|
19014
|
+
export { API_KEY_MAX_LABEL_LENGTH, API_KEY_MAX_OVERLAP_SECONDS, AUTH_EMAIL_KINDS, AUTH_ERROR_CODES, AUTH_ERROR_MESSAGES, AUTH_ERROR_STATUS, AUTH_SECURITY_SCHEMES, AUTH_THROTTLE_CONFIGS, AcceptInvitationDto, AccountStatusService, AllowAllBreachChecker, ApiKeyGuard, ApiKeyScopes, ApiKeyService, AuthException, AuthExceptionFilter, AuthRateLimit, AuthRateLimitGuard, AuthRevocationService, AuthService, AuthTokenVerifierService, Authenticated, BYMAX_AUTH_API_KEY_CLOCK, BYMAX_AUTH_API_KEY_REPOSITORY, BYMAX_AUTH_BREACH_CHECKER, BYMAX_AUTH_EMAIL_PROVIDER, BYMAX_AUTH_HOOKS, BYMAX_AUTH_OPTIONS, BYMAX_AUTH_PLATFORM_USER_REPOSITORY, BYMAX_AUTH_REDIS_CLIENT, BYMAX_AUTH_USER_REPOSITORY, BruteForceService, BymaxAuthModule, ChangePasswordDto, CommonPasswordChecker, CreateInvitationDto, CurrentApiKey, CurrentUser, DefaultAuthEmailProvider, EmailChangeService, ForgotPasswordDto, HibpBreachChecker, IS_PUBLIC_KEY, InvitationService, JwtAuthGuard, JwtPlatformGuard, LoginDto, MfaChallengeDto, MfaDisableDto, MfaRegenerateRecoveryCodesDto, MfaRequiredGuard, MfaService, MfaVerifyDto, NoOpAuthHooks, NoOpEmailProvider, OAuthService, OptionalAuthGuard, OtpService, PLATFORM_ROLES_KEY, PasswordResetService, PlatformAuthService, PlatformLoginDto, PlatformRoles, PlatformRolesGuard, Public, ROLES_KEY, RegisterDto, RequestEncoding, RequestEncodingGuard, ResendOtpDto, ResendVerificationDto, ResetPasswordDto, Roles, RolesGuard, SKIP_MFA_KEY, SelfOrAdminGuard, ServiceKey, SessionService, SkipMfa, TokenDeliveryService, TrustedOriginGuard, UserStatusGuard, VerifyEmailDto, VerifyOtpDto, WS_TICKET_TTL_SECONDS, WsAuthExceptionFilter, WsJwtGuard, WsTicketService, authDocumentSecurity, createAuthValidationPipe, decrypt, describeChannelStatus, describeError, encrypt, generateSecureToken, hasRole, hmacSha256, redactSecrets, reduceToBaseWord, sanitizeHeaders, sha256, sleep, timingSafeCompare };
|