@bymax-one/nest-auth 1.4.17 → 1.4.18
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 +67 -1
- package/dist/server/index.cjs +901 -679
- package/dist/server/index.d.cts +121 -3
- package/dist/server/index.d.ts +121 -3
- package/dist/server/index.mjs +901 -680
- 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,29 @@ 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, 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
|
+
return fromSession;
|
|
6712
|
+
}
|
|
6713
|
+
}
|
|
6714
|
+
__name(settlePendingLogout, "settlePendingLogout");
|
|
6715
|
+
|
|
6603
6716
|
// src/server/utils/resolve-tenant-id.ts
|
|
6604
6717
|
async function resolveTenantId(dtoTenantId, req, resolver) {
|
|
6605
6718
|
if (resolver) {
|
|
@@ -6646,7 +6759,7 @@ function tenantScoped(user, tenantId) {
|
|
|
6646
6759
|
__name(tenantScoped, "tenantScoped");
|
|
6647
6760
|
|
|
6648
6761
|
// src/server/services/auth.service.ts
|
|
6649
|
-
function
|
|
6762
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
6650
6763
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6651
6764
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
6652
6765
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -6659,13 +6772,13 @@ function _ts_decorate19(decorators, target, key, desc) {
|
|
|
6659
6772
|
}
|
|
6660
6773
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6661
6774
|
}
|
|
6662
|
-
__name(
|
|
6663
|
-
function
|
|
6775
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
6776
|
+
function _ts_metadata19(metadataKey, metadataValue) {
|
|
6664
6777
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
6665
6778
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
6666
6779
|
}
|
|
6667
6780
|
}
|
|
6668
|
-
__name(
|
|
6781
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
6669
6782
|
function _ts_param14(paramIndex, decorator) {
|
|
6670
6783
|
return function(target, key) {
|
|
6671
6784
|
decorator(target, key, paramIndex);
|
|
@@ -7040,39 +7153,83 @@ var AuthService = class _AuthService {
|
|
|
7040
7153
|
*/
|
|
7041
7154
|
async logout(accessToken, rawRefreshToken) {
|
|
7042
7155
|
const sessionHash = sha256(rawRefreshToken);
|
|
7043
|
-
const
|
|
7156
|
+
const markerKey = logoutPendingKey("dashboard", sessionHash);
|
|
7157
|
+
const live = await this.redis.readSessionOwner(`rt:${sessionHash}`);
|
|
7158
|
+
const fromSession = live.userId !== "";
|
|
7159
|
+
const { userId, tenantId } = fromSession ? live : await this.redis.readSessionOwner(markerKey);
|
|
7044
7160
|
this.logger.log(`logout: userId=${logSafe(userId || "(no live session)")}`);
|
|
7045
|
-
|
|
7161
|
+
const failures = await settleWrites([
|
|
7162
|
+
...this.blacklistWrites(accessToken),
|
|
7163
|
+
() => this.redis.del(`rt:${sessionHash}`),
|
|
7164
|
+
() => this.redis.del(`rp:${sessionHash}`)
|
|
7165
|
+
]);
|
|
7166
|
+
await this.revokeSessionMetadata(userId, tenantId, sessionHash);
|
|
7167
|
+
if (failures.length > 0 && fromSession) {
|
|
7168
|
+
await rememberPendingLogout(this.redis, markerKey, {
|
|
7169
|
+
userId,
|
|
7170
|
+
tenantId
|
|
7171
|
+
}, logoutPendingTtlSeconds(this.options.jwt.accessExpiresIn), this.logger);
|
|
7172
|
+
}
|
|
7173
|
+
raiseFirst(failures);
|
|
7174
|
+
if (userId !== "" && await settlePendingLogout(this.redis, markerKey, fromSession, this.logger)) {
|
|
7175
|
+
this.emitLogout(userId, tenantId);
|
|
7176
|
+
}
|
|
7177
|
+
return userId;
|
|
7178
|
+
}
|
|
7179
|
+
/**
|
|
7180
|
+
* The access-token blacklist write for a logout, or none when there is nothing to revoke.
|
|
7181
|
+
*
|
|
7182
|
+
* Verifies signature and algorithm but not expiry: an expired token is the normal case here, a
|
|
7183
|
+
* forged one must not blacklist an id it does not own. Only the verification is tolerant.
|
|
7184
|
+
*
|
|
7185
|
+
* @param accessToken - Raw access token; absent, malformed or expired yields no write.
|
|
7186
|
+
* @returns The writes to hand to `settleWrites`.
|
|
7187
|
+
*/
|
|
7188
|
+
blacklistWrites(accessToken) {
|
|
7046
7189
|
try {
|
|
7047
7190
|
const payload = this.tokenManager.verifyIgnoringExpiry(accessToken);
|
|
7048
7191
|
const remainingTtl = payload.exp - Math.floor(Date.now() / 1e3);
|
|
7049
7192
|
if (remainingTtl > 0) {
|
|
7050
|
-
|
|
7193
|
+
return [
|
|
7051
7194
|
() => this.redis.set(`rv:${payload.jti}`, "1", remainingTtl)
|
|
7052
7195
|
];
|
|
7053
7196
|
}
|
|
7054
7197
|
} catch {
|
|
7055
7198
|
}
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7199
|
+
return [];
|
|
7200
|
+
}
|
|
7201
|
+
/**
|
|
7202
|
+
* Cleans up the session's metadata through `SessionService.revokeSession()`.
|
|
7203
|
+
*
|
|
7204
|
+
* It performs an atomic SISMEMBER ownership check before deleting `sd:{hash}` and SREMing from
|
|
7205
|
+
* `sess:{userId}`. The `rt:{hash}` DEL already ran — revokeSession's internal DEL is a no-op
|
|
7206
|
+
* (Redis DEL is idempotent when the key is absent). SESSION_NOT_FOUND means the session was
|
|
7207
|
+
* evicted, already revoked, or the refresh token does not belong to this user — in all cases
|
|
7208
|
+
* authentication is already invalidated.
|
|
7209
|
+
*
|
|
7210
|
+
* The tenant is REQUIRED to name the index, and it comes off the record rather than from the
|
|
7211
|
+
* caller. A record without one is a pre-upgrade write: the contract lists `tenantId` among the
|
|
7212
|
+
* refresh session's fields, so a live record always has it. Skipping the call is the honest end
|
|
7213
|
+
* for one that does not — `rt:{hash}` is already deleted, so the session is dead either way, and
|
|
7214
|
+
* guessing a tenant would name an index belonging to nobody while reading like a revocation that
|
|
7215
|
+
* happened.
|
|
7216
|
+
*
|
|
7217
|
+
* @param userId - The owner, empty when none is known.
|
|
7218
|
+
* @param tenantId - The owner's tenant, absent when the record carried none.
|
|
7219
|
+
* @param sessionHash - The SHA-256 of the raw refresh token.
|
|
7220
|
+
*/
|
|
7221
|
+
async revokeSessionMetadata(userId, tenantId, sessionHash) {
|
|
7222
|
+
if (!this.options.sessions.enabled || !userId || tenantId === void 0) return;
|
|
7223
|
+
await this.sessionService.revokeSession({
|
|
7224
|
+
userId,
|
|
7225
|
+
tenantId,
|
|
7226
|
+
sessionHash
|
|
7227
|
+
}).catch((err) => {
|
|
7228
|
+
const errCode = err instanceof AuthException ? err.getResponse().error.code : void 0;
|
|
7229
|
+
if (errCode !== AUTH_ERROR_CODES.SESSION_NOT_FOUND) {
|
|
7230
|
+
this.logger.warn(`logout: session cleanup failed \u2014 ${describeChannelStatus(err)}`);
|
|
7231
|
+
}
|
|
7232
|
+
});
|
|
7076
7233
|
}
|
|
7077
7234
|
/**
|
|
7078
7235
|
* Announces a completed logout, the only hook `AuthService.logout` emits.
|
|
@@ -7662,7 +7819,7 @@ var AuthService = class _AuthService {
|
|
|
7662
7819
|
})();
|
|
7663
7820
|
}
|
|
7664
7821
|
};
|
|
7665
|
-
AuthService =
|
|
7822
|
+
AuthService = _ts_decorate20([
|
|
7666
7823
|
Injectable(),
|
|
7667
7824
|
_ts_param14(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
7668
7825
|
_ts_param14(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
@@ -7677,8 +7834,8 @@ AuthService = _ts_decorate19([
|
|
|
7677
7834
|
_ts_param14(8, Inject(OtpService)),
|
|
7678
7835
|
_ts_param14(9, Inject(SessionService)),
|
|
7679
7836
|
_ts_param14(10, Inject(AccountStatusService)),
|
|
7680
|
-
|
|
7681
|
-
|
|
7837
|
+
_ts_metadata19("design:type", Function),
|
|
7838
|
+
_ts_metadata19("design:paramtypes", [
|
|
7682
7839
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
7683
7840
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
7684
7841
|
Object,
|
|
@@ -7702,7 +7859,7 @@ __name(toSafeUser2, "toSafeUser");
|
|
|
7702
7859
|
var WS_TICKET_TTL_SECONDS = 30;
|
|
7703
7860
|
|
|
7704
7861
|
// src/server/services/ws-ticket.service.ts
|
|
7705
|
-
function
|
|
7862
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
7706
7863
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7707
7864
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
7708
7865
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7715,13 +7872,13 @@ function _ts_decorate20(decorators, target, key, desc) {
|
|
|
7715
7872
|
}
|
|
7716
7873
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7717
7874
|
}
|
|
7718
|
-
__name(
|
|
7719
|
-
function
|
|
7875
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
7876
|
+
function _ts_metadata20(metadataKey, metadataValue) {
|
|
7720
7877
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
7721
7878
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
7722
7879
|
}
|
|
7723
7880
|
}
|
|
7724
|
-
__name(
|
|
7881
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
7725
7882
|
function _ts_param15(paramIndex, decorator) {
|
|
7726
7883
|
return function(target, key) {
|
|
7727
7884
|
decorator(target, key, paramIndex);
|
|
@@ -7861,14 +8018,14 @@ var WsTicketService = class _WsTicketService {
|
|
|
7861
8018
|
return snapshot;
|
|
7862
8019
|
}
|
|
7863
8020
|
};
|
|
7864
|
-
WsTicketService =
|
|
8021
|
+
WsTicketService = _ts_decorate21([
|
|
7865
8022
|
Injectable(),
|
|
7866
8023
|
_ts_param15(0, Inject(AuthRedisService)),
|
|
7867
8024
|
_ts_param15(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
7868
8025
|
_ts_param15(2, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
7869
8026
|
_ts_param15(3, Inject(AuthRevocationService)),
|
|
7870
|
-
|
|
7871
|
-
|
|
8027
|
+
_ts_metadata20("design:type", Function),
|
|
8028
|
+
_ts_metadata20("design:paramtypes", [
|
|
7872
8029
|
typeof AuthRedisService === "undefined" ? Object : AuthRedisService,
|
|
7873
8030
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
7874
8031
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
@@ -7877,7 +8034,7 @@ WsTicketService = _ts_decorate20([
|
|
|
7877
8034
|
], WsTicketService);
|
|
7878
8035
|
|
|
7879
8036
|
// src/server/controllers/auth.controller.ts
|
|
7880
|
-
function
|
|
8037
|
+
function _ts_decorate22(decorators, target, key, desc) {
|
|
7881
8038
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7882
8039
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
7883
8040
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7890,13 +8047,13 @@ function _ts_decorate21(decorators, target, key, desc) {
|
|
|
7890
8047
|
}
|
|
7891
8048
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7892
8049
|
}
|
|
7893
|
-
__name(
|
|
7894
|
-
function
|
|
8050
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
8051
|
+
function _ts_metadata21(metadataKey, metadataValue) {
|
|
7895
8052
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
7896
8053
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
7897
8054
|
}
|
|
7898
8055
|
}
|
|
7899
|
-
__name(
|
|
8056
|
+
__name(_ts_metadata21, "_ts_metadata");
|
|
7900
8057
|
function _ts_param16(paramIndex, decorator) {
|
|
7901
8058
|
return function(target, key) {
|
|
7902
8059
|
decorator(target, key, paramIndex);
|
|
@@ -8055,7 +8212,7 @@ var AuthController = class {
|
|
|
8055
8212
|
await this.authService.resendVerificationEmail(dto.tenantId, dto.email, req);
|
|
8056
8213
|
}
|
|
8057
8214
|
};
|
|
8058
|
-
|
|
8215
|
+
_ts_decorate22([
|
|
8059
8216
|
Public(),
|
|
8060
8217
|
Throttle(AUTH_THROTTLE_CONFIGS.register),
|
|
8061
8218
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.register),
|
|
@@ -8065,15 +8222,15 @@ _ts_decorate21([
|
|
|
8065
8222
|
_ts_param16(2, Res({
|
|
8066
8223
|
passthrough: true
|
|
8067
8224
|
})),
|
|
8068
|
-
|
|
8069
|
-
|
|
8225
|
+
_ts_metadata21("design:type", Function),
|
|
8226
|
+
_ts_metadata21("design:paramtypes", [
|
|
8070
8227
|
typeof RegisterDto === "undefined" ? Object : RegisterDto,
|
|
8071
8228
|
typeof Request === "undefined" ? Object : Request,
|
|
8072
8229
|
typeof Response === "undefined" ? Object : Response
|
|
8073
8230
|
]),
|
|
8074
|
-
|
|
8231
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8075
8232
|
], AuthController.prototype, "register", null);
|
|
8076
|
-
|
|
8233
|
+
_ts_decorate22([
|
|
8077
8234
|
Public(),
|
|
8078
8235
|
Throttle(AUTH_THROTTLE_CONFIGS.login),
|
|
8079
8236
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.login),
|
|
@@ -8084,72 +8241,75 @@ _ts_decorate21([
|
|
|
8084
8241
|
_ts_param16(2, Res({
|
|
8085
8242
|
passthrough: true
|
|
8086
8243
|
})),
|
|
8087
|
-
|
|
8088
|
-
|
|
8244
|
+
_ts_metadata21("design:type", Function),
|
|
8245
|
+
_ts_metadata21("design:paramtypes", [
|
|
8089
8246
|
typeof LoginDto === "undefined" ? Object : LoginDto,
|
|
8090
8247
|
typeof Request === "undefined" ? Object : Request,
|
|
8091
8248
|
typeof Response === "undefined" ? Object : Response
|
|
8092
8249
|
]),
|
|
8093
|
-
|
|
8250
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8094
8251
|
], AuthController.prototype, "login", null);
|
|
8095
|
-
|
|
8252
|
+
_ts_decorate22([
|
|
8096
8253
|
Public(),
|
|
8097
8254
|
Throttle(AUTH_THROTTLE_CONFIGS.logout),
|
|
8098
8255
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.logout),
|
|
8099
8256
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
8257
|
+
RequestEncoding("unchecked"),
|
|
8100
8258
|
Post("logout"),
|
|
8101
8259
|
_ts_param16(0, Req()),
|
|
8102
8260
|
_ts_param16(1, Res({
|
|
8103
8261
|
passthrough: true
|
|
8104
8262
|
})),
|
|
8105
|
-
|
|
8106
|
-
|
|
8263
|
+
_ts_metadata21("design:type", Function),
|
|
8264
|
+
_ts_metadata21("design:paramtypes", [
|
|
8107
8265
|
typeof Request === "undefined" ? Object : Request,
|
|
8108
8266
|
typeof Response === "undefined" ? Object : Response
|
|
8109
8267
|
]),
|
|
8110
|
-
|
|
8268
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8111
8269
|
], AuthController.prototype, "logout", null);
|
|
8112
|
-
|
|
8270
|
+
_ts_decorate22([
|
|
8113
8271
|
Public(),
|
|
8114
8272
|
Throttle(AUTH_THROTTLE_CONFIGS.refresh),
|
|
8115
8273
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.refresh),
|
|
8116
8274
|
HttpCode(HttpStatus.OK),
|
|
8275
|
+
RequestEncoding("unchecked"),
|
|
8117
8276
|
Post("refresh"),
|
|
8118
8277
|
_ts_param16(0, Req()),
|
|
8119
8278
|
_ts_param16(1, Res({
|
|
8120
8279
|
passthrough: true
|
|
8121
8280
|
})),
|
|
8122
|
-
|
|
8123
|
-
|
|
8281
|
+
_ts_metadata21("design:type", Function),
|
|
8282
|
+
_ts_metadata21("design:paramtypes", [
|
|
8124
8283
|
typeof Request === "undefined" ? Object : Request,
|
|
8125
8284
|
typeof Response === "undefined" ? Object : Response
|
|
8126
8285
|
]),
|
|
8127
|
-
|
|
8286
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8128
8287
|
], AuthController.prototype, "refresh", null);
|
|
8129
|
-
|
|
8288
|
+
_ts_decorate22([
|
|
8130
8289
|
UseGuards(JwtAuthGuard),
|
|
8131
8290
|
Get("me"),
|
|
8132
8291
|
_ts_param16(0, CurrentUser()),
|
|
8133
|
-
|
|
8134
|
-
|
|
8292
|
+
_ts_metadata21("design:type", Function),
|
|
8293
|
+
_ts_metadata21("design:paramtypes", [
|
|
8135
8294
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload
|
|
8136
8295
|
]),
|
|
8137
|
-
|
|
8296
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8138
8297
|
], AuthController.prototype, "me", null);
|
|
8139
|
-
|
|
8298
|
+
_ts_decorate22([
|
|
8140
8299
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
8141
8300
|
Throttle(AUTH_THROTTLE_CONFIGS.wsTicket),
|
|
8142
8301
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.wsTicket),
|
|
8302
|
+
RequestEncoding("unchecked"),
|
|
8143
8303
|
Post("ws-ticket"),
|
|
8144
8304
|
HttpCode(HttpStatus.OK),
|
|
8145
8305
|
_ts_param16(0, CurrentUser()),
|
|
8146
|
-
|
|
8147
|
-
|
|
8306
|
+
_ts_metadata21("design:type", Function),
|
|
8307
|
+
_ts_metadata21("design:paramtypes", [
|
|
8148
8308
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload
|
|
8149
8309
|
]),
|
|
8150
|
-
|
|
8310
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8151
8311
|
], AuthController.prototype, "wsTicket", null);
|
|
8152
|
-
|
|
8312
|
+
_ts_decorate22([
|
|
8153
8313
|
Public(),
|
|
8154
8314
|
Throttle(AUTH_THROTTLE_CONFIGS.verifyEmail),
|
|
8155
8315
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.verifyEmail),
|
|
@@ -8157,14 +8317,14 @@ _ts_decorate21([
|
|
|
8157
8317
|
Post("verify-email"),
|
|
8158
8318
|
_ts_param16(0, Body()),
|
|
8159
8319
|
_ts_param16(1, Req()),
|
|
8160
|
-
|
|
8161
|
-
|
|
8320
|
+
_ts_metadata21("design:type", Function),
|
|
8321
|
+
_ts_metadata21("design:paramtypes", [
|
|
8162
8322
|
typeof VerifyEmailDto === "undefined" ? Object : VerifyEmailDto,
|
|
8163
8323
|
typeof Request === "undefined" ? Object : Request
|
|
8164
8324
|
]),
|
|
8165
|
-
|
|
8325
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8166
8326
|
], AuthController.prototype, "verifyEmail", null);
|
|
8167
|
-
|
|
8327
|
+
_ts_decorate22([
|
|
8168
8328
|
Public(),
|
|
8169
8329
|
Throttle(AUTH_THROTTLE_CONFIGS.resendVerification),
|
|
8170
8330
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.resendVerification),
|
|
@@ -8172,29 +8332,29 @@ _ts_decorate21([
|
|
|
8172
8332
|
Post("resend-verification"),
|
|
8173
8333
|
_ts_param16(0, Body()),
|
|
8174
8334
|
_ts_param16(1, Req()),
|
|
8175
|
-
|
|
8176
|
-
|
|
8335
|
+
_ts_metadata21("design:type", Function),
|
|
8336
|
+
_ts_metadata21("design:paramtypes", [
|
|
8177
8337
|
typeof ResendVerificationDto === "undefined" ? Object : ResendVerificationDto,
|
|
8178
8338
|
typeof Request === "undefined" ? Object : Request
|
|
8179
8339
|
]),
|
|
8180
|
-
|
|
8340
|
+
_ts_metadata21("design:returntype", Promise)
|
|
8181
8341
|
], AuthController.prototype, "resendVerification", null);
|
|
8182
|
-
AuthController =
|
|
8342
|
+
AuthController = _ts_decorate22([
|
|
8183
8343
|
UseInterceptors(NoStoreInterceptor),
|
|
8184
8344
|
Controller(),
|
|
8185
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
8345
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
8186
8346
|
UsePipes(createAuthValidationPipe()),
|
|
8187
8347
|
_ts_param16(0, Inject(AuthService)),
|
|
8188
8348
|
_ts_param16(1, Inject(TokenDeliveryService)),
|
|
8189
8349
|
_ts_param16(2, Inject(WsTicketService)),
|
|
8190
|
-
|
|
8191
|
-
|
|
8350
|
+
_ts_metadata21("design:type", Function),
|
|
8351
|
+
_ts_metadata21("design:paramtypes", [
|
|
8192
8352
|
typeof AuthService === "undefined" ? Object : AuthService,
|
|
8193
8353
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService,
|
|
8194
8354
|
typeof WsTicketService === "undefined" ? Object : WsTicketService
|
|
8195
8355
|
])
|
|
8196
8356
|
], AuthController);
|
|
8197
|
-
function
|
|
8357
|
+
function _ts_decorate23(decorators, target, key, desc) {
|
|
8198
8358
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8199
8359
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8200
8360
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8207,13 +8367,13 @@ function _ts_decorate22(decorators, target, key, desc) {
|
|
|
8207
8367
|
}
|
|
8208
8368
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8209
8369
|
}
|
|
8210
|
-
__name(
|
|
8211
|
-
function
|
|
8370
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
8371
|
+
function _ts_metadata22(metadataKey, metadataValue) {
|
|
8212
8372
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8213
8373
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8214
8374
|
}
|
|
8215
8375
|
}
|
|
8216
|
-
__name(
|
|
8376
|
+
__name(_ts_metadata22, "_ts_metadata");
|
|
8217
8377
|
var ChangeEmailDto = class {
|
|
8218
8378
|
static {
|
|
8219
8379
|
__name(this, "ChangeEmailDto");
|
|
@@ -8233,20 +8393,20 @@ var ChangeEmailDto = class {
|
|
|
8233
8393
|
*/
|
|
8234
8394
|
currentPassword;
|
|
8235
8395
|
};
|
|
8236
|
-
|
|
8396
|
+
_ts_decorate23([
|
|
8237
8397
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
8238
8398
|
IsEmail(),
|
|
8239
8399
|
IsNotEmpty(),
|
|
8240
8400
|
MaxLength(255),
|
|
8241
|
-
|
|
8401
|
+
_ts_metadata22("design:type", String)
|
|
8242
8402
|
], ChangeEmailDto.prototype, "newEmail", void 0);
|
|
8243
|
-
|
|
8403
|
+
_ts_decorate23([
|
|
8244
8404
|
IsString(),
|
|
8245
8405
|
MinLength(1),
|
|
8246
8406
|
MaxLength(128),
|
|
8247
|
-
|
|
8407
|
+
_ts_metadata22("design:type", String)
|
|
8248
8408
|
], ChangeEmailDto.prototype, "currentPassword", void 0);
|
|
8249
|
-
function
|
|
8409
|
+
function _ts_decorate24(decorators, target, key, desc) {
|
|
8250
8410
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8251
8411
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8252
8412
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8259,13 +8419,13 @@ function _ts_decorate23(decorators, target, key, desc) {
|
|
|
8259
8419
|
}
|
|
8260
8420
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8261
8421
|
}
|
|
8262
|
-
__name(
|
|
8263
|
-
function
|
|
8422
|
+
__name(_ts_decorate24, "_ts_decorate");
|
|
8423
|
+
function _ts_metadata23(metadataKey, metadataValue) {
|
|
8264
8424
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8265
8425
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8266
8426
|
}
|
|
8267
8427
|
}
|
|
8268
|
-
__name(
|
|
8428
|
+
__name(_ts_metadata23, "_ts_metadata");
|
|
8269
8429
|
var ConfirmEmailChangeDto = class {
|
|
8270
8430
|
static {
|
|
8271
8431
|
__name(this, "ConfirmEmailChangeDto");
|
|
@@ -8278,13 +8438,13 @@ var ConfirmEmailChangeDto = class {
|
|
|
8278
8438
|
*/
|
|
8279
8439
|
token;
|
|
8280
8440
|
};
|
|
8281
|
-
|
|
8441
|
+
_ts_decorate24([
|
|
8282
8442
|
IsString(),
|
|
8283
8443
|
IsNotEmpty(),
|
|
8284
8444
|
Length(64, 64),
|
|
8285
|
-
|
|
8445
|
+
_ts_metadata23("design:type", String)
|
|
8286
8446
|
], ConfirmEmailChangeDto.prototype, "token", void 0);
|
|
8287
|
-
function
|
|
8447
|
+
function _ts_decorate25(decorators, target, key, desc) {
|
|
8288
8448
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8289
8449
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8290
8450
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8297,13 +8457,13 @@ function _ts_decorate24(decorators, target, key, desc) {
|
|
|
8297
8457
|
}
|
|
8298
8458
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8299
8459
|
}
|
|
8300
|
-
__name(
|
|
8301
|
-
function
|
|
8460
|
+
__name(_ts_decorate25, "_ts_decorate");
|
|
8461
|
+
function _ts_metadata24(metadataKey, metadataValue) {
|
|
8302
8462
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8303
8463
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8304
8464
|
}
|
|
8305
8465
|
}
|
|
8306
|
-
__name(
|
|
8466
|
+
__name(_ts_metadata24, "_ts_metadata");
|
|
8307
8467
|
function _ts_param17(paramIndex, decorator) {
|
|
8308
8468
|
return function(target, key) {
|
|
8309
8469
|
decorator(target, key, paramIndex);
|
|
@@ -8541,7 +8701,7 @@ var EmailChangeService = class _EmailChangeService {
|
|
|
8541
8701
|
}
|
|
8542
8702
|
}
|
|
8543
8703
|
};
|
|
8544
|
-
EmailChangeService =
|
|
8704
|
+
EmailChangeService = _ts_decorate25([
|
|
8545
8705
|
Injectable(),
|
|
8546
8706
|
_ts_param17(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
8547
8707
|
_ts_param17(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
@@ -8549,8 +8709,8 @@ EmailChangeService = _ts_decorate24([
|
|
|
8549
8709
|
_ts_param17(3, Inject(PasswordService)),
|
|
8550
8710
|
_ts_param17(4, Inject(AuthRedisService)),
|
|
8551
8711
|
_ts_param17(5, Inject(BruteForceService)),
|
|
8552
|
-
|
|
8553
|
-
|
|
8712
|
+
_ts_metadata24("design:type", Function),
|
|
8713
|
+
_ts_metadata24("design:paramtypes", [
|
|
8554
8714
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
8555
8715
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
8556
8716
|
typeof IEmailProvider === "undefined" ? Object : IEmailProvider,
|
|
@@ -8561,7 +8721,7 @@ EmailChangeService = _ts_decorate24([
|
|
|
8561
8721
|
], EmailChangeService);
|
|
8562
8722
|
|
|
8563
8723
|
// src/server/controllers/email-change.controller.ts
|
|
8564
|
-
function
|
|
8724
|
+
function _ts_decorate26(decorators, target, key, desc) {
|
|
8565
8725
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8566
8726
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8567
8727
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8574,13 +8734,13 @@ function _ts_decorate25(decorators, target, key, desc) {
|
|
|
8574
8734
|
}
|
|
8575
8735
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8576
8736
|
}
|
|
8577
|
-
__name(
|
|
8578
|
-
function
|
|
8737
|
+
__name(_ts_decorate26, "_ts_decorate");
|
|
8738
|
+
function _ts_metadata25(metadataKey, metadataValue) {
|
|
8579
8739
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8580
8740
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8581
8741
|
}
|
|
8582
8742
|
}
|
|
8583
|
-
__name(
|
|
8743
|
+
__name(_ts_metadata25, "_ts_metadata");
|
|
8584
8744
|
function _ts_param18(paramIndex, decorator) {
|
|
8585
8745
|
return function(target, key) {
|
|
8586
8746
|
decorator(target, key, paramIndex);
|
|
@@ -8633,7 +8793,7 @@ var EmailChangeController = class {
|
|
|
8633
8793
|
await this.emailChangeService.confirmChange(dto);
|
|
8634
8794
|
}
|
|
8635
8795
|
};
|
|
8636
|
-
|
|
8796
|
+
_ts_decorate26([
|
|
8637
8797
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
8638
8798
|
Throttle(AUTH_THROTTLE_CONFIGS.emailChangeRequest),
|
|
8639
8799
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.emailChangeRequest),
|
|
@@ -8641,38 +8801,38 @@ _ts_decorate25([
|
|
|
8641
8801
|
Post("change"),
|
|
8642
8802
|
_ts_param18(0, Body()),
|
|
8643
8803
|
_ts_param18(1, CurrentUser()),
|
|
8644
|
-
|
|
8645
|
-
|
|
8804
|
+
_ts_metadata25("design:type", Function),
|
|
8805
|
+
_ts_metadata25("design:paramtypes", [
|
|
8646
8806
|
typeof ChangeEmailDto === "undefined" ? Object : ChangeEmailDto,
|
|
8647
8807
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload
|
|
8648
8808
|
]),
|
|
8649
|
-
|
|
8809
|
+
_ts_metadata25("design:returntype", Promise)
|
|
8650
8810
|
], EmailChangeController.prototype, "requestChange", null);
|
|
8651
|
-
|
|
8811
|
+
_ts_decorate26([
|
|
8652
8812
|
Public(),
|
|
8653
8813
|
Throttle(AUTH_THROTTLE_CONFIGS.emailChangeConfirm),
|
|
8654
8814
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.emailChangeConfirm),
|
|
8655
8815
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
8656
8816
|
Post("change/confirm"),
|
|
8657
8817
|
_ts_param18(0, Body()),
|
|
8658
|
-
|
|
8659
|
-
|
|
8818
|
+
_ts_metadata25("design:type", Function),
|
|
8819
|
+
_ts_metadata25("design:paramtypes", [
|
|
8660
8820
|
typeof ConfirmEmailChangeDto === "undefined" ? Object : ConfirmEmailChangeDto
|
|
8661
8821
|
]),
|
|
8662
|
-
|
|
8822
|
+
_ts_metadata25("design:returntype", Promise)
|
|
8663
8823
|
], EmailChangeController.prototype, "confirmChange", null);
|
|
8664
|
-
EmailChangeController =
|
|
8824
|
+
EmailChangeController = _ts_decorate26([
|
|
8665
8825
|
UseInterceptors(NoStoreInterceptor),
|
|
8666
8826
|
Controller("email"),
|
|
8667
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
8827
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
8668
8828
|
UsePipes(createAuthValidationPipe()),
|
|
8669
8829
|
_ts_param18(0, Inject(EmailChangeService)),
|
|
8670
|
-
|
|
8671
|
-
|
|
8830
|
+
_ts_metadata25("design:type", Function),
|
|
8831
|
+
_ts_metadata25("design:paramtypes", [
|
|
8672
8832
|
typeof EmailChangeService === "undefined" ? Object : EmailChangeService
|
|
8673
8833
|
])
|
|
8674
8834
|
], EmailChangeController);
|
|
8675
|
-
function
|
|
8835
|
+
function _ts_decorate27(decorators, target, key, desc) {
|
|
8676
8836
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8677
8837
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8678
8838
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8685,13 +8845,13 @@ function _ts_decorate26(decorators, target, key, desc) {
|
|
|
8685
8845
|
}
|
|
8686
8846
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8687
8847
|
}
|
|
8688
|
-
__name(
|
|
8689
|
-
function
|
|
8848
|
+
__name(_ts_decorate27, "_ts_decorate");
|
|
8849
|
+
function _ts_metadata26(metadataKey, metadataValue) {
|
|
8690
8850
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8691
8851
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8692
8852
|
}
|
|
8693
8853
|
}
|
|
8694
|
-
__name(
|
|
8854
|
+
__name(_ts_metadata26, "_ts_metadata");
|
|
8695
8855
|
var AcceptInvitationDto = class {
|
|
8696
8856
|
static {
|
|
8697
8857
|
__name(this, "AcceptInvitationDto");
|
|
@@ -8730,24 +8890,24 @@ var AcceptInvitationDto = class {
|
|
|
8730
8890
|
*/
|
|
8731
8891
|
password;
|
|
8732
8892
|
};
|
|
8733
|
-
|
|
8893
|
+
_ts_decorate27([
|
|
8734
8894
|
IsString(),
|
|
8735
8895
|
IsNotEmpty(),
|
|
8736
8896
|
Length(64, 64),
|
|
8737
|
-
|
|
8897
|
+
_ts_metadata26("design:type", String)
|
|
8738
8898
|
], AcceptInvitationDto.prototype, "token", void 0);
|
|
8739
|
-
|
|
8899
|
+
_ts_decorate27([
|
|
8740
8900
|
IsString(),
|
|
8741
8901
|
IsNotEmpty(),
|
|
8742
8902
|
Length(2, 100),
|
|
8743
|
-
|
|
8903
|
+
_ts_metadata26("design:type", String)
|
|
8744
8904
|
], AcceptInvitationDto.prototype, "name", void 0);
|
|
8745
|
-
|
|
8905
|
+
_ts_decorate27([
|
|
8746
8906
|
IsString(),
|
|
8747
8907
|
Length(8, 128),
|
|
8748
|
-
|
|
8908
|
+
_ts_metadata26("design:type", String)
|
|
8749
8909
|
], AcceptInvitationDto.prototype, "password", void 0);
|
|
8750
|
-
function
|
|
8910
|
+
function _ts_decorate28(decorators, target, key, desc) {
|
|
8751
8911
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8752
8912
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8753
8913
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8760,13 +8920,13 @@ function _ts_decorate27(decorators, target, key, desc) {
|
|
|
8760
8920
|
}
|
|
8761
8921
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8762
8922
|
}
|
|
8763
|
-
__name(
|
|
8764
|
-
function
|
|
8923
|
+
__name(_ts_decorate28, "_ts_decorate");
|
|
8924
|
+
function _ts_metadata27(metadataKey, metadataValue) {
|
|
8765
8925
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8766
8926
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8767
8927
|
}
|
|
8768
8928
|
}
|
|
8769
|
-
__name(
|
|
8929
|
+
__name(_ts_metadata27, "_ts_metadata");
|
|
8770
8930
|
var CreateInvitationDto = class {
|
|
8771
8931
|
static {
|
|
8772
8932
|
__name(this, "CreateInvitationDto");
|
|
@@ -8797,27 +8957,27 @@ var CreateInvitationDto = class {
|
|
|
8797
8957
|
*/
|
|
8798
8958
|
tenantName;
|
|
8799
8959
|
};
|
|
8800
|
-
|
|
8960
|
+
_ts_decorate28([
|
|
8801
8961
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
8802
8962
|
IsEmail(),
|
|
8803
8963
|
IsNotEmpty(),
|
|
8804
8964
|
MaxLength(255),
|
|
8805
|
-
|
|
8965
|
+
_ts_metadata27("design:type", String)
|
|
8806
8966
|
], CreateInvitationDto.prototype, "email", void 0);
|
|
8807
|
-
|
|
8967
|
+
_ts_decorate28([
|
|
8808
8968
|
IsString(),
|
|
8809
8969
|
IsNotEmpty(),
|
|
8810
8970
|
MaxLength(64),
|
|
8811
|
-
|
|
8971
|
+
_ts_metadata27("design:type", String)
|
|
8812
8972
|
], CreateInvitationDto.prototype, "role", void 0);
|
|
8813
|
-
|
|
8973
|
+
_ts_decorate28([
|
|
8814
8974
|
IsOptional(),
|
|
8815
8975
|
IsString(),
|
|
8816
8976
|
IsNotEmpty(),
|
|
8817
8977
|
MaxLength(128),
|
|
8818
|
-
|
|
8978
|
+
_ts_metadata27("design:type", String)
|
|
8819
8979
|
], CreateInvitationDto.prototype, "tenantName", void 0);
|
|
8820
|
-
function
|
|
8980
|
+
function _ts_decorate29(decorators, target, key, desc) {
|
|
8821
8981
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8822
8982
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8823
8983
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8830,13 +8990,13 @@ function _ts_decorate28(decorators, target, key, desc) {
|
|
|
8830
8990
|
}
|
|
8831
8991
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8832
8992
|
}
|
|
8833
|
-
__name(
|
|
8834
|
-
function
|
|
8993
|
+
__name(_ts_decorate29, "_ts_decorate");
|
|
8994
|
+
function _ts_metadata28(metadataKey, metadataValue) {
|
|
8835
8995
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8836
8996
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8837
8997
|
}
|
|
8838
8998
|
}
|
|
8839
|
-
__name(
|
|
8999
|
+
__name(_ts_metadata28, "_ts_metadata");
|
|
8840
9000
|
var RevokeInvitationDto = class {
|
|
8841
9001
|
static {
|
|
8842
9002
|
__name(this, "RevokeInvitationDto");
|
|
@@ -8848,14 +9008,14 @@ var RevokeInvitationDto = class {
|
|
|
8848
9008
|
*/
|
|
8849
9009
|
email;
|
|
8850
9010
|
};
|
|
8851
|
-
|
|
9011
|
+
_ts_decorate29([
|
|
8852
9012
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
8853
9013
|
IsEmail(),
|
|
8854
9014
|
IsNotEmpty(),
|
|
8855
9015
|
MaxLength(255),
|
|
8856
|
-
|
|
9016
|
+
_ts_metadata28("design:type", String)
|
|
8857
9017
|
], RevokeInvitationDto.prototype, "email", void 0);
|
|
8858
|
-
function
|
|
9018
|
+
function _ts_decorate30(decorators, target, key, desc) {
|
|
8859
9019
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8860
9020
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
8861
9021
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8868,13 +9028,13 @@ function _ts_decorate29(decorators, target, key, desc) {
|
|
|
8868
9028
|
}
|
|
8869
9029
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8870
9030
|
}
|
|
8871
|
-
__name(
|
|
8872
|
-
function
|
|
9031
|
+
__name(_ts_decorate30, "_ts_decorate");
|
|
9032
|
+
function _ts_metadata29(metadataKey, metadataValue) {
|
|
8873
9033
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
8874
9034
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
8875
9035
|
}
|
|
8876
9036
|
}
|
|
8877
|
-
__name(
|
|
9037
|
+
__name(_ts_metadata29, "_ts_metadata");
|
|
8878
9038
|
function _ts_param19(paramIndex, decorator) {
|
|
8879
9039
|
return function(target, key) {
|
|
8880
9040
|
decorator(target, key, paramIndex);
|
|
@@ -9357,7 +9517,7 @@ var InvitationService = class _InvitationService {
|
|
|
9357
9517
|
return result;
|
|
9358
9518
|
}
|
|
9359
9519
|
};
|
|
9360
|
-
InvitationService =
|
|
9520
|
+
InvitationService = _ts_decorate30([
|
|
9361
9521
|
Injectable(),
|
|
9362
9522
|
_ts_param19(0, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
9363
9523
|
_ts_param19(1, Inject(BYMAX_AUTH_EMAIL_PROVIDER)),
|
|
@@ -9367,8 +9527,8 @@ InvitationService = _ts_decorate29([
|
|
|
9367
9527
|
_ts_param19(5, Inject(SessionService)),
|
|
9368
9528
|
_ts_param19(6, Inject(TokenManagerService)),
|
|
9369
9529
|
_ts_param19(7, Inject(BYMAX_AUTH_OPTIONS)),
|
|
9370
|
-
|
|
9371
|
-
|
|
9530
|
+
_ts_metadata29("design:type", Function),
|
|
9531
|
+
_ts_metadata29("design:paramtypes", [
|
|
9372
9532
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
9373
9533
|
typeof IEmailProvider === "undefined" ? Object : IEmailProvider,
|
|
9374
9534
|
typeof IAuthHooks === "undefined" ? Object : IAuthHooks,
|
|
@@ -9381,7 +9541,7 @@ InvitationService = _ts_decorate29([
|
|
|
9381
9541
|
], InvitationService);
|
|
9382
9542
|
|
|
9383
9543
|
// src/server/controllers/invitation.controller.ts
|
|
9384
|
-
function
|
|
9544
|
+
function _ts_decorate31(decorators, target, key, desc) {
|
|
9385
9545
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9386
9546
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9387
9547
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9394,13 +9554,13 @@ function _ts_decorate30(decorators, target, key, desc) {
|
|
|
9394
9554
|
}
|
|
9395
9555
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9396
9556
|
}
|
|
9397
|
-
__name(
|
|
9398
|
-
function
|
|
9557
|
+
__name(_ts_decorate31, "_ts_decorate");
|
|
9558
|
+
function _ts_metadata30(metadataKey, metadataValue) {
|
|
9399
9559
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9400
9560
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9401
9561
|
}
|
|
9402
9562
|
}
|
|
9403
|
-
__name(
|
|
9563
|
+
__name(_ts_metadata30, "_ts_metadata");
|
|
9404
9564
|
function _ts_param20(paramIndex, decorator) {
|
|
9405
9565
|
return function(target, key) {
|
|
9406
9566
|
decorator(target, key, paramIndex);
|
|
@@ -9482,7 +9642,7 @@ var InvitationController = class {
|
|
|
9482
9642
|
return this.tokenDelivery.deliverAuthResponse(res, result, req);
|
|
9483
9643
|
}
|
|
9484
9644
|
};
|
|
9485
|
-
|
|
9645
|
+
_ts_decorate31([
|
|
9486
9646
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
9487
9647
|
Throttle(AUTH_THROTTLE_CONFIGS.invitationCreate),
|
|
9488
9648
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.invitationCreate),
|
|
@@ -9490,14 +9650,14 @@ _ts_decorate30([
|
|
|
9490
9650
|
Post(),
|
|
9491
9651
|
_ts_param20(0, Body()),
|
|
9492
9652
|
_ts_param20(1, CurrentUser()),
|
|
9493
|
-
|
|
9494
|
-
|
|
9653
|
+
_ts_metadata30("design:type", Function),
|
|
9654
|
+
_ts_metadata30("design:paramtypes", [
|
|
9495
9655
|
typeof CreateInvitationDto === "undefined" ? Object : CreateInvitationDto,
|
|
9496
9656
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload
|
|
9497
9657
|
]),
|
|
9498
|
-
|
|
9658
|
+
_ts_metadata30("design:returntype", Promise)
|
|
9499
9659
|
], InvitationController.prototype, "invite", null);
|
|
9500
|
-
|
|
9660
|
+
_ts_decorate31([
|
|
9501
9661
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
9502
9662
|
Throttle(AUTH_THROTTLE_CONFIGS.invitationRevoke),
|
|
9503
9663
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.invitationRevoke),
|
|
@@ -9505,14 +9665,14 @@ _ts_decorate30([
|
|
|
9505
9665
|
Post("revoke"),
|
|
9506
9666
|
_ts_param20(0, Body()),
|
|
9507
9667
|
_ts_param20(1, CurrentUser()),
|
|
9508
|
-
|
|
9509
|
-
|
|
9668
|
+
_ts_metadata30("design:type", Function),
|
|
9669
|
+
_ts_metadata30("design:paramtypes", [
|
|
9510
9670
|
typeof RevokeInvitationDto === "undefined" ? Object : RevokeInvitationDto,
|
|
9511
9671
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload
|
|
9512
9672
|
]),
|
|
9513
|
-
|
|
9673
|
+
_ts_metadata30("design:returntype", Promise)
|
|
9514
9674
|
], InvitationController.prototype, "revoke", null);
|
|
9515
|
-
|
|
9675
|
+
_ts_decorate31([
|
|
9516
9676
|
Public(),
|
|
9517
9677
|
Throttle(AUTH_THROTTLE_CONFIGS.invitationAccept),
|
|
9518
9678
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.invitationAccept),
|
|
@@ -9523,23 +9683,23 @@ _ts_decorate30([
|
|
|
9523
9683
|
_ts_param20(2, Res({
|
|
9524
9684
|
passthrough: true
|
|
9525
9685
|
})),
|
|
9526
|
-
|
|
9527
|
-
|
|
9686
|
+
_ts_metadata30("design:type", Function),
|
|
9687
|
+
_ts_metadata30("design:paramtypes", [
|
|
9528
9688
|
typeof AcceptInvitationDto === "undefined" ? Object : AcceptInvitationDto,
|
|
9529
9689
|
typeof Request === "undefined" ? Object : Request,
|
|
9530
9690
|
typeof Response === "undefined" ? Object : Response
|
|
9531
9691
|
]),
|
|
9532
|
-
|
|
9692
|
+
_ts_metadata30("design:returntype", Promise)
|
|
9533
9693
|
], InvitationController.prototype, "accept", null);
|
|
9534
|
-
InvitationController =
|
|
9694
|
+
InvitationController = _ts_decorate31([
|
|
9535
9695
|
UseInterceptors(NoStoreInterceptor),
|
|
9536
9696
|
Controller("invitations"),
|
|
9537
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
9697
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
9538
9698
|
UsePipes(createAuthValidationPipe()),
|
|
9539
9699
|
_ts_param20(0, Inject(InvitationService)),
|
|
9540
9700
|
_ts_param20(1, Inject(TokenDeliveryService)),
|
|
9541
|
-
|
|
9542
|
-
|
|
9701
|
+
_ts_metadata30("design:type", Function),
|
|
9702
|
+
_ts_metadata30("design:paramtypes", [
|
|
9543
9703
|
typeof InvitationService === "undefined" ? Object : InvitationService,
|
|
9544
9704
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService
|
|
9545
9705
|
])
|
|
@@ -9550,7 +9710,7 @@ var MFA_TEMP_COOKIE_NAME = "mfa_temp_token";
|
|
|
9550
9710
|
var MFA_TEMP_COOKIE_MAX_AGE_SECONDS = 300;
|
|
9551
9711
|
var SKIP_MFA_KEY = /* @__PURE__ */ Symbol("skipMfa");
|
|
9552
9712
|
var SkipMfa = /* @__PURE__ */ __name(() => SetMetadata(SKIP_MFA_KEY, true), "SkipMfa");
|
|
9553
|
-
function
|
|
9713
|
+
function _ts_decorate32(decorators, target, key, desc) {
|
|
9554
9714
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9555
9715
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9556
9716
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9563,13 +9723,13 @@ function _ts_decorate31(decorators, target, key, desc) {
|
|
|
9563
9723
|
}
|
|
9564
9724
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9565
9725
|
}
|
|
9566
|
-
__name(
|
|
9567
|
-
function
|
|
9726
|
+
__name(_ts_decorate32, "_ts_decorate");
|
|
9727
|
+
function _ts_metadata31(metadataKey, metadataValue) {
|
|
9568
9728
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9569
9729
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9570
9730
|
}
|
|
9571
9731
|
}
|
|
9572
|
-
__name(
|
|
9732
|
+
__name(_ts_metadata31, "_ts_metadata");
|
|
9573
9733
|
var MfaChallengeDto = class {
|
|
9574
9734
|
static {
|
|
9575
9735
|
__name(this, "MfaChallengeDto");
|
|
@@ -9605,23 +9765,23 @@ var MfaChallengeDto = class {
|
|
|
9605
9765
|
*/
|
|
9606
9766
|
code;
|
|
9607
9767
|
};
|
|
9608
|
-
|
|
9768
|
+
_ts_decorate32([
|
|
9609
9769
|
IsOptional(),
|
|
9610
9770
|
IsString(),
|
|
9611
9771
|
IsNotEmpty(),
|
|
9612
9772
|
MaxLength(512),
|
|
9613
|
-
|
|
9773
|
+
_ts_metadata31("design:type", String)
|
|
9614
9774
|
], MfaChallengeDto.prototype, "mfaTempToken", void 0);
|
|
9615
|
-
|
|
9775
|
+
_ts_decorate32([
|
|
9616
9776
|
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
9777
|
message: "code must be a 6-digit TOTP code or a recovery code in XXXX-XXXX-XXXX-XXXX-XXXX-XXXX format"
|
|
9618
9778
|
}),
|
|
9619
9779
|
IsString(),
|
|
9620
9780
|
IsNotEmpty(),
|
|
9621
9781
|
MaxLength(29),
|
|
9622
|
-
|
|
9782
|
+
_ts_metadata31("design:type", String)
|
|
9623
9783
|
], MfaChallengeDto.prototype, "code", void 0);
|
|
9624
|
-
function
|
|
9784
|
+
function _ts_decorate33(decorators, target, key, desc) {
|
|
9625
9785
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9626
9786
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9627
9787
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9634,13 +9794,13 @@ function _ts_decorate32(decorators, target, key, desc) {
|
|
|
9634
9794
|
}
|
|
9635
9795
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9636
9796
|
}
|
|
9637
|
-
__name(
|
|
9638
|
-
function
|
|
9797
|
+
__name(_ts_decorate33, "_ts_decorate");
|
|
9798
|
+
function _ts_metadata32(metadataKey, metadataValue) {
|
|
9639
9799
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9640
9800
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9641
9801
|
}
|
|
9642
9802
|
}
|
|
9643
|
-
__name(
|
|
9803
|
+
__name(_ts_metadata32, "_ts_metadata");
|
|
9644
9804
|
var MfaDisableDto = class {
|
|
9645
9805
|
static {
|
|
9646
9806
|
__name(this, "MfaDisableDto");
|
|
@@ -9654,16 +9814,16 @@ var MfaDisableDto = class {
|
|
|
9654
9814
|
*/
|
|
9655
9815
|
code;
|
|
9656
9816
|
};
|
|
9657
|
-
|
|
9817
|
+
_ts_decorate33([
|
|
9658
9818
|
MaxLength(6),
|
|
9659
9819
|
Matches(/^\d{6}$/, {
|
|
9660
9820
|
message: "code must be exactly 6 digits"
|
|
9661
9821
|
}),
|
|
9662
9822
|
IsString(),
|
|
9663
9823
|
IsNotEmpty(),
|
|
9664
|
-
|
|
9824
|
+
_ts_metadata32("design:type", String)
|
|
9665
9825
|
], MfaDisableDto.prototype, "code", void 0);
|
|
9666
|
-
function
|
|
9826
|
+
function _ts_decorate34(decorators, target, key, desc) {
|
|
9667
9827
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9668
9828
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9669
9829
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9676,13 +9836,13 @@ function _ts_decorate33(decorators, target, key, desc) {
|
|
|
9676
9836
|
}
|
|
9677
9837
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9678
9838
|
}
|
|
9679
|
-
__name(
|
|
9680
|
-
function
|
|
9839
|
+
__name(_ts_decorate34, "_ts_decorate");
|
|
9840
|
+
function _ts_metadata33(metadataKey, metadataValue) {
|
|
9681
9841
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9682
9842
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9683
9843
|
}
|
|
9684
9844
|
}
|
|
9685
|
-
__name(
|
|
9845
|
+
__name(_ts_metadata33, "_ts_metadata");
|
|
9686
9846
|
var MfaRegenerateRecoveryCodesDto = class {
|
|
9687
9847
|
static {
|
|
9688
9848
|
__name(this, "MfaRegenerateRecoveryCodesDto");
|
|
@@ -9696,16 +9856,16 @@ var MfaRegenerateRecoveryCodesDto = class {
|
|
|
9696
9856
|
*/
|
|
9697
9857
|
code;
|
|
9698
9858
|
};
|
|
9699
|
-
|
|
9859
|
+
_ts_decorate34([
|
|
9700
9860
|
MaxLength(6),
|
|
9701
9861
|
Matches(/^\d{6}$/, {
|
|
9702
9862
|
message: "code must be exactly 6 digits"
|
|
9703
9863
|
}),
|
|
9704
9864
|
IsString(),
|
|
9705
9865
|
IsNotEmpty(),
|
|
9706
|
-
|
|
9866
|
+
_ts_metadata33("design:type", String)
|
|
9707
9867
|
], MfaRegenerateRecoveryCodesDto.prototype, "code", void 0);
|
|
9708
|
-
function
|
|
9868
|
+
function _ts_decorate35(decorators, target, key, desc) {
|
|
9709
9869
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9710
9870
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9711
9871
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9718,13 +9878,13 @@ function _ts_decorate34(decorators, target, key, desc) {
|
|
|
9718
9878
|
}
|
|
9719
9879
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9720
9880
|
}
|
|
9721
|
-
__name(
|
|
9722
|
-
function
|
|
9881
|
+
__name(_ts_decorate35, "_ts_decorate");
|
|
9882
|
+
function _ts_metadata34(metadataKey, metadataValue) {
|
|
9723
9883
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9724
9884
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9725
9885
|
}
|
|
9726
9886
|
}
|
|
9727
|
-
__name(
|
|
9887
|
+
__name(_ts_metadata34, "_ts_metadata");
|
|
9728
9888
|
var MfaSetupDto = class {
|
|
9729
9889
|
static {
|
|
9730
9890
|
__name(this, "MfaSetupDto");
|
|
@@ -9748,14 +9908,14 @@ var MfaSetupDto = class {
|
|
|
9748
9908
|
*/
|
|
9749
9909
|
password;
|
|
9750
9910
|
};
|
|
9751
|
-
|
|
9911
|
+
_ts_decorate35([
|
|
9752
9912
|
IsOptional(),
|
|
9753
9913
|
IsString(),
|
|
9754
9914
|
MinLength(1),
|
|
9755
9915
|
MaxLength(128),
|
|
9756
|
-
|
|
9916
|
+
_ts_metadata34("design:type", String)
|
|
9757
9917
|
], MfaSetupDto.prototype, "password", void 0);
|
|
9758
|
-
function
|
|
9918
|
+
function _ts_decorate36(decorators, target, key, desc) {
|
|
9759
9919
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9760
9920
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9761
9921
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9768,13 +9928,13 @@ function _ts_decorate35(decorators, target, key, desc) {
|
|
|
9768
9928
|
}
|
|
9769
9929
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9770
9930
|
}
|
|
9771
|
-
__name(
|
|
9772
|
-
function
|
|
9931
|
+
__name(_ts_decorate36, "_ts_decorate");
|
|
9932
|
+
function _ts_metadata35(metadataKey, metadataValue) {
|
|
9773
9933
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9774
9934
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9775
9935
|
}
|
|
9776
9936
|
}
|
|
9777
|
-
__name(
|
|
9937
|
+
__name(_ts_metadata35, "_ts_metadata");
|
|
9778
9938
|
var MfaVerifyDto = class {
|
|
9779
9939
|
static {
|
|
9780
9940
|
__name(this, "MfaVerifyDto");
|
|
@@ -9787,14 +9947,14 @@ var MfaVerifyDto = class {
|
|
|
9787
9947
|
*/
|
|
9788
9948
|
code;
|
|
9789
9949
|
};
|
|
9790
|
-
|
|
9950
|
+
_ts_decorate36([
|
|
9791
9951
|
MaxLength(6),
|
|
9792
9952
|
Matches(/^\d{6}$/, {
|
|
9793
9953
|
message: "code must be exactly 6 digits"
|
|
9794
9954
|
}),
|
|
9795
9955
|
IsString(),
|
|
9796
9956
|
IsNotEmpty(),
|
|
9797
|
-
|
|
9957
|
+
_ts_metadata35("design:type", String)
|
|
9798
9958
|
], MfaVerifyDto.prototype, "code", void 0);
|
|
9799
9959
|
var IV_LENGTH = 12;
|
|
9800
9960
|
var AUTH_TAG_BYTE_LENGTH = 16;
|
|
@@ -9858,7 +10018,7 @@ function runDetached(logger, run, failure) {
|
|
|
9858
10018
|
__name(runDetached, "runDetached");
|
|
9859
10019
|
|
|
9860
10020
|
// src/server/services/mfa.service.ts
|
|
9861
|
-
function
|
|
10021
|
+
function _ts_decorate37(decorators, target, key, desc) {
|
|
9862
10022
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9863
10023
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
9864
10024
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9871,13 +10031,13 @@ function _ts_decorate36(decorators, target, key, desc) {
|
|
|
9871
10031
|
}
|
|
9872
10032
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9873
10033
|
}
|
|
9874
|
-
__name(
|
|
9875
|
-
function
|
|
10034
|
+
__name(_ts_decorate37, "_ts_decorate");
|
|
10035
|
+
function _ts_metadata36(metadataKey, metadataValue) {
|
|
9876
10036
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
9877
10037
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
9878
10038
|
}
|
|
9879
10039
|
}
|
|
9880
|
-
__name(
|
|
10040
|
+
__name(_ts_metadata36, "_ts_metadata");
|
|
9881
10041
|
function _ts_param21(paramIndex, decorator) {
|
|
9882
10042
|
return function(target, key) {
|
|
9883
10043
|
decorator(target, key, paramIndex);
|
|
@@ -9959,29 +10119,28 @@ var MfaService = class _MfaService {
|
|
|
9959
10119
|
* Detached from the challenge it follows: the user is already authenticated and the retired
|
|
9960
10120
|
* key still opens the secret, so a failure here costs the migration and nothing else.
|
|
9961
10121
|
*
|
|
10122
|
+
* The write replaces the whole MFA record, so it runs as a serialized transition and lands only
|
|
10123
|
+
* on a record that still holds this secret. One that no longer does was disabled or re-enrolled
|
|
10124
|
+
* since, and writing the re-encrypted old secret over it would restore a factor the user removed
|
|
10125
|
+
* and unspend the recovery codes they replaced. The comparison is on the decrypted secret, not
|
|
10126
|
+
* the ciphertext: a sibling challenge that only re-encrypted the same secret changes the
|
|
10127
|
+
* ciphertext and nothing else, and must not be mistaken for a re-enrolment.
|
|
10128
|
+
*
|
|
9962
10129
|
* @param userId - The account whose stored secret is being re-encrypted.
|
|
9963
10130
|
* @param context - Which identity plane the account belongs to.
|
|
9964
10131
|
* @param secretBase32 - The decrypted secret.
|
|
9965
|
-
* @param recoveryCodes - The stored recovery digests, written back unchanged.
|
|
9966
10132
|
* @param tenantId - The tenant the account belongs to, so the write is scoped like the read.
|
|
9967
10133
|
*/
|
|
9968
|
-
async reencryptSecret(userId, context, secretBase32,
|
|
9969
|
-
const update = {
|
|
9970
|
-
mfaEnabled: true,
|
|
9971
|
-
mfaSecret: this.encryptSecret(secretBase32),
|
|
9972
|
-
mfaRecoveryCodes: recoveryCodes
|
|
9973
|
-
};
|
|
10134
|
+
async reencryptSecret(userId, context, secretBase32, tenantId) {
|
|
9974
10135
|
try {
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
});
|
|
9984
|
-
}
|
|
10136
|
+
await this.transitionMfaRecord(context, userId, tenantId, (current) => {
|
|
10137
|
+
if (!current.mfaEnabled || !this.holdsSecret(current.mfaSecret, secretBase32)) return null;
|
|
10138
|
+
return {
|
|
10139
|
+
mfaEnabled: true,
|
|
10140
|
+
mfaSecret: this.encryptSecret(secretBase32),
|
|
10141
|
+
mfaRecoveryCodes: current.mfaRecoveryCodes ?? []
|
|
10142
|
+
};
|
|
10143
|
+
});
|
|
9985
10144
|
} catch (err) {
|
|
9986
10145
|
this.logger.error(`re-encryption under the current MFA key failed: ${describeChannelStatus(err)}`);
|
|
9987
10146
|
}
|
|
@@ -10075,6 +10234,20 @@ var MfaService = class _MfaService {
|
|
|
10075
10234
|
}
|
|
10076
10235
|
}
|
|
10077
10236
|
/**
|
|
10237
|
+
* Whether `stored` decrypts, under the current or a retired key, to `secretBase32`.
|
|
10238
|
+
*
|
|
10239
|
+
* Compares plaintext, so a record that was only re-encrypted still matches and one holding a
|
|
10240
|
+
* different secret does not. A ciphertext no key opens does not match either.
|
|
10241
|
+
*/
|
|
10242
|
+
holdsSecret(stored, secretBase32) {
|
|
10243
|
+
if (!stored) return false;
|
|
10244
|
+
try {
|
|
10245
|
+
return timingSafeCompare(this.decryptWithRotation(stored).secret, secretBase32);
|
|
10246
|
+
} catch {
|
|
10247
|
+
return false;
|
|
10248
|
+
}
|
|
10249
|
+
}
|
|
10250
|
+
/**
|
|
10078
10251
|
* Encrypts a TOTP secret for storage in the database using AES-256-GCM.
|
|
10079
10252
|
*/
|
|
10080
10253
|
encryptSecret(secret) {
|
|
@@ -10525,6 +10698,7 @@ var MfaService = class _MfaService {
|
|
|
10525
10698
|
[];
|
|
10526
10699
|
await this.transitionMfaRecord(context, userId, tenantId, (current) => {
|
|
10527
10700
|
if (!current.mfaEnabled) return null;
|
|
10701
|
+
if (!this.holdsSecret(current.mfaSecret, secretBase32)) return null;
|
|
10528
10702
|
const currentCodes = current.mfaRecoveryCodes ?? [];
|
|
10529
10703
|
const spentDigest = existingCodes[usedRecoveryIndex] ?? "";
|
|
10530
10704
|
const liveIndex = currentCodes.indexOf(spentDigest);
|
|
@@ -10542,7 +10716,7 @@ var MfaService = class _MfaService {
|
|
|
10542
10716
|
};
|
|
10543
10717
|
});
|
|
10544
10718
|
} else if (encryptedUnderRetiredKey) {
|
|
10545
|
-
void this.reencryptSecret(userId, context, secretBase32,
|
|
10719
|
+
void this.reencryptSecret(userId, context, secretBase32, tenantId);
|
|
10546
10720
|
}
|
|
10547
10721
|
this.logger.log(`challenge: MFA challenge passed userId=${logSafe(userId)} context=${context}`);
|
|
10548
10722
|
if (context === "dashboard") {
|
|
@@ -11107,7 +11281,7 @@ var MfaService = class _MfaService {
|
|
|
11107
11281
|
return admin;
|
|
11108
11282
|
}
|
|
11109
11283
|
};
|
|
11110
|
-
MfaService =
|
|
11284
|
+
MfaService = _ts_decorate37([
|
|
11111
11285
|
Injectable(),
|
|
11112
11286
|
_ts_param21(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
11113
11287
|
_ts_param21(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
@@ -11120,8 +11294,8 @@ MfaService = _ts_decorate36([
|
|
|
11120
11294
|
_ts_param21(7, Inject(SessionService)),
|
|
11121
11295
|
_ts_param21(8, Inject(BYMAX_AUTH_EMAIL_PROVIDER)),
|
|
11122
11296
|
_ts_param21(9, Inject(BYMAX_AUTH_HOOKS)),
|
|
11123
|
-
|
|
11124
|
-
|
|
11297
|
+
_ts_metadata36("design:type", Function),
|
|
11298
|
+
_ts_metadata36("design:paramtypes", [
|
|
11125
11299
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
11126
11300
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
11127
11301
|
Object,
|
|
@@ -11136,7 +11310,7 @@ MfaService = _ts_decorate36([
|
|
|
11136
11310
|
], MfaService);
|
|
11137
11311
|
|
|
11138
11312
|
// src/server/controllers/mfa.controller.ts
|
|
11139
|
-
function
|
|
11313
|
+
function _ts_decorate38(decorators, target, key, desc) {
|
|
11140
11314
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11141
11315
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11142
11316
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11149,13 +11323,13 @@ function _ts_decorate37(decorators, target, key, desc) {
|
|
|
11149
11323
|
}
|
|
11150
11324
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11151
11325
|
}
|
|
11152
|
-
__name(
|
|
11153
|
-
function
|
|
11326
|
+
__name(_ts_decorate38, "_ts_decorate");
|
|
11327
|
+
function _ts_metadata37(metadataKey, metadataValue) {
|
|
11154
11328
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11155
11329
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11156
11330
|
}
|
|
11157
11331
|
}
|
|
11158
|
-
__name(
|
|
11332
|
+
__name(_ts_metadata37, "_ts_metadata");
|
|
11159
11333
|
function _ts_param22(paramIndex, decorator) {
|
|
11160
11334
|
return function(target, key) {
|
|
11161
11335
|
decorator(target, key, paramIndex);
|
|
@@ -11350,21 +11524,22 @@ var MfaController = class {
|
|
|
11350
11524
|
return this.mfaService.regenerateRecoveryCodes(user.sub, dto.code, ip, userAgent, "dashboard", user.tenantId);
|
|
11351
11525
|
}
|
|
11352
11526
|
};
|
|
11353
|
-
|
|
11527
|
+
_ts_decorate38([
|
|
11354
11528
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
11355
11529
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaSetup),
|
|
11356
11530
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaSetup),
|
|
11531
|
+
RequestEncoding("when-body"),
|
|
11357
11532
|
Post("setup"),
|
|
11358
11533
|
_ts_param22(0, CurrentUser()),
|
|
11359
11534
|
_ts_param22(1, Body()),
|
|
11360
|
-
|
|
11361
|
-
|
|
11535
|
+
_ts_metadata37("design:type", Function),
|
|
11536
|
+
_ts_metadata37("design:paramtypes", [
|
|
11362
11537
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
11363
11538
|
typeof MfaSetupDto === "undefined" ? Object : MfaSetupDto
|
|
11364
11539
|
]),
|
|
11365
|
-
|
|
11540
|
+
_ts_metadata37("design:returntype", Promise)
|
|
11366
11541
|
], MfaController.prototype, "setup", null);
|
|
11367
|
-
|
|
11542
|
+
_ts_decorate38([
|
|
11368
11543
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
11369
11544
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaVerifyEnable),
|
|
11370
11545
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaVerifyEnable),
|
|
@@ -11373,15 +11548,15 @@ _ts_decorate37([
|
|
|
11373
11548
|
_ts_param22(0, CurrentUser()),
|
|
11374
11549
|
_ts_param22(1, Body()),
|
|
11375
11550
|
_ts_param22(2, Req()),
|
|
11376
|
-
|
|
11377
|
-
|
|
11551
|
+
_ts_metadata37("design:type", Function),
|
|
11552
|
+
_ts_metadata37("design:paramtypes", [
|
|
11378
11553
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
11379
11554
|
typeof MfaVerifyDto === "undefined" ? Object : MfaVerifyDto,
|
|
11380
11555
|
typeof Request === "undefined" ? Object : Request
|
|
11381
11556
|
]),
|
|
11382
|
-
|
|
11557
|
+
_ts_metadata37("design:returntype", Promise)
|
|
11383
11558
|
], MfaController.prototype, "verifyEnable", null);
|
|
11384
|
-
|
|
11559
|
+
_ts_decorate38([
|
|
11385
11560
|
Public(),
|
|
11386
11561
|
SkipMfa(),
|
|
11387
11562
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaChallenge),
|
|
@@ -11393,15 +11568,15 @@ _ts_decorate37([
|
|
|
11393
11568
|
_ts_param22(2, Res({
|
|
11394
11569
|
passthrough: true
|
|
11395
11570
|
})),
|
|
11396
|
-
|
|
11397
|
-
|
|
11571
|
+
_ts_metadata37("design:type", Function),
|
|
11572
|
+
_ts_metadata37("design:paramtypes", [
|
|
11398
11573
|
typeof MfaChallengeDto === "undefined" ? Object : MfaChallengeDto,
|
|
11399
11574
|
typeof Request === "undefined" ? Object : Request,
|
|
11400
11575
|
typeof Response === "undefined" ? Object : Response
|
|
11401
11576
|
]),
|
|
11402
|
-
|
|
11577
|
+
_ts_metadata37("design:returntype", Promise)
|
|
11403
11578
|
], MfaController.prototype, "challenge", null);
|
|
11404
|
-
|
|
11579
|
+
_ts_decorate38([
|
|
11405
11580
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
11406
11581
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
11407
11582
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
@@ -11410,15 +11585,15 @@ _ts_decorate37([
|
|
|
11410
11585
|
_ts_param22(0, CurrentUser()),
|
|
11411
11586
|
_ts_param22(1, Body()),
|
|
11412
11587
|
_ts_param22(2, Req()),
|
|
11413
|
-
|
|
11414
|
-
|
|
11588
|
+
_ts_metadata37("design:type", Function),
|
|
11589
|
+
_ts_metadata37("design:paramtypes", [
|
|
11415
11590
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
11416
11591
|
typeof MfaDisableDto === "undefined" ? Object : MfaDisableDto,
|
|
11417
11592
|
typeof Request === "undefined" ? Object : Request
|
|
11418
11593
|
]),
|
|
11419
|
-
|
|
11594
|
+
_ts_metadata37("design:returntype", Promise)
|
|
11420
11595
|
], MfaController.prototype, "disable", null);
|
|
11421
|
-
|
|
11596
|
+
_ts_decorate38([
|
|
11422
11597
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
11423
11598
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
11424
11599
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
@@ -11427,33 +11602,33 @@ _ts_decorate37([
|
|
|
11427
11602
|
_ts_param22(0, CurrentUser()),
|
|
11428
11603
|
_ts_param22(1, Body()),
|
|
11429
11604
|
_ts_param22(2, Req()),
|
|
11430
|
-
|
|
11431
|
-
|
|
11605
|
+
_ts_metadata37("design:type", Function),
|
|
11606
|
+
_ts_metadata37("design:paramtypes", [
|
|
11432
11607
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
11433
11608
|
typeof MfaRegenerateRecoveryCodesDto === "undefined" ? Object : MfaRegenerateRecoveryCodesDto,
|
|
11434
11609
|
typeof Request === "undefined" ? Object : Request
|
|
11435
11610
|
]),
|
|
11436
|
-
|
|
11611
|
+
_ts_metadata37("design:returntype", Promise)
|
|
11437
11612
|
], MfaController.prototype, "regenerateRecoveryCodes", null);
|
|
11438
|
-
MfaController =
|
|
11613
|
+
MfaController = _ts_decorate38([
|
|
11439
11614
|
UseInterceptors(NoStoreInterceptor),
|
|
11440
11615
|
Controller("mfa"),
|
|
11441
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
11616
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
11442
11617
|
UsePipes(createAuthValidationPipe({
|
|
11443
11618
|
forbidUnknownValues: true
|
|
11444
11619
|
})),
|
|
11445
11620
|
_ts_param22(0, Inject(MfaService)),
|
|
11446
11621
|
_ts_param22(1, Inject(TokenDeliveryService)),
|
|
11447
11622
|
_ts_param22(2, Inject(BYMAX_AUTH_OPTIONS)),
|
|
11448
|
-
|
|
11449
|
-
|
|
11623
|
+
_ts_metadata37("design:type", Function),
|
|
11624
|
+
_ts_metadata37("design:paramtypes", [
|
|
11450
11625
|
typeof MfaService === "undefined" ? Object : MfaService,
|
|
11451
11626
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService,
|
|
11452
11627
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
11453
11628
|
])
|
|
11454
11629
|
], MfaController);
|
|
11455
11630
|
var Authenticated = /* @__PURE__ */ __name(() => SetMetadata(IS_PUBLIC_KEY, false), "Authenticated");
|
|
11456
|
-
function
|
|
11631
|
+
function _ts_decorate39(decorators, target, key, desc) {
|
|
11457
11632
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11458
11633
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11459
11634
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11466,13 +11641,13 @@ function _ts_decorate38(decorators, target, key, desc) {
|
|
|
11466
11641
|
}
|
|
11467
11642
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11468
11643
|
}
|
|
11469
|
-
__name(
|
|
11470
|
-
function
|
|
11644
|
+
__name(_ts_decorate39, "_ts_decorate");
|
|
11645
|
+
function _ts_metadata38(metadataKey, metadataValue) {
|
|
11471
11646
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11472
11647
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11473
11648
|
}
|
|
11474
11649
|
}
|
|
11475
|
-
__name(
|
|
11650
|
+
__name(_ts_metadata38, "_ts_metadata");
|
|
11476
11651
|
var ChangePasswordDto = class {
|
|
11477
11652
|
static {
|
|
11478
11653
|
__name(this, "ChangePasswordDto");
|
|
@@ -11525,26 +11700,26 @@ var ChangePasswordDto = class {
|
|
|
11525
11700
|
*/
|
|
11526
11701
|
refreshToken;
|
|
11527
11702
|
};
|
|
11528
|
-
|
|
11703
|
+
_ts_decorate39([
|
|
11529
11704
|
IsString(),
|
|
11530
11705
|
MinLength(1),
|
|
11531
11706
|
MaxLength(128),
|
|
11532
|
-
|
|
11707
|
+
_ts_metadata38("design:type", String)
|
|
11533
11708
|
], ChangePasswordDto.prototype, "currentPassword", void 0);
|
|
11534
|
-
|
|
11709
|
+
_ts_decorate39([
|
|
11535
11710
|
IsString(),
|
|
11536
11711
|
MinLength(8),
|
|
11537
11712
|
MaxLength(128),
|
|
11538
|
-
|
|
11713
|
+
_ts_metadata38("design:type", String)
|
|
11539
11714
|
], ChangePasswordDto.prototype, "newPassword", void 0);
|
|
11540
|
-
|
|
11715
|
+
_ts_decorate39([
|
|
11541
11716
|
IsOptional(),
|
|
11542
11717
|
IsString(),
|
|
11543
11718
|
IsNotEmpty(),
|
|
11544
11719
|
MaxLength(2048),
|
|
11545
|
-
|
|
11720
|
+
_ts_metadata38("design:type", String)
|
|
11546
11721
|
], ChangePasswordDto.prototype, "refreshToken", void 0);
|
|
11547
|
-
function
|
|
11722
|
+
function _ts_decorate40(decorators, target, key, desc) {
|
|
11548
11723
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11549
11724
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11550
11725
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11557,13 +11732,13 @@ function _ts_decorate39(decorators, target, key, desc) {
|
|
|
11557
11732
|
}
|
|
11558
11733
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11559
11734
|
}
|
|
11560
|
-
__name(
|
|
11561
|
-
function
|
|
11735
|
+
__name(_ts_decorate40, "_ts_decorate");
|
|
11736
|
+
function _ts_metadata39(metadataKey, metadataValue) {
|
|
11562
11737
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11563
11738
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11564
11739
|
}
|
|
11565
11740
|
}
|
|
11566
|
-
__name(
|
|
11741
|
+
__name(_ts_metadata39, "_ts_metadata");
|
|
11567
11742
|
var ForgotPasswordDto = class {
|
|
11568
11743
|
static {
|
|
11569
11744
|
__name(this, "ForgotPasswordDto");
|
|
@@ -11579,13 +11754,13 @@ var ForgotPasswordDto = class {
|
|
|
11579
11754
|
*/
|
|
11580
11755
|
tenantId;
|
|
11581
11756
|
};
|
|
11582
|
-
|
|
11757
|
+
_ts_decorate40([
|
|
11583
11758
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
11584
11759
|
IsEmail(),
|
|
11585
11760
|
MaxLength(255),
|
|
11586
|
-
|
|
11761
|
+
_ts_metadata39("design:type", String)
|
|
11587
11762
|
], ForgotPasswordDto.prototype, "email", void 0);
|
|
11588
|
-
|
|
11763
|
+
_ts_decorate40([
|
|
11589
11764
|
IsOptional(),
|
|
11590
11765
|
IsString(),
|
|
11591
11766
|
IsNotEmpty(),
|
|
@@ -11593,9 +11768,9 @@ _ts_decorate39([
|
|
|
11593
11768
|
Matches(NO_CONTROL_CHARACTERS, {
|
|
11594
11769
|
message: "tenantId must not contain control characters"
|
|
11595
11770
|
}),
|
|
11596
|
-
|
|
11771
|
+
_ts_metadata39("design:type", String)
|
|
11597
11772
|
], ForgotPasswordDto.prototype, "tenantId", void 0);
|
|
11598
|
-
function
|
|
11773
|
+
function _ts_decorate41(decorators, target, key, desc) {
|
|
11599
11774
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11600
11775
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11601
11776
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11608,13 +11783,13 @@ function _ts_decorate40(decorators, target, key, desc) {
|
|
|
11608
11783
|
}
|
|
11609
11784
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11610
11785
|
}
|
|
11611
|
-
__name(
|
|
11612
|
-
function
|
|
11786
|
+
__name(_ts_decorate41, "_ts_decorate");
|
|
11787
|
+
function _ts_metadata40(metadataKey, metadataValue) {
|
|
11613
11788
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11614
11789
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11615
11790
|
}
|
|
11616
11791
|
}
|
|
11617
|
-
__name(
|
|
11792
|
+
__name(_ts_metadata40, "_ts_metadata");
|
|
11618
11793
|
var ResendOtpDto = class {
|
|
11619
11794
|
static {
|
|
11620
11795
|
__name(this, "ResendOtpDto");
|
|
@@ -11629,13 +11804,13 @@ var ResendOtpDto = class {
|
|
|
11629
11804
|
*/
|
|
11630
11805
|
tenantId;
|
|
11631
11806
|
};
|
|
11632
|
-
|
|
11807
|
+
_ts_decorate41([
|
|
11633
11808
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
11634
11809
|
IsEmail(),
|
|
11635
11810
|
MaxLength(255),
|
|
11636
|
-
|
|
11811
|
+
_ts_metadata40("design:type", String)
|
|
11637
11812
|
], ResendOtpDto.prototype, "email", void 0);
|
|
11638
|
-
|
|
11813
|
+
_ts_decorate41([
|
|
11639
11814
|
IsOptional(),
|
|
11640
11815
|
IsString(),
|
|
11641
11816
|
IsNotEmpty(),
|
|
@@ -11643,9 +11818,9 @@ _ts_decorate40([
|
|
|
11643
11818
|
Matches(NO_CONTROL_CHARACTERS, {
|
|
11644
11819
|
message: "tenantId must not contain control characters"
|
|
11645
11820
|
}),
|
|
11646
|
-
|
|
11821
|
+
_ts_metadata40("design:type", String)
|
|
11647
11822
|
], ResendOtpDto.prototype, "tenantId", void 0);
|
|
11648
|
-
function
|
|
11823
|
+
function _ts_decorate42(decorators, target, key, desc) {
|
|
11649
11824
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11650
11825
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11651
11826
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11658,13 +11833,13 @@ function _ts_decorate41(decorators, target, key, desc) {
|
|
|
11658
11833
|
}
|
|
11659
11834
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11660
11835
|
}
|
|
11661
|
-
__name(
|
|
11662
|
-
function
|
|
11836
|
+
__name(_ts_decorate42, "_ts_decorate");
|
|
11837
|
+
function _ts_metadata41(metadataKey, metadataValue) {
|
|
11663
11838
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11664
11839
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11665
11840
|
}
|
|
11666
11841
|
}
|
|
11667
|
-
__name(
|
|
11842
|
+
__name(_ts_metadata41, "_ts_metadata");
|
|
11668
11843
|
var ResetPasswordDto = class {
|
|
11669
11844
|
static {
|
|
11670
11845
|
__name(this, "ResetPasswordDto");
|
|
@@ -11711,38 +11886,38 @@ var ResetPasswordDto = class {
|
|
|
11711
11886
|
*/
|
|
11712
11887
|
tenantId;
|
|
11713
11888
|
};
|
|
11714
|
-
|
|
11889
|
+
_ts_decorate42([
|
|
11715
11890
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
11716
11891
|
IsEmail(),
|
|
11717
11892
|
MaxLength(255),
|
|
11718
|
-
|
|
11893
|
+
_ts_metadata41("design:type", String)
|
|
11719
11894
|
], ResetPasswordDto.prototype, "email", void 0);
|
|
11720
|
-
|
|
11895
|
+
_ts_decorate42([
|
|
11721
11896
|
IsString(),
|
|
11722
11897
|
MinLength(8),
|
|
11723
11898
|
MaxLength(128),
|
|
11724
|
-
|
|
11899
|
+
_ts_metadata41("design:type", String)
|
|
11725
11900
|
], ResetPasswordDto.prototype, "newPassword", void 0);
|
|
11726
|
-
|
|
11901
|
+
_ts_decorate42([
|
|
11727
11902
|
IsOptional(),
|
|
11728
11903
|
IsString(),
|
|
11729
11904
|
IsNotEmpty(),
|
|
11730
11905
|
MaxLength(2048),
|
|
11731
|
-
|
|
11906
|
+
_ts_metadata41("design:type", String)
|
|
11732
11907
|
], ResetPasswordDto.prototype, "token", void 0);
|
|
11733
|
-
|
|
11908
|
+
_ts_decorate42([
|
|
11734
11909
|
IsOptional(),
|
|
11735
11910
|
IsString(),
|
|
11736
11911
|
Length(4, 8),
|
|
11737
|
-
|
|
11912
|
+
_ts_metadata41("design:type", String)
|
|
11738
11913
|
], ResetPasswordDto.prototype, "otp", void 0);
|
|
11739
|
-
|
|
11914
|
+
_ts_decorate42([
|
|
11740
11915
|
IsOptional(),
|
|
11741
11916
|
IsString(),
|
|
11742
11917
|
Length(64, 64),
|
|
11743
|
-
|
|
11918
|
+
_ts_metadata41("design:type", String)
|
|
11744
11919
|
], ResetPasswordDto.prototype, "verifiedToken", void 0);
|
|
11745
|
-
|
|
11920
|
+
_ts_decorate42([
|
|
11746
11921
|
IsOptional(),
|
|
11747
11922
|
IsString(),
|
|
11748
11923
|
IsNotEmpty(),
|
|
@@ -11750,9 +11925,9 @@ _ts_decorate41([
|
|
|
11750
11925
|
Matches(NO_CONTROL_CHARACTERS, {
|
|
11751
11926
|
message: "tenantId must not contain control characters"
|
|
11752
11927
|
}),
|
|
11753
|
-
|
|
11928
|
+
_ts_metadata41("design:type", String)
|
|
11754
11929
|
], ResetPasswordDto.prototype, "tenantId", void 0);
|
|
11755
|
-
function
|
|
11930
|
+
function _ts_decorate43(decorators, target, key, desc) {
|
|
11756
11931
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11757
11932
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11758
11933
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11765,13 +11940,13 @@ function _ts_decorate42(decorators, target, key, desc) {
|
|
|
11765
11940
|
}
|
|
11766
11941
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11767
11942
|
}
|
|
11768
|
-
__name(
|
|
11769
|
-
function
|
|
11943
|
+
__name(_ts_decorate43, "_ts_decorate");
|
|
11944
|
+
function _ts_metadata42(metadataKey, metadataValue) {
|
|
11770
11945
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11771
11946
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11772
11947
|
}
|
|
11773
11948
|
}
|
|
11774
|
-
__name(
|
|
11949
|
+
__name(_ts_metadata42, "_ts_metadata");
|
|
11775
11950
|
var VerifyOtpDto = class {
|
|
11776
11951
|
static {
|
|
11777
11952
|
__name(this, "VerifyOtpDto");
|
|
@@ -11793,18 +11968,18 @@ var VerifyOtpDto = class {
|
|
|
11793
11968
|
*/
|
|
11794
11969
|
tenantId;
|
|
11795
11970
|
};
|
|
11796
|
-
|
|
11971
|
+
_ts_decorate43([
|
|
11797
11972
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
11798
11973
|
IsEmail(),
|
|
11799
11974
|
MaxLength(255),
|
|
11800
|
-
|
|
11975
|
+
_ts_metadata42("design:type", String)
|
|
11801
11976
|
], VerifyOtpDto.prototype, "email", void 0);
|
|
11802
|
-
|
|
11977
|
+
_ts_decorate43([
|
|
11803
11978
|
IsString(),
|
|
11804
11979
|
Length(4, 8),
|
|
11805
|
-
|
|
11980
|
+
_ts_metadata42("design:type", String)
|
|
11806
11981
|
], VerifyOtpDto.prototype, "otp", void 0);
|
|
11807
|
-
|
|
11982
|
+
_ts_decorate43([
|
|
11808
11983
|
IsOptional(),
|
|
11809
11984
|
IsString(),
|
|
11810
11985
|
IsNotEmpty(),
|
|
@@ -11812,9 +11987,9 @@ _ts_decorate42([
|
|
|
11812
11987
|
Matches(NO_CONTROL_CHARACTERS, {
|
|
11813
11988
|
message: "tenantId must not contain control characters"
|
|
11814
11989
|
}),
|
|
11815
|
-
|
|
11990
|
+
_ts_metadata42("design:type", String)
|
|
11816
11991
|
], VerifyOtpDto.prototype, "tenantId", void 0);
|
|
11817
|
-
function
|
|
11992
|
+
function _ts_decorate44(decorators, target, key, desc) {
|
|
11818
11993
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11819
11994
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
11820
11995
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11827,13 +12002,13 @@ function _ts_decorate43(decorators, target, key, desc) {
|
|
|
11827
12002
|
}
|
|
11828
12003
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11829
12004
|
}
|
|
11830
|
-
__name(
|
|
11831
|
-
function
|
|
12005
|
+
__name(_ts_decorate44, "_ts_decorate");
|
|
12006
|
+
function _ts_metadata43(metadataKey, metadataValue) {
|
|
11832
12007
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
11833
12008
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
11834
12009
|
}
|
|
11835
12010
|
}
|
|
11836
|
-
__name(
|
|
12011
|
+
__name(_ts_metadata43, "_ts_metadata");
|
|
11837
12012
|
function _ts_param23(paramIndex, decorator) {
|
|
11838
12013
|
return function(target, key) {
|
|
11839
12014
|
decorator(target, key, paramIndex);
|
|
@@ -12449,7 +12624,7 @@ var PasswordResetService = class _PasswordResetService {
|
|
|
12449
12624
|
};
|
|
12450
12625
|
}
|
|
12451
12626
|
};
|
|
12452
|
-
PasswordResetService =
|
|
12627
|
+
PasswordResetService = _ts_decorate44([
|
|
12453
12628
|
Injectable(),
|
|
12454
12629
|
_ts_param23(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
12455
12630
|
_ts_param23(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
@@ -12462,8 +12637,8 @@ PasswordResetService = _ts_decorate43([
|
|
|
12462
12637
|
_ts_param23(6, Inject(AuthRedisService)),
|
|
12463
12638
|
_ts_param23(7, Inject(SessionService)),
|
|
12464
12639
|
_ts_param23(8, Inject(BruteForceService)),
|
|
12465
|
-
|
|
12466
|
-
|
|
12640
|
+
_ts_metadata43("design:type", Function),
|
|
12641
|
+
_ts_metadata43("design:paramtypes", [
|
|
12467
12642
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
12468
12643
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
12469
12644
|
Object,
|
|
@@ -12482,7 +12657,7 @@ function toSafeUser3(user) {
|
|
|
12482
12657
|
__name(toSafeUser3, "toSafeUser");
|
|
12483
12658
|
|
|
12484
12659
|
// src/server/controllers/password-reset.controller.ts
|
|
12485
|
-
function
|
|
12660
|
+
function _ts_decorate45(decorators, target, key, desc) {
|
|
12486
12661
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12487
12662
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
12488
12663
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -12495,13 +12670,13 @@ function _ts_decorate44(decorators, target, key, desc) {
|
|
|
12495
12670
|
}
|
|
12496
12671
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12497
12672
|
}
|
|
12498
|
-
__name(
|
|
12499
|
-
function
|
|
12673
|
+
__name(_ts_decorate45, "_ts_decorate");
|
|
12674
|
+
function _ts_metadata44(metadataKey, metadataValue) {
|
|
12500
12675
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
12501
12676
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
12502
12677
|
}
|
|
12503
12678
|
}
|
|
12504
|
-
__name(
|
|
12679
|
+
__name(_ts_metadata44, "_ts_metadata");
|
|
12505
12680
|
function _ts_param24(paramIndex, decorator) {
|
|
12506
12681
|
return function(target, key) {
|
|
12507
12682
|
decorator(target, key, paramIndex);
|
|
@@ -12624,35 +12799,35 @@ var PasswordResetController = class {
|
|
|
12624
12799
|
return {};
|
|
12625
12800
|
}
|
|
12626
12801
|
};
|
|
12627
|
-
|
|
12802
|
+
_ts_decorate45([
|
|
12628
12803
|
Throttle(AUTH_THROTTLE_CONFIGS.forgotPassword),
|
|
12629
12804
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.forgotPassword),
|
|
12630
12805
|
HttpCode(HttpStatus.OK),
|
|
12631
12806
|
Post("forgot-password"),
|
|
12632
12807
|
_ts_param24(0, Body()),
|
|
12633
12808
|
_ts_param24(1, Req()),
|
|
12634
|
-
|
|
12635
|
-
|
|
12809
|
+
_ts_metadata44("design:type", Function),
|
|
12810
|
+
_ts_metadata44("design:paramtypes", [
|
|
12636
12811
|
typeof ForgotPasswordDto === "undefined" ? Object : ForgotPasswordDto,
|
|
12637
12812
|
typeof Request === "undefined" ? Object : Request
|
|
12638
12813
|
]),
|
|
12639
|
-
|
|
12814
|
+
_ts_metadata44("design:returntype", Promise)
|
|
12640
12815
|
], PasswordResetController.prototype, "forgotPassword", null);
|
|
12641
|
-
|
|
12816
|
+
_ts_decorate45([
|
|
12642
12817
|
Throttle(AUTH_THROTTLE_CONFIGS.resetPassword),
|
|
12643
12818
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.resetPassword),
|
|
12644
12819
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
12645
12820
|
Post("reset-password"),
|
|
12646
12821
|
_ts_param24(0, Body()),
|
|
12647
12822
|
_ts_param24(1, Req()),
|
|
12648
|
-
|
|
12649
|
-
|
|
12823
|
+
_ts_metadata44("design:type", Function),
|
|
12824
|
+
_ts_metadata44("design:paramtypes", [
|
|
12650
12825
|
typeof ResetPasswordDto === "undefined" ? Object : ResetPasswordDto,
|
|
12651
12826
|
typeof Request === "undefined" ? Object : Request
|
|
12652
12827
|
]),
|
|
12653
|
-
|
|
12828
|
+
_ts_metadata44("design:returntype", Promise)
|
|
12654
12829
|
], PasswordResetController.prototype, "resetPassword", null);
|
|
12655
|
-
|
|
12830
|
+
_ts_decorate45([
|
|
12656
12831
|
Authenticated(),
|
|
12657
12832
|
UseGuards(JwtAuthGuard, UserStatusGuard),
|
|
12658
12833
|
Throttle(AUTH_THROTTLE_CONFIGS.changePassword),
|
|
@@ -12662,57 +12837,57 @@ _ts_decorate44([
|
|
|
12662
12837
|
_ts_param24(0, CurrentUser()),
|
|
12663
12838
|
_ts_param24(1, Body()),
|
|
12664
12839
|
_ts_param24(2, Req()),
|
|
12665
|
-
|
|
12666
|
-
|
|
12840
|
+
_ts_metadata44("design:type", Function),
|
|
12841
|
+
_ts_metadata44("design:paramtypes", [
|
|
12667
12842
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
12668
12843
|
typeof ChangePasswordDto === "undefined" ? Object : ChangePasswordDto,
|
|
12669
12844
|
typeof Request === "undefined" ? Object : Request
|
|
12670
12845
|
]),
|
|
12671
|
-
|
|
12846
|
+
_ts_metadata44("design:returntype", Promise)
|
|
12672
12847
|
], PasswordResetController.prototype, "changePassword", null);
|
|
12673
|
-
|
|
12848
|
+
_ts_decorate45([
|
|
12674
12849
|
Throttle(AUTH_THROTTLE_CONFIGS.verifyOtp),
|
|
12675
12850
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.verifyOtp),
|
|
12676
12851
|
HttpCode(HttpStatus.OK),
|
|
12677
12852
|
Post("verify-otp"),
|
|
12678
12853
|
_ts_param24(0, Body()),
|
|
12679
12854
|
_ts_param24(1, Req()),
|
|
12680
|
-
|
|
12681
|
-
|
|
12855
|
+
_ts_metadata44("design:type", Function),
|
|
12856
|
+
_ts_metadata44("design:paramtypes", [
|
|
12682
12857
|
typeof VerifyOtpDto === "undefined" ? Object : VerifyOtpDto,
|
|
12683
12858
|
typeof Request === "undefined" ? Object : Request
|
|
12684
12859
|
]),
|
|
12685
|
-
|
|
12860
|
+
_ts_metadata44("design:returntype", Promise)
|
|
12686
12861
|
], PasswordResetController.prototype, "verifyOtp", null);
|
|
12687
|
-
|
|
12862
|
+
_ts_decorate45([
|
|
12688
12863
|
Throttle(AUTH_THROTTLE_CONFIGS.resendPasswordOtp),
|
|
12689
12864
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.resendPasswordOtp),
|
|
12690
12865
|
HttpCode(HttpStatus.OK),
|
|
12691
12866
|
Post("resend-otp"),
|
|
12692
12867
|
_ts_param24(0, Body()),
|
|
12693
12868
|
_ts_param24(1, Req()),
|
|
12694
|
-
|
|
12695
|
-
|
|
12869
|
+
_ts_metadata44("design:type", Function),
|
|
12870
|
+
_ts_metadata44("design:paramtypes", [
|
|
12696
12871
|
typeof ResendOtpDto === "undefined" ? Object : ResendOtpDto,
|
|
12697
12872
|
typeof Request === "undefined" ? Object : Request
|
|
12698
12873
|
]),
|
|
12699
|
-
|
|
12874
|
+
_ts_metadata44("design:returntype", Promise)
|
|
12700
12875
|
], PasswordResetController.prototype, "resendOtp", null);
|
|
12701
|
-
PasswordResetController =
|
|
12876
|
+
PasswordResetController = _ts_decorate45([
|
|
12702
12877
|
Public(),
|
|
12703
12878
|
UseInterceptors(NoStoreInterceptor),
|
|
12704
12879
|
Controller("password"),
|
|
12705
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
12880
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
12706
12881
|
UsePipes(createAuthValidationPipe()),
|
|
12707
12882
|
_ts_param24(0, Inject(PasswordResetService)),
|
|
12708
12883
|
_ts_param24(1, Inject(TokenDeliveryService)),
|
|
12709
|
-
|
|
12710
|
-
|
|
12884
|
+
_ts_metadata44("design:type", Function),
|
|
12885
|
+
_ts_metadata44("design:paramtypes", [
|
|
12711
12886
|
typeof PasswordResetService === "undefined" ? Object : PasswordResetService,
|
|
12712
12887
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService
|
|
12713
12888
|
])
|
|
12714
12889
|
], PasswordResetController);
|
|
12715
|
-
function
|
|
12890
|
+
function _ts_decorate46(decorators, target, key, desc) {
|
|
12716
12891
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12717
12892
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
12718
12893
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -12725,13 +12900,13 @@ function _ts_decorate45(decorators, target, key, desc) {
|
|
|
12725
12900
|
}
|
|
12726
12901
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12727
12902
|
}
|
|
12728
|
-
__name(
|
|
12729
|
-
function
|
|
12903
|
+
__name(_ts_decorate46, "_ts_decorate");
|
|
12904
|
+
function _ts_metadata45(metadataKey, metadataValue) {
|
|
12730
12905
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
12731
12906
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
12732
12907
|
}
|
|
12733
12908
|
}
|
|
12734
|
-
__name(
|
|
12909
|
+
__name(_ts_metadata45, "_ts_metadata");
|
|
12735
12910
|
var PlatformLoginDto = class {
|
|
12736
12911
|
static {
|
|
12737
12912
|
__name(this, "PlatformLoginDto");
|
|
@@ -12759,14 +12934,14 @@ var PlatformLoginDto = class {
|
|
|
12759
12934
|
*/
|
|
12760
12935
|
password;
|
|
12761
12936
|
};
|
|
12762
|
-
|
|
12937
|
+
_ts_decorate46([
|
|
12763
12938
|
Transform(({ value }) => typeof value === "string" ? value.trim().toLowerCase() : value),
|
|
12764
12939
|
IsEmail(),
|
|
12765
12940
|
IsNotEmpty(),
|
|
12766
12941
|
MaxLength(255),
|
|
12767
|
-
|
|
12942
|
+
_ts_metadata45("design:type", String)
|
|
12768
12943
|
], PlatformLoginDto.prototype, "email", void 0);
|
|
12769
|
-
|
|
12944
|
+
_ts_decorate46([
|
|
12770
12945
|
IsString(),
|
|
12771
12946
|
IsNotEmpty(),
|
|
12772
12947
|
Matches(/\S/, {
|
|
@@ -12774,9 +12949,9 @@ _ts_decorate45([
|
|
|
12774
12949
|
}),
|
|
12775
12950
|
MinLength(1),
|
|
12776
12951
|
MaxLength(128),
|
|
12777
|
-
|
|
12952
|
+
_ts_metadata45("design:type", String)
|
|
12778
12953
|
], PlatformLoginDto.prototype, "password", void 0);
|
|
12779
|
-
function
|
|
12954
|
+
function _ts_decorate47(decorators, target, key, desc) {
|
|
12780
12955
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12781
12956
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
12782
12957
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -12789,13 +12964,13 @@ function _ts_decorate46(decorators, target, key, desc) {
|
|
|
12789
12964
|
}
|
|
12790
12965
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12791
12966
|
}
|
|
12792
|
-
__name(
|
|
12793
|
-
function
|
|
12967
|
+
__name(_ts_decorate47, "_ts_decorate");
|
|
12968
|
+
function _ts_metadata46(metadataKey, metadataValue) {
|
|
12794
12969
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
12795
12970
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
12796
12971
|
}
|
|
12797
12972
|
}
|
|
12798
|
-
__name(
|
|
12973
|
+
__name(_ts_metadata46, "_ts_metadata");
|
|
12799
12974
|
function _ts_param25(paramIndex, decorator) {
|
|
12800
12975
|
return function(target, key) {
|
|
12801
12976
|
decorator(target, key, paramIndex);
|
|
@@ -12847,15 +13022,15 @@ var JwtPlatformGuard = class {
|
|
|
12847
13022
|
return true;
|
|
12848
13023
|
}
|
|
12849
13024
|
};
|
|
12850
|
-
JwtPlatformGuard =
|
|
13025
|
+
JwtPlatformGuard = _ts_decorate47([
|
|
12851
13026
|
Injectable(),
|
|
12852
13027
|
_ts_param25(0, Inject(JwtService)),
|
|
12853
13028
|
_ts_param25(1, Inject(TokenDeliveryService)),
|
|
12854
13029
|
_ts_param25(2, Inject(AuthRevocationService)),
|
|
12855
13030
|
_ts_param25(3, Inject(Reflector)),
|
|
12856
13031
|
_ts_param25(4, Inject(BYMAX_AUTH_OPTIONS)),
|
|
12857
|
-
|
|
12858
|
-
|
|
13032
|
+
_ts_metadata46("design:type", Function),
|
|
13033
|
+
_ts_metadata46("design:paramtypes", [
|
|
12859
13034
|
typeof JwtService === "undefined" ? Object : JwtService,
|
|
12860
13035
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService,
|
|
12861
13036
|
typeof AuthRevocationService === "undefined" ? Object : AuthRevocationService,
|
|
@@ -12863,7 +13038,7 @@ JwtPlatformGuard = _ts_decorate46([
|
|
|
12863
13038
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
12864
13039
|
])
|
|
12865
13040
|
], JwtPlatformGuard);
|
|
12866
|
-
function
|
|
13041
|
+
function _ts_decorate48(decorators, target, key, desc) {
|
|
12867
13042
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12868
13043
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
12869
13044
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -12876,13 +13051,13 @@ function _ts_decorate47(decorators, target, key, desc) {
|
|
|
12876
13051
|
}
|
|
12877
13052
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12878
13053
|
}
|
|
12879
|
-
__name(
|
|
12880
|
-
function
|
|
13054
|
+
__name(_ts_decorate48, "_ts_decorate");
|
|
13055
|
+
function _ts_metadata47(metadataKey, metadataValue) {
|
|
12881
13056
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
12882
13057
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
12883
13058
|
}
|
|
12884
13059
|
}
|
|
12885
|
-
__name(
|
|
13060
|
+
__name(_ts_metadata47, "_ts_metadata");
|
|
12886
13061
|
function _ts_param26(paramIndex, decorator) {
|
|
12887
13062
|
return function(target, key) {
|
|
12888
13063
|
decorator(target, key, paramIndex);
|
|
@@ -12987,36 +13162,60 @@ var PlatformAuthService = class _PlatformAuthService {
|
|
|
12987
13162
|
*/
|
|
12988
13163
|
async logout(accessToken, rawRefreshToken) {
|
|
12989
13164
|
const tokenHash = sha256(rawRefreshToken);
|
|
12990
|
-
const
|
|
13165
|
+
const markerKey = logoutPendingKey("platform", tokenHash);
|
|
13166
|
+
const live = await this.redis.readSessionOwner(`prt:${tokenHash}`);
|
|
13167
|
+
const fromSession = live.userId !== "";
|
|
13168
|
+
const { userId } = fromSession ? live : await this.redis.readSessionOwner(markerKey);
|
|
12991
13169
|
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
13170
|
const index = userId ? sessionIndexKey("platform", userId, this.options.hmacKey, void 0) : "";
|
|
13004
13171
|
const prune = /* @__PURE__ */ __name((member) => index === "" ? [] : [
|
|
13005
13172
|
() => this.redis.srem(index, member)
|
|
13006
13173
|
], "prune");
|
|
13007
13174
|
const failures = await settleWrites([
|
|
13008
|
-
...
|
|
13175
|
+
...this.blacklistWrites(accessToken),
|
|
13009
13176
|
settleAfter(() => this.redis.del("prt:" + tokenHash), [
|
|
13010
13177
|
...prune("prt:" + tokenHash),
|
|
13011
13178
|
() => this.redis.del("psd:" + tokenHash)
|
|
13012
13179
|
]),
|
|
13013
13180
|
settleAfter(() => this.redis.del("prp:" + tokenHash), prune("prp:" + tokenHash))
|
|
13014
13181
|
]);
|
|
13182
|
+
if (failures.length > 0 && fromSession) {
|
|
13183
|
+
await rememberPendingLogout(this.redis, markerKey, {
|
|
13184
|
+
userId,
|
|
13185
|
+
tenantId: void 0
|
|
13186
|
+
}, logoutPendingTtlSeconds(this.options.jwt.accessExpiresIn), this.logger);
|
|
13187
|
+
}
|
|
13015
13188
|
raiseFirst(failures);
|
|
13016
|
-
this.
|
|
13189
|
+
if (userId !== "" && await settlePendingLogout(this.redis, markerKey, fromSession, this.logger)) {
|
|
13190
|
+
this.emitPlatformLogout(userId);
|
|
13191
|
+
}
|
|
13017
13192
|
return userId;
|
|
13018
13193
|
}
|
|
13019
13194
|
/**
|
|
13195
|
+
* The access-token blacklist write for a platform logout, or none when there is nothing to
|
|
13196
|
+
* revoke.
|
|
13197
|
+
*
|
|
13198
|
+
* Verifies signature and algorithm but not expiry: an expired token is the normal case here, a
|
|
13199
|
+
* forged one must not be able to blacklist an id it does not own. Only the verification is
|
|
13200
|
+
* tolerant: a token nobody can verify has nothing to blacklist, but a refused write is not.
|
|
13201
|
+
*
|
|
13202
|
+
* @param accessToken - Raw platform access token; absent, malformed or expired yields no write.
|
|
13203
|
+
* @returns The writes to hand to `settleWrites`.
|
|
13204
|
+
*/
|
|
13205
|
+
blacklistWrites(accessToken) {
|
|
13206
|
+
try {
|
|
13207
|
+
const payload = this.tokenManager.verifyPlatformIgnoringExpiry(accessToken);
|
|
13208
|
+
const remainingTtl = payload.exp - Math.floor(Date.now() / 1e3);
|
|
13209
|
+
if (remainingTtl > 0) {
|
|
13210
|
+
return [
|
|
13211
|
+
() => this.redis.set(`rv:${payload.jti}`, "1", remainingTtl)
|
|
13212
|
+
];
|
|
13213
|
+
}
|
|
13214
|
+
} catch {
|
|
13215
|
+
}
|
|
13216
|
+
return [];
|
|
13217
|
+
}
|
|
13218
|
+
/**
|
|
13020
13219
|
* Announces a completed platform logout, the only hook `PlatformAuthService` emits.
|
|
13021
13220
|
*
|
|
13022
13221
|
* Owns three concerns a reader of `logout` does not need: whether a hook is registered, the
|
|
@@ -13153,7 +13352,7 @@ var PlatformAuthService = class _PlatformAuthService {
|
|
|
13153
13352
|
await this.redis.bumpUserTokenEpoch(userId, void 0, "platform");
|
|
13154
13353
|
}
|
|
13155
13354
|
};
|
|
13156
|
-
PlatformAuthService =
|
|
13355
|
+
PlatformAuthService = _ts_decorate48([
|
|
13157
13356
|
Injectable(),
|
|
13158
13357
|
_ts_param26(0, Inject(BYMAX_AUTH_PLATFORM_USER_REPOSITORY)),
|
|
13159
13358
|
_ts_param26(1, Inject(PasswordService)),
|
|
@@ -13163,8 +13362,8 @@ PlatformAuthService = _ts_decorate47([
|
|
|
13163
13362
|
_ts_param26(5, Inject(BYMAX_AUTH_OPTIONS)),
|
|
13164
13363
|
_ts_param26(6, Inject(BYMAX_AUTH_HOOKS)),
|
|
13165
13364
|
_ts_param26(6, Optional()),
|
|
13166
|
-
|
|
13167
|
-
|
|
13365
|
+
_ts_metadata47("design:type", Function),
|
|
13366
|
+
_ts_metadata47("design:paramtypes", [
|
|
13168
13367
|
typeof IPlatformUserRepository === "undefined" ? Object : IPlatformUserRepository,
|
|
13169
13368
|
typeof PasswordService === "undefined" ? Object : PasswordService,
|
|
13170
13369
|
typeof TokenManagerService === "undefined" ? Object : TokenManagerService,
|
|
@@ -13176,7 +13375,7 @@ PlatformAuthService = _ts_decorate47([
|
|
|
13176
13375
|
], PlatformAuthService);
|
|
13177
13376
|
|
|
13178
13377
|
// src/server/controllers/platform-auth.controller.ts
|
|
13179
|
-
function
|
|
13378
|
+
function _ts_decorate49(decorators, target, key, desc) {
|
|
13180
13379
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
13181
13380
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
13182
13381
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13189,13 +13388,13 @@ function _ts_decorate48(decorators, target, key, desc) {
|
|
|
13189
13388
|
}
|
|
13190
13389
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13191
13390
|
}
|
|
13192
|
-
__name(
|
|
13193
|
-
function
|
|
13391
|
+
__name(_ts_decorate49, "_ts_decorate");
|
|
13392
|
+
function _ts_metadata48(metadataKey, metadataValue) {
|
|
13194
13393
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
13195
13394
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
13196
13395
|
}
|
|
13197
13396
|
}
|
|
13198
|
-
__name(
|
|
13397
|
+
__name(_ts_metadata48, "_ts_metadata");
|
|
13199
13398
|
function _ts_param27(paramIndex, decorator) {
|
|
13200
13399
|
return function(target, key) {
|
|
13201
13400
|
decorator(target, key, paramIndex);
|
|
@@ -13347,7 +13546,7 @@ var PlatformAuthController = class {
|
|
|
13347
13546
|
await this.platformAuthService.revokeAllPlatformSessions(user.sub);
|
|
13348
13547
|
}
|
|
13349
13548
|
};
|
|
13350
|
-
|
|
13549
|
+
_ts_decorate49([
|
|
13351
13550
|
Public(),
|
|
13352
13551
|
Throttle(AUTH_THROTTLE_CONFIGS.platformLogin),
|
|
13353
13552
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.platformLogin),
|
|
@@ -13355,14 +13554,14 @@ _ts_decorate48([
|
|
|
13355
13554
|
Post("login"),
|
|
13356
13555
|
_ts_param27(0, Body()),
|
|
13357
13556
|
_ts_param27(1, Req()),
|
|
13358
|
-
|
|
13359
|
-
|
|
13557
|
+
_ts_metadata48("design:type", Function),
|
|
13558
|
+
_ts_metadata48("design:paramtypes", [
|
|
13360
13559
|
typeof PlatformLoginDto === "undefined" ? Object : PlatformLoginDto,
|
|
13361
13560
|
typeof Request === "undefined" ? Object : Request
|
|
13362
13561
|
]),
|
|
13363
|
-
|
|
13562
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13364
13563
|
], PlatformAuthController.prototype, "login", null);
|
|
13365
|
-
|
|
13564
|
+
_ts_decorate49([
|
|
13366
13565
|
Public(),
|
|
13367
13566
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaChallenge),
|
|
13368
13567
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaChallenge),
|
|
@@ -13370,78 +13569,80 @@ _ts_decorate48([
|
|
|
13370
13569
|
Post("mfa/challenge"),
|
|
13371
13570
|
_ts_param27(0, Body()),
|
|
13372
13571
|
_ts_param27(1, Req()),
|
|
13373
|
-
|
|
13374
|
-
|
|
13572
|
+
_ts_metadata48("design:type", Function),
|
|
13573
|
+
_ts_metadata48("design:paramtypes", [
|
|
13375
13574
|
typeof MfaChallengeDto === "undefined" ? Object : MfaChallengeDto,
|
|
13376
13575
|
typeof Request === "undefined" ? Object : Request
|
|
13377
13576
|
]),
|
|
13378
|
-
|
|
13577
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13379
13578
|
], PlatformAuthController.prototype, "mfaChallenge", null);
|
|
13380
|
-
|
|
13579
|
+
_ts_decorate49([
|
|
13381
13580
|
UseGuards(JwtPlatformGuard),
|
|
13382
13581
|
Get("me"),
|
|
13383
13582
|
_ts_param27(0, CurrentUser()),
|
|
13384
|
-
|
|
13385
|
-
|
|
13583
|
+
_ts_metadata48("design:type", Function),
|
|
13584
|
+
_ts_metadata48("design:paramtypes", [
|
|
13386
13585
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload
|
|
13387
13586
|
]),
|
|
13388
|
-
|
|
13587
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13389
13588
|
], PlatformAuthController.prototype, "me", null);
|
|
13390
|
-
|
|
13589
|
+
_ts_decorate49([
|
|
13391
13590
|
Public(),
|
|
13392
13591
|
Throttle(AUTH_THROTTLE_CONFIGS.logout),
|
|
13393
13592
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.logout),
|
|
13394
13593
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
13594
|
+
RequestEncoding("unchecked"),
|
|
13395
13595
|
Post("logout"),
|
|
13396
13596
|
_ts_param27(0, Req()),
|
|
13397
|
-
|
|
13398
|
-
|
|
13597
|
+
_ts_metadata48("design:type", Function),
|
|
13598
|
+
_ts_metadata48("design:paramtypes", [
|
|
13399
13599
|
typeof Request === "undefined" ? Object : Request
|
|
13400
13600
|
]),
|
|
13401
|
-
|
|
13601
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13402
13602
|
], PlatformAuthController.prototype, "logout", null);
|
|
13403
|
-
|
|
13603
|
+
_ts_decorate49([
|
|
13404
13604
|
Public(),
|
|
13405
13605
|
Throttle(AUTH_THROTTLE_CONFIGS.refresh),
|
|
13406
13606
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.refresh),
|
|
13407
13607
|
HttpCode(HttpStatus.OK),
|
|
13608
|
+
RequestEncoding("unchecked"),
|
|
13408
13609
|
Post("refresh"),
|
|
13409
13610
|
_ts_param27(0, Req()),
|
|
13410
|
-
|
|
13411
|
-
|
|
13611
|
+
_ts_metadata48("design:type", Function),
|
|
13612
|
+
_ts_metadata48("design:paramtypes", [
|
|
13412
13613
|
typeof Request === "undefined" ? Object : Request
|
|
13413
13614
|
]),
|
|
13414
|
-
|
|
13615
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13415
13616
|
], PlatformAuthController.prototype, "refresh", null);
|
|
13416
|
-
|
|
13617
|
+
_ts_decorate49([
|
|
13417
13618
|
UseGuards(JwtPlatformGuard),
|
|
13418
13619
|
Throttle(AUTH_THROTTLE_CONFIGS.revokeAllSessions),
|
|
13419
13620
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.revokeAllSessions),
|
|
13420
13621
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
13421
13622
|
Delete("sessions"),
|
|
13422
13623
|
_ts_param27(0, CurrentUser()),
|
|
13423
|
-
|
|
13424
|
-
|
|
13624
|
+
_ts_metadata48("design:type", Function),
|
|
13625
|
+
_ts_metadata48("design:paramtypes", [
|
|
13425
13626
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload
|
|
13426
13627
|
]),
|
|
13427
|
-
|
|
13628
|
+
_ts_metadata48("design:returntype", Promise)
|
|
13428
13629
|
], PlatformAuthController.prototype, "revokeSessions", null);
|
|
13429
|
-
PlatformAuthController =
|
|
13630
|
+
PlatformAuthController = _ts_decorate49([
|
|
13430
13631
|
UseInterceptors(NoStoreInterceptor),
|
|
13431
13632
|
Controller("platform"),
|
|
13432
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
13633
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
13433
13634
|
UsePipes(createAuthValidationPipe()),
|
|
13434
13635
|
_ts_param27(0, Inject(PlatformAuthService)),
|
|
13435
13636
|
_ts_param27(1, Inject(MfaService)),
|
|
13436
13637
|
_ts_param27(2, Inject(TokenDeliveryService)),
|
|
13437
|
-
|
|
13438
|
-
|
|
13638
|
+
_ts_metadata48("design:type", Function),
|
|
13639
|
+
_ts_metadata48("design:paramtypes", [
|
|
13439
13640
|
typeof PlatformAuthService === "undefined" ? Object : PlatformAuthService,
|
|
13440
13641
|
typeof MfaService === "undefined" ? Object : MfaService,
|
|
13441
13642
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService
|
|
13442
13643
|
])
|
|
13443
13644
|
], PlatformAuthController);
|
|
13444
|
-
function
|
|
13645
|
+
function _ts_decorate50(decorators, target, key, desc) {
|
|
13445
13646
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
13446
13647
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
13447
13648
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13454,13 +13655,13 @@ function _ts_decorate49(decorators, target, key, desc) {
|
|
|
13454
13655
|
}
|
|
13455
13656
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13456
13657
|
}
|
|
13457
|
-
__name(
|
|
13458
|
-
function
|
|
13658
|
+
__name(_ts_decorate50, "_ts_decorate");
|
|
13659
|
+
function _ts_metadata49(metadataKey, metadataValue) {
|
|
13459
13660
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
13460
13661
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
13461
13662
|
}
|
|
13462
13663
|
}
|
|
13463
|
-
__name(
|
|
13664
|
+
__name(_ts_metadata49, "_ts_metadata");
|
|
13464
13665
|
function _ts_param28(paramIndex, decorator) {
|
|
13465
13666
|
return function(target, key) {
|
|
13466
13667
|
decorator(target, key, paramIndex);
|
|
@@ -13545,21 +13746,22 @@ var PlatformMfaController = class {
|
|
|
13545
13746
|
return this.mfaService.regenerateRecoveryCodes(user.sub, dto.code, ip, userAgent, "platform");
|
|
13546
13747
|
}
|
|
13547
13748
|
};
|
|
13548
|
-
|
|
13749
|
+
_ts_decorate50([
|
|
13549
13750
|
UseGuards(JwtPlatformGuard),
|
|
13550
13751
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaSetup),
|
|
13551
13752
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaSetup),
|
|
13753
|
+
RequestEncoding("when-body"),
|
|
13552
13754
|
Post("setup"),
|
|
13553
13755
|
_ts_param28(0, CurrentUser()),
|
|
13554
13756
|
_ts_param28(1, Body()),
|
|
13555
|
-
|
|
13556
|
-
|
|
13757
|
+
_ts_metadata49("design:type", Function),
|
|
13758
|
+
_ts_metadata49("design:paramtypes", [
|
|
13557
13759
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload,
|
|
13558
13760
|
typeof MfaSetupDto === "undefined" ? Object : MfaSetupDto
|
|
13559
13761
|
]),
|
|
13560
|
-
|
|
13762
|
+
_ts_metadata49("design:returntype", Promise)
|
|
13561
13763
|
], PlatformMfaController.prototype, "setup", null);
|
|
13562
|
-
|
|
13764
|
+
_ts_decorate50([
|
|
13563
13765
|
UseGuards(JwtPlatformGuard),
|
|
13564
13766
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaVerifyEnable),
|
|
13565
13767
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaVerifyEnable),
|
|
@@ -13568,15 +13770,15 @@ _ts_decorate49([
|
|
|
13568
13770
|
_ts_param28(0, CurrentUser()),
|
|
13569
13771
|
_ts_param28(1, Body()),
|
|
13570
13772
|
_ts_param28(2, Req()),
|
|
13571
|
-
|
|
13572
|
-
|
|
13773
|
+
_ts_metadata49("design:type", Function),
|
|
13774
|
+
_ts_metadata49("design:paramtypes", [
|
|
13573
13775
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload,
|
|
13574
13776
|
typeof MfaVerifyDto === "undefined" ? Object : MfaVerifyDto,
|
|
13575
13777
|
typeof Request === "undefined" ? Object : Request
|
|
13576
13778
|
]),
|
|
13577
|
-
|
|
13779
|
+
_ts_metadata49("design:returntype", Promise)
|
|
13578
13780
|
], PlatformMfaController.prototype, "verifyEnable", null);
|
|
13579
|
-
|
|
13781
|
+
_ts_decorate50([
|
|
13580
13782
|
UseGuards(JwtPlatformGuard),
|
|
13581
13783
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
13582
13784
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
@@ -13585,15 +13787,15 @@ _ts_decorate49([
|
|
|
13585
13787
|
_ts_param28(0, CurrentUser()),
|
|
13586
13788
|
_ts_param28(1, Body()),
|
|
13587
13789
|
_ts_param28(2, Req()),
|
|
13588
|
-
|
|
13589
|
-
|
|
13790
|
+
_ts_metadata49("design:type", Function),
|
|
13791
|
+
_ts_metadata49("design:paramtypes", [
|
|
13590
13792
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload,
|
|
13591
13793
|
typeof MfaDisableDto === "undefined" ? Object : MfaDisableDto,
|
|
13592
13794
|
typeof Request === "undefined" ? Object : Request
|
|
13593
13795
|
]),
|
|
13594
|
-
|
|
13796
|
+
_ts_metadata49("design:returntype", Promise)
|
|
13595
13797
|
], PlatformMfaController.prototype, "disable", null);
|
|
13596
|
-
|
|
13798
|
+
_ts_decorate50([
|
|
13597
13799
|
UseGuards(JwtPlatformGuard),
|
|
13598
13800
|
Throttle(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
13599
13801
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.mfaDisable),
|
|
@@ -13602,28 +13804,28 @@ _ts_decorate49([
|
|
|
13602
13804
|
_ts_param28(0, CurrentUser()),
|
|
13603
13805
|
_ts_param28(1, Body()),
|
|
13604
13806
|
_ts_param28(2, Req()),
|
|
13605
|
-
|
|
13606
|
-
|
|
13807
|
+
_ts_metadata49("design:type", Function),
|
|
13808
|
+
_ts_metadata49("design:paramtypes", [
|
|
13607
13809
|
typeof PlatformJwtPayload === "undefined" ? Object : PlatformJwtPayload,
|
|
13608
13810
|
typeof MfaRegenerateRecoveryCodesDto === "undefined" ? Object : MfaRegenerateRecoveryCodesDto,
|
|
13609
13811
|
typeof Request === "undefined" ? Object : Request
|
|
13610
13812
|
]),
|
|
13611
|
-
|
|
13813
|
+
_ts_metadata49("design:returntype", Promise)
|
|
13612
13814
|
], PlatformMfaController.prototype, "regenerateRecoveryCodes", null);
|
|
13613
|
-
PlatformMfaController =
|
|
13815
|
+
PlatformMfaController = _ts_decorate50([
|
|
13614
13816
|
UseInterceptors(NoStoreInterceptor),
|
|
13615
13817
|
Controller("platform/mfa"),
|
|
13616
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
13818
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
13617
13819
|
UsePipes(createAuthValidationPipe({
|
|
13618
13820
|
forbidUnknownValues: true
|
|
13619
13821
|
})),
|
|
13620
13822
|
_ts_param28(0, Inject(MfaService)),
|
|
13621
|
-
|
|
13622
|
-
|
|
13823
|
+
_ts_metadata49("design:type", Function),
|
|
13824
|
+
_ts_metadata49("design:paramtypes", [
|
|
13623
13825
|
typeof MfaService === "undefined" ? Object : MfaService
|
|
13624
13826
|
])
|
|
13625
13827
|
], PlatformMfaController);
|
|
13626
|
-
function
|
|
13828
|
+
function _ts_decorate51(decorators, target, key, desc) {
|
|
13627
13829
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
13628
13830
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
13629
13831
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13636,13 +13838,13 @@ function _ts_decorate50(decorators, target, key, desc) {
|
|
|
13636
13838
|
}
|
|
13637
13839
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13638
13840
|
}
|
|
13639
|
-
__name(
|
|
13640
|
-
function
|
|
13841
|
+
__name(_ts_decorate51, "_ts_decorate");
|
|
13842
|
+
function _ts_metadata50(metadataKey, metadataValue) {
|
|
13641
13843
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
13642
13844
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
13643
13845
|
}
|
|
13644
13846
|
}
|
|
13645
|
-
__name(
|
|
13847
|
+
__name(_ts_metadata50, "_ts_metadata");
|
|
13646
13848
|
function _ts_param29(paramIndex, decorator) {
|
|
13647
13849
|
return function(target, key) {
|
|
13648
13850
|
decorator(target, key, paramIndex);
|
|
@@ -13748,63 +13950,64 @@ var SessionController = class {
|
|
|
13748
13950
|
});
|
|
13749
13951
|
}
|
|
13750
13952
|
};
|
|
13751
|
-
|
|
13953
|
+
_ts_decorate51([
|
|
13752
13954
|
Throttle(AUTH_THROTTLE_CONFIGS.listSessions),
|
|
13753
13955
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.listSessions),
|
|
13754
13956
|
Get(),
|
|
13755
13957
|
_ts_param29(0, CurrentUser()),
|
|
13756
13958
|
_ts_param29(1, Req()),
|
|
13757
|
-
|
|
13758
|
-
|
|
13959
|
+
_ts_metadata50("design:type", Function),
|
|
13960
|
+
_ts_metadata50("design:paramtypes", [
|
|
13759
13961
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
13760
13962
|
typeof Request === "undefined" ? Object : Request
|
|
13761
13963
|
]),
|
|
13762
|
-
|
|
13964
|
+
_ts_metadata50("design:returntype", Promise)
|
|
13763
13965
|
], SessionController.prototype, "listSessions", null);
|
|
13764
|
-
|
|
13966
|
+
_ts_decorate51([
|
|
13765
13967
|
Throttle(AUTH_THROTTLE_CONFIGS.revokeAllSessions),
|
|
13766
13968
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.revokeAllSessions),
|
|
13767
13969
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
13970
|
+
RequestEncoding("unchecked"),
|
|
13768
13971
|
Post("revoke-all"),
|
|
13769
13972
|
_ts_param29(0, CurrentUser()),
|
|
13770
13973
|
_ts_param29(1, Req()),
|
|
13771
|
-
|
|
13772
|
-
|
|
13974
|
+
_ts_metadata50("design:type", Function),
|
|
13975
|
+
_ts_metadata50("design:paramtypes", [
|
|
13773
13976
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
13774
13977
|
typeof Request === "undefined" ? Object : Request
|
|
13775
13978
|
]),
|
|
13776
|
-
|
|
13979
|
+
_ts_metadata50("design:returntype", Promise)
|
|
13777
13980
|
], SessionController.prototype, "revokeAllSessions", null);
|
|
13778
|
-
|
|
13981
|
+
_ts_decorate51([
|
|
13779
13982
|
Throttle(AUTH_THROTTLE_CONFIGS.revokeSession),
|
|
13780
13983
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.revokeSession),
|
|
13781
13984
|
HttpCode(HttpStatus.NO_CONTENT),
|
|
13782
13985
|
Delete(":id"),
|
|
13783
13986
|
_ts_param29(0, CurrentUser()),
|
|
13784
13987
|
_ts_param29(1, Param("id")),
|
|
13785
|
-
|
|
13786
|
-
|
|
13988
|
+
_ts_metadata50("design:type", Function),
|
|
13989
|
+
_ts_metadata50("design:paramtypes", [
|
|
13787
13990
|
typeof DashboardJwtPayload === "undefined" ? Object : DashboardJwtPayload,
|
|
13788
13991
|
String
|
|
13789
13992
|
]),
|
|
13790
|
-
|
|
13993
|
+
_ts_metadata50("design:returntype", Promise)
|
|
13791
13994
|
], SessionController.prototype, "revokeSession", null);
|
|
13792
|
-
SessionController =
|
|
13995
|
+
SessionController = _ts_decorate51([
|
|
13793
13996
|
UseInterceptors(NoStoreInterceptor),
|
|
13794
13997
|
Controller("sessions"),
|
|
13795
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard, JwtAuthGuard, UserStatusGuard),
|
|
13998
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard, JwtAuthGuard, UserStatusGuard),
|
|
13796
13999
|
UsePipes(createAuthValidationPipe()),
|
|
13797
14000
|
_ts_param29(0, Inject(SessionService)),
|
|
13798
14001
|
_ts_param29(1, Inject(TokenDeliveryService)),
|
|
13799
|
-
|
|
13800
|
-
|
|
14002
|
+
_ts_metadata50("design:type", Function),
|
|
14003
|
+
_ts_metadata50("design:paramtypes", [
|
|
13801
14004
|
typeof SessionService === "undefined" ? Object : SessionService,
|
|
13802
14005
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService
|
|
13803
14006
|
])
|
|
13804
14007
|
], SessionController);
|
|
13805
14008
|
var API_KEY_SCOPES_KEY = /* @__PURE__ */ Symbol("bymax:apiKeyScopes");
|
|
13806
14009
|
var ApiKeyScopes = /* @__PURE__ */ __name((...scopes) => SetMetadata(API_KEY_SCOPES_KEY, scopes), "ApiKeyScopes");
|
|
13807
|
-
function
|
|
14010
|
+
function _ts_decorate52(decorators, target, key, desc) {
|
|
13808
14011
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
13809
14012
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
13810
14013
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13817,13 +14020,13 @@ function _ts_decorate51(decorators, target, key, desc) {
|
|
|
13817
14020
|
}
|
|
13818
14021
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13819
14022
|
}
|
|
13820
|
-
__name(
|
|
13821
|
-
function
|
|
14023
|
+
__name(_ts_decorate52, "_ts_decorate");
|
|
14024
|
+
function _ts_metadata51(metadataKey, metadataValue) {
|
|
13822
14025
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
13823
14026
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
13824
14027
|
}
|
|
13825
14028
|
}
|
|
13826
|
-
__name(
|
|
14029
|
+
__name(_ts_metadata51, "_ts_metadata");
|
|
13827
14030
|
function _ts_param30(paramIndex, decorator) {
|
|
13828
14031
|
return function(target, key) {
|
|
13829
14032
|
decorator(target, key, paramIndex);
|
|
@@ -13890,12 +14093,12 @@ var ApiKeyLastUsedService = class _ApiKeyLastUsedService {
|
|
|
13890
14093
|
await this.flush();
|
|
13891
14094
|
}
|
|
13892
14095
|
};
|
|
13893
|
-
ApiKeyLastUsedService =
|
|
14096
|
+
ApiKeyLastUsedService = _ts_decorate52([
|
|
13894
14097
|
Injectable(),
|
|
13895
14098
|
_ts_param30(0, Inject(BYMAX_AUTH_API_KEY_REPOSITORY)),
|
|
13896
14099
|
_ts_param30(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
13897
|
-
|
|
13898
|
-
|
|
14100
|
+
_ts_metadata51("design:type", Function),
|
|
14101
|
+
_ts_metadata51("design:paramtypes", [
|
|
13899
14102
|
typeof IApiKeyRepository === "undefined" ? Object : IApiKeyRepository,
|
|
13900
14103
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
13901
14104
|
])
|
|
@@ -13944,7 +14147,7 @@ function digestsMatch(computed, stored) {
|
|
|
13944
14147
|
__name(digestsMatch, "digestsMatch");
|
|
13945
14148
|
|
|
13946
14149
|
// src/server/services/api-key-verifier.service.ts
|
|
13947
|
-
function
|
|
14150
|
+
function _ts_decorate53(decorators, target, key, desc) {
|
|
13948
14151
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
13949
14152
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
13950
14153
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -13957,13 +14160,13 @@ function _ts_decorate52(decorators, target, key, desc) {
|
|
|
13957
14160
|
}
|
|
13958
14161
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13959
14162
|
}
|
|
13960
|
-
__name(
|
|
13961
|
-
function
|
|
14163
|
+
__name(_ts_decorate53, "_ts_decorate");
|
|
14164
|
+
function _ts_metadata52(metadataKey, metadataValue) {
|
|
13962
14165
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
13963
14166
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
13964
14167
|
}
|
|
13965
14168
|
}
|
|
13966
|
-
__name(
|
|
14169
|
+
__name(_ts_metadata52, "_ts_metadata");
|
|
13967
14170
|
function _ts_param31(paramIndex, decorator) {
|
|
13968
14171
|
return function(target, key) {
|
|
13969
14172
|
decorator(target, key, paramIndex);
|
|
@@ -14029,14 +14232,14 @@ var ApiKeyVerifierService = class {
|
|
|
14029
14232
|
return null;
|
|
14030
14233
|
}
|
|
14031
14234
|
};
|
|
14032
|
-
ApiKeyVerifierService =
|
|
14235
|
+
ApiKeyVerifierService = _ts_decorate53([
|
|
14033
14236
|
Injectable(),
|
|
14034
14237
|
_ts_param31(0, Inject(BYMAX_AUTH_API_KEY_REPOSITORY)),
|
|
14035
14238
|
_ts_param31(1, Inject(BYMAX_AUTH_API_KEY_CLOCK)),
|
|
14036
14239
|
_ts_param31(2, Inject(BYMAX_AUTH_OPTIONS)),
|
|
14037
14240
|
_ts_param31(3, Inject(ApiKeyLastUsedService)),
|
|
14038
|
-
|
|
14039
|
-
|
|
14241
|
+
_ts_metadata52("design:type", Function),
|
|
14242
|
+
_ts_metadata52("design:paramtypes", [
|
|
14040
14243
|
typeof IApiKeyRepository === "undefined" ? Object : IApiKeyRepository,
|
|
14041
14244
|
typeof ApiKeyClock === "undefined" ? Object : ApiKeyClock,
|
|
14042
14245
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
@@ -14045,7 +14248,7 @@ ApiKeyVerifierService = _ts_decorate52([
|
|
|
14045
14248
|
], ApiKeyVerifierService);
|
|
14046
14249
|
|
|
14047
14250
|
// src/server/guards/api-key.guard.ts
|
|
14048
|
-
function
|
|
14251
|
+
function _ts_decorate54(decorators, target, key, desc) {
|
|
14049
14252
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14050
14253
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14051
14254
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14058,13 +14261,13 @@ function _ts_decorate53(decorators, target, key, desc) {
|
|
|
14058
14261
|
}
|
|
14059
14262
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14060
14263
|
}
|
|
14061
|
-
__name(
|
|
14062
|
-
function
|
|
14264
|
+
__name(_ts_decorate54, "_ts_decorate");
|
|
14265
|
+
function _ts_metadata53(metadataKey, metadataValue) {
|
|
14063
14266
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14064
14267
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14065
14268
|
}
|
|
14066
14269
|
}
|
|
14067
|
-
__name(
|
|
14270
|
+
__name(_ts_metadata53, "_ts_metadata");
|
|
14068
14271
|
function _ts_param32(paramIndex, decorator) {
|
|
14069
14272
|
return function(target, key) {
|
|
14070
14273
|
decorator(target, key, paramIndex);
|
|
@@ -14210,15 +14413,15 @@ var ApiKeyGuard = class _ApiKeyGuard {
|
|
|
14210
14413
|
};
|
|
14211
14414
|
}
|
|
14212
14415
|
};
|
|
14213
|
-
ApiKeyGuard =
|
|
14416
|
+
ApiKeyGuard = _ts_decorate54([
|
|
14214
14417
|
Injectable(),
|
|
14215
14418
|
_ts_param32(0, Inject(Reflector)),
|
|
14216
14419
|
_ts_param32(1, Inject(ApiKeyVerifierService)),
|
|
14217
14420
|
_ts_param32(2, Inject(BYMAX_AUTH_OPTIONS)),
|
|
14218
14421
|
_ts_param32(3, Inject(BYMAX_AUTH_HOOKS)),
|
|
14219
14422
|
_ts_param32(3, Optional()),
|
|
14220
|
-
|
|
14221
|
-
|
|
14423
|
+
_ts_metadata53("design:type", Function),
|
|
14424
|
+
_ts_metadata53("design:paramtypes", [
|
|
14222
14425
|
typeof Reflector === "undefined" ? Object : Reflector,
|
|
14223
14426
|
typeof ApiKeyVerifierService === "undefined" ? Object : ApiKeyVerifierService,
|
|
14224
14427
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
@@ -14230,7 +14433,7 @@ function routePattern(request) {
|
|
|
14230
14433
|
return typeof path === "string" ? path : "";
|
|
14231
14434
|
}
|
|
14232
14435
|
__name(routePattern, "routePattern");
|
|
14233
|
-
function
|
|
14436
|
+
function _ts_decorate55(decorators, target, key, desc) {
|
|
14234
14437
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14235
14438
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14236
14439
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14243,13 +14446,13 @@ function _ts_decorate54(decorators, target, key, desc) {
|
|
|
14243
14446
|
}
|
|
14244
14447
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14245
14448
|
}
|
|
14246
|
-
__name(
|
|
14247
|
-
function
|
|
14449
|
+
__name(_ts_decorate55, "_ts_decorate");
|
|
14450
|
+
function _ts_metadata54(metadataKey, metadataValue) {
|
|
14248
14451
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14249
14452
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14250
14453
|
}
|
|
14251
14454
|
}
|
|
14252
|
-
__name(
|
|
14455
|
+
__name(_ts_metadata54, "_ts_metadata");
|
|
14253
14456
|
function _ts_param33(paramIndex, decorator) {
|
|
14254
14457
|
return function(target, key) {
|
|
14255
14458
|
decorator(target, key, paramIndex);
|
|
@@ -14282,11 +14485,11 @@ var MfaRequiredGuard = class {
|
|
|
14282
14485
|
return true;
|
|
14283
14486
|
}
|
|
14284
14487
|
};
|
|
14285
|
-
MfaRequiredGuard =
|
|
14488
|
+
MfaRequiredGuard = _ts_decorate55([
|
|
14286
14489
|
Injectable(),
|
|
14287
14490
|
_ts_param33(0, Inject(Reflector)),
|
|
14288
|
-
|
|
14289
|
-
|
|
14491
|
+
_ts_metadata54("design:type", Function),
|
|
14492
|
+
_ts_metadata54("design:paramtypes", [
|
|
14290
14493
|
typeof Reflector === "undefined" ? Object : Reflector
|
|
14291
14494
|
])
|
|
14292
14495
|
], MfaRequiredGuard);
|
|
@@ -14294,7 +14497,7 @@ var PLATFORM_ROLES_KEY = /* @__PURE__ */ Symbol("platformRoles");
|
|
|
14294
14497
|
var PlatformRoles = /* @__PURE__ */ __name((...roles) => SetMetadata(PLATFORM_ROLES_KEY, roles), "PlatformRoles");
|
|
14295
14498
|
|
|
14296
14499
|
// src/server/guards/platform-roles.guard.ts
|
|
14297
|
-
function
|
|
14500
|
+
function _ts_decorate56(decorators, target, key, desc) {
|
|
14298
14501
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14299
14502
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14300
14503
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14307,13 +14510,13 @@ function _ts_decorate55(decorators, target, key, desc) {
|
|
|
14307
14510
|
}
|
|
14308
14511
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14309
14512
|
}
|
|
14310
|
-
__name(
|
|
14311
|
-
function
|
|
14513
|
+
__name(_ts_decorate56, "_ts_decorate");
|
|
14514
|
+
function _ts_metadata55(metadataKey, metadataValue) {
|
|
14312
14515
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14313
14516
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14314
14517
|
}
|
|
14315
14518
|
}
|
|
14316
|
-
__name(
|
|
14519
|
+
__name(_ts_metadata55, "_ts_metadata");
|
|
14317
14520
|
function _ts_param34(paramIndex, decorator) {
|
|
14318
14521
|
return function(target, key) {
|
|
14319
14522
|
decorator(target, key, paramIndex);
|
|
@@ -14353,12 +14556,12 @@ var PlatformRolesGuard = class {
|
|
|
14353
14556
|
return true;
|
|
14354
14557
|
}
|
|
14355
14558
|
};
|
|
14356
|
-
PlatformRolesGuard =
|
|
14559
|
+
PlatformRolesGuard = _ts_decorate56([
|
|
14357
14560
|
Injectable(),
|
|
14358
14561
|
_ts_param34(0, Inject(Reflector)),
|
|
14359
14562
|
_ts_param34(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
14360
|
-
|
|
14361
|
-
|
|
14563
|
+
_ts_metadata55("design:type", Function),
|
|
14564
|
+
_ts_metadata55("design:paramtypes", [
|
|
14362
14565
|
typeof Reflector === "undefined" ? Object : Reflector,
|
|
14363
14566
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
14364
14567
|
])
|
|
@@ -14367,7 +14570,7 @@ var ROLES_KEY = "roles";
|
|
|
14367
14570
|
var Roles = /* @__PURE__ */ __name((...roles) => SetMetadata(ROLES_KEY, roles), "Roles");
|
|
14368
14571
|
|
|
14369
14572
|
// src/server/guards/roles.guard.ts
|
|
14370
|
-
function
|
|
14573
|
+
function _ts_decorate57(decorators, target, key, desc) {
|
|
14371
14574
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14372
14575
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14373
14576
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14380,13 +14583,13 @@ function _ts_decorate56(decorators, target, key, desc) {
|
|
|
14380
14583
|
}
|
|
14381
14584
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14382
14585
|
}
|
|
14383
|
-
__name(
|
|
14384
|
-
function
|
|
14586
|
+
__name(_ts_decorate57, "_ts_decorate");
|
|
14587
|
+
function _ts_metadata56(metadataKey, metadataValue) {
|
|
14385
14588
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14386
14589
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14387
14590
|
}
|
|
14388
14591
|
}
|
|
14389
|
-
__name(
|
|
14592
|
+
__name(_ts_metadata56, "_ts_metadata");
|
|
14390
14593
|
function _ts_param35(paramIndex, decorator) {
|
|
14391
14594
|
return function(target, key) {
|
|
14392
14595
|
decorator(target, key, paramIndex);
|
|
@@ -14422,17 +14625,17 @@ var RolesGuard = class {
|
|
|
14422
14625
|
return true;
|
|
14423
14626
|
}
|
|
14424
14627
|
};
|
|
14425
|
-
RolesGuard =
|
|
14628
|
+
RolesGuard = _ts_decorate57([
|
|
14426
14629
|
Injectable(),
|
|
14427
14630
|
_ts_param35(0, Inject(Reflector)),
|
|
14428
14631
|
_ts_param35(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
14429
|
-
|
|
14430
|
-
|
|
14632
|
+
_ts_metadata56("design:type", Function),
|
|
14633
|
+
_ts_metadata56("design:paramtypes", [
|
|
14431
14634
|
typeof Reflector === "undefined" ? Object : Reflector,
|
|
14432
14635
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
14433
14636
|
])
|
|
14434
14637
|
], RolesGuard);
|
|
14435
|
-
function
|
|
14638
|
+
function _ts_decorate58(decorators, target, key, desc) {
|
|
14436
14639
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14437
14640
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14438
14641
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14445,7 +14648,7 @@ function _ts_decorate57(decorators, target, key, desc) {
|
|
|
14445
14648
|
}
|
|
14446
14649
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14447
14650
|
}
|
|
14448
|
-
__name(
|
|
14651
|
+
__name(_ts_decorate58, "_ts_decorate");
|
|
14449
14652
|
var NoOpAuthHooks = class {
|
|
14450
14653
|
static {
|
|
14451
14654
|
__name(this, "NoOpAuthHooks");
|
|
@@ -14494,7 +14697,7 @@ var NoOpAuthHooks = class {
|
|
|
14494
14697
|
};
|
|
14495
14698
|
}
|
|
14496
14699
|
};
|
|
14497
|
-
NoOpAuthHooks =
|
|
14700
|
+
NoOpAuthHooks = _ts_decorate58([
|
|
14498
14701
|
Injectable()
|
|
14499
14702
|
], NoOpAuthHooks);
|
|
14500
14703
|
|
|
@@ -14507,7 +14710,7 @@ var OAUTH_STATE_COOKIE_SAME_SITE = "lax";
|
|
|
14507
14710
|
var OAUTH_STATE_COOKIE_MAX_AGE_SECONDS = 600;
|
|
14508
14711
|
|
|
14509
14712
|
// src/server/oauth/oauth.service.ts
|
|
14510
|
-
function
|
|
14713
|
+
function _ts_decorate59(decorators, target, key, desc) {
|
|
14511
14714
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14512
14715
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14513
14716
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14520,13 +14723,13 @@ function _ts_decorate58(decorators, target, key, desc) {
|
|
|
14520
14723
|
}
|
|
14521
14724
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14522
14725
|
}
|
|
14523
|
-
__name(
|
|
14524
|
-
function
|
|
14726
|
+
__name(_ts_decorate59, "_ts_decorate");
|
|
14727
|
+
function _ts_metadata57(metadataKey, metadataValue) {
|
|
14525
14728
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14526
14729
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14527
14730
|
}
|
|
14528
14731
|
}
|
|
14529
|
-
__name(
|
|
14732
|
+
__name(_ts_metadata57, "_ts_metadata");
|
|
14530
14733
|
function _ts_param36(paramIndex, decorator) {
|
|
14531
14734
|
return function(target, key) {
|
|
14532
14735
|
decorator(target, key, paramIndex);
|
|
@@ -14826,7 +15029,7 @@ var OAuthService = class _OAuthService {
|
|
|
14826
15029
|
return plugin;
|
|
14827
15030
|
}
|
|
14828
15031
|
};
|
|
14829
|
-
OAuthService =
|
|
15032
|
+
OAuthService = _ts_decorate59([
|
|
14830
15033
|
Injectable(),
|
|
14831
15034
|
_ts_param36(0, Inject(OAUTH_PLUGINS)),
|
|
14832
15035
|
_ts_param36(1, Inject(BYMAX_AUTH_USER_REPOSITORY)),
|
|
@@ -14836,8 +15039,8 @@ OAuthService = _ts_decorate58([
|
|
|
14836
15039
|
_ts_param36(4, Inject(TokenManagerService)),
|
|
14837
15040
|
_ts_param36(5, Inject(SessionService)),
|
|
14838
15041
|
_ts_param36(6, Inject(BYMAX_AUTH_OPTIONS)),
|
|
14839
|
-
|
|
14840
|
-
|
|
15042
|
+
_ts_metadata57("design:type", Function),
|
|
15043
|
+
_ts_metadata57("design:paramtypes", [
|
|
14841
15044
|
Array,
|
|
14842
15045
|
typeof IUserRepository === "undefined" ? Object : IUserRepository,
|
|
14843
15046
|
Object,
|
|
@@ -14847,7 +15050,7 @@ OAuthService = _ts_decorate58([
|
|
|
14847
15050
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
14848
15051
|
])
|
|
14849
15052
|
], OAuthService);
|
|
14850
|
-
function
|
|
15053
|
+
function _ts_decorate60(decorators, target, key, desc) {
|
|
14851
15054
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14852
15055
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
14853
15056
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14860,13 +15063,13 @@ function _ts_decorate59(decorators, target, key, desc) {
|
|
|
14860
15063
|
}
|
|
14861
15064
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14862
15065
|
}
|
|
14863
|
-
__name(
|
|
14864
|
-
function
|
|
15066
|
+
__name(_ts_decorate60, "_ts_decorate");
|
|
15067
|
+
function _ts_metadata58(metadataKey, metadataValue) {
|
|
14865
15068
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
14866
15069
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
14867
15070
|
}
|
|
14868
15071
|
}
|
|
14869
|
-
__name(
|
|
15072
|
+
__name(_ts_metadata58, "_ts_metadata");
|
|
14870
15073
|
var OAuthCallbackQueryDto = class {
|
|
14871
15074
|
static {
|
|
14872
15075
|
__name(this, "OAuthCallbackQueryDto");
|
|
@@ -14965,69 +15168,69 @@ var OAuthCallbackQueryDto = class {
|
|
|
14965
15168
|
*/
|
|
14966
15169
|
hd;
|
|
14967
15170
|
};
|
|
14968
|
-
|
|
15171
|
+
_ts_decorate60([
|
|
14969
15172
|
ValidateIf((query) => query.error === void 0 || query.error === null),
|
|
14970
15173
|
IsOptional(),
|
|
14971
15174
|
IsString(),
|
|
14972
15175
|
IsNotEmpty(),
|
|
14973
15176
|
MaxLength(2048),
|
|
14974
|
-
|
|
15177
|
+
_ts_metadata58("design:type", String)
|
|
14975
15178
|
], OAuthCallbackQueryDto.prototype, "code", void 0);
|
|
14976
|
-
|
|
15179
|
+
_ts_decorate60([
|
|
14977
15180
|
IsOptional(),
|
|
14978
15181
|
IsString(),
|
|
14979
15182
|
MaxLength(128),
|
|
14980
|
-
|
|
15183
|
+
_ts_metadata58("design:type", String)
|
|
14981
15184
|
], OAuthCallbackQueryDto.prototype, "error", void 0);
|
|
14982
|
-
|
|
15185
|
+
_ts_decorate60([
|
|
14983
15186
|
IsOptional(),
|
|
14984
15187
|
IsString(),
|
|
14985
15188
|
MaxLength(512),
|
|
14986
|
-
|
|
15189
|
+
_ts_metadata58("design:type", String)
|
|
14987
15190
|
], OAuthCallbackQueryDto.prototype, "error_description", void 0);
|
|
14988
|
-
|
|
15191
|
+
_ts_decorate60([
|
|
14989
15192
|
IsOptional(),
|
|
14990
15193
|
IsString(),
|
|
14991
15194
|
MaxLength(512),
|
|
14992
|
-
|
|
15195
|
+
_ts_metadata58("design:type", String)
|
|
14993
15196
|
], OAuthCallbackQueryDto.prototype, "error_uri", void 0);
|
|
14994
|
-
|
|
15197
|
+
_ts_decorate60([
|
|
14995
15198
|
IsString(),
|
|
14996
15199
|
IsNotEmpty(),
|
|
14997
15200
|
MaxLength(128),
|
|
14998
|
-
|
|
15201
|
+
_ts_metadata58("design:type", String)
|
|
14999
15202
|
], OAuthCallbackQueryDto.prototype, "state", void 0);
|
|
15000
|
-
|
|
15203
|
+
_ts_decorate60([
|
|
15001
15204
|
IsOptional(),
|
|
15002
15205
|
IsString(),
|
|
15003
15206
|
MaxLength(512),
|
|
15004
|
-
|
|
15207
|
+
_ts_metadata58("design:type", String)
|
|
15005
15208
|
], OAuthCallbackQueryDto.prototype, "iss", void 0);
|
|
15006
|
-
|
|
15209
|
+
_ts_decorate60([
|
|
15007
15210
|
IsOptional(),
|
|
15008
15211
|
IsString(),
|
|
15009
15212
|
MaxLength(2048),
|
|
15010
|
-
|
|
15213
|
+
_ts_metadata58("design:type", String)
|
|
15011
15214
|
], OAuthCallbackQueryDto.prototype, "scope", void 0);
|
|
15012
|
-
|
|
15215
|
+
_ts_decorate60([
|
|
15013
15216
|
IsOptional(),
|
|
15014
15217
|
IsString(),
|
|
15015
15218
|
MaxLength(16),
|
|
15016
|
-
|
|
15219
|
+
_ts_metadata58("design:type", String)
|
|
15017
15220
|
], OAuthCallbackQueryDto.prototype, "authuser", void 0);
|
|
15018
|
-
|
|
15221
|
+
_ts_decorate60([
|
|
15019
15222
|
IsOptional(),
|
|
15020
15223
|
IsString(),
|
|
15021
15224
|
MaxLength(64),
|
|
15022
|
-
|
|
15225
|
+
_ts_metadata58("design:type", String)
|
|
15023
15226
|
], OAuthCallbackQueryDto.prototype, "prompt", void 0);
|
|
15024
|
-
|
|
15227
|
+
_ts_decorate60([
|
|
15025
15228
|
IsOptional(),
|
|
15026
15229
|
IsString(),
|
|
15027
15230
|
MaxLength(253),
|
|
15028
|
-
|
|
15231
|
+
_ts_metadata58("design:type", String)
|
|
15029
15232
|
], OAuthCallbackQueryDto.prototype, "hd", void 0);
|
|
15030
|
-
function
|
|
15233
|
+
function _ts_decorate61(decorators, target, key, desc) {
|
|
15031
15234
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15032
15235
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
15033
15236
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -15040,13 +15243,13 @@ function _ts_decorate60(decorators, target, key, desc) {
|
|
|
15040
15243
|
}
|
|
15041
15244
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15042
15245
|
}
|
|
15043
|
-
__name(
|
|
15044
|
-
function
|
|
15246
|
+
__name(_ts_decorate61, "_ts_decorate");
|
|
15247
|
+
function _ts_metadata59(metadataKey, metadataValue) {
|
|
15045
15248
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
15046
15249
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
15047
15250
|
}
|
|
15048
15251
|
}
|
|
15049
|
-
__name(
|
|
15252
|
+
__name(_ts_metadata59, "_ts_metadata");
|
|
15050
15253
|
var OAuthInitiateQueryDto = class {
|
|
15051
15254
|
static {
|
|
15052
15255
|
__name(this, "OAuthInitiateQueryDto");
|
|
@@ -15063,7 +15266,7 @@ var OAuthInitiateQueryDto = class {
|
|
|
15063
15266
|
*/
|
|
15064
15267
|
tenantId;
|
|
15065
15268
|
};
|
|
15066
|
-
|
|
15269
|
+
_ts_decorate61([
|
|
15067
15270
|
IsOptional(),
|
|
15068
15271
|
IsString(),
|
|
15069
15272
|
IsNotEmpty(),
|
|
@@ -15071,11 +15274,11 @@ _ts_decorate60([
|
|
|
15071
15274
|
Matches(NO_CONTROL_CHARACTERS, {
|
|
15072
15275
|
message: "tenantId must not contain control characters"
|
|
15073
15276
|
}),
|
|
15074
|
-
|
|
15277
|
+
_ts_metadata59("design:type", String)
|
|
15075
15278
|
], OAuthInitiateQueryDto.prototype, "tenantId", void 0);
|
|
15076
15279
|
|
|
15077
15280
|
// src/server/oauth/oauth.controller.ts
|
|
15078
|
-
function
|
|
15281
|
+
function _ts_decorate62(decorators, target, key, desc) {
|
|
15079
15282
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15080
15283
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
15081
15284
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -15088,13 +15291,13 @@ function _ts_decorate61(decorators, target, key, desc) {
|
|
|
15088
15291
|
}
|
|
15089
15292
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15090
15293
|
}
|
|
15091
|
-
__name(
|
|
15092
|
-
function
|
|
15294
|
+
__name(_ts_decorate62, "_ts_decorate");
|
|
15295
|
+
function _ts_metadata60(metadataKey, metadataValue) {
|
|
15093
15296
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
15094
15297
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
15095
15298
|
}
|
|
15096
15299
|
}
|
|
15097
|
-
__name(
|
|
15300
|
+
__name(_ts_metadata60, "_ts_metadata");
|
|
15098
15301
|
function _ts_param37(paramIndex, decorator) {
|
|
15099
15302
|
return function(target, key) {
|
|
15100
15303
|
decorator(target, key, paramIndex);
|
|
@@ -15318,7 +15521,7 @@ var OAuthController = class _OAuthController {
|
|
|
15318
15521
|
});
|
|
15319
15522
|
}
|
|
15320
15523
|
};
|
|
15321
|
-
|
|
15524
|
+
_ts_decorate62([
|
|
15322
15525
|
Throttle(AUTH_THROTTLE_CONFIGS.oauthInitiate),
|
|
15323
15526
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.oauthInitiate),
|
|
15324
15527
|
Get(":provider"),
|
|
@@ -15328,16 +15531,16 @@ _ts_decorate61([
|
|
|
15328
15531
|
_ts_param37(3, Res({
|
|
15329
15532
|
passthrough: true
|
|
15330
15533
|
})),
|
|
15331
|
-
|
|
15332
|
-
|
|
15534
|
+
_ts_metadata60("design:type", Function),
|
|
15535
|
+
_ts_metadata60("design:paramtypes", [
|
|
15333
15536
|
String,
|
|
15334
15537
|
typeof OAuthInitiateQueryDto === "undefined" ? Object : OAuthInitiateQueryDto,
|
|
15335
15538
|
typeof Request === "undefined" ? Object : Request,
|
|
15336
15539
|
typeof Response === "undefined" ? Object : Response
|
|
15337
15540
|
]),
|
|
15338
|
-
|
|
15541
|
+
_ts_metadata60("design:returntype", Promise)
|
|
15339
15542
|
], OAuthController.prototype, "initiate", null);
|
|
15340
|
-
|
|
15543
|
+
_ts_decorate62([
|
|
15341
15544
|
Throttle(AUTH_THROTTLE_CONFIGS.oauthCallback),
|
|
15342
15545
|
AuthRateLimit(AUTH_THROTTLE_CONFIGS.oauthCallback),
|
|
15343
15546
|
HttpCode(HttpStatus.OK),
|
|
@@ -15348,29 +15551,29 @@ _ts_decorate61([
|
|
|
15348
15551
|
_ts_param37(3, Res({
|
|
15349
15552
|
passthrough: true
|
|
15350
15553
|
})),
|
|
15351
|
-
|
|
15352
|
-
|
|
15554
|
+
_ts_metadata60("design:type", Function),
|
|
15555
|
+
_ts_metadata60("design:paramtypes", [
|
|
15353
15556
|
String,
|
|
15354
15557
|
typeof OAuthCallbackQueryDto === "undefined" ? Object : OAuthCallbackQueryDto,
|
|
15355
15558
|
typeof Request === "undefined" ? Object : Request,
|
|
15356
15559
|
typeof Response === "undefined" ? Object : Response
|
|
15357
15560
|
]),
|
|
15358
|
-
|
|
15561
|
+
_ts_metadata60("design:returntype", Promise)
|
|
15359
15562
|
], OAuthController.prototype, "callback", null);
|
|
15360
|
-
OAuthController =
|
|
15563
|
+
OAuthController = _ts_decorate62([
|
|
15361
15564
|
Public(),
|
|
15362
15565
|
SkipMfa(),
|
|
15363
15566
|
UseInterceptors(NoStoreInterceptor),
|
|
15364
15567
|
Controller("oauth"),
|
|
15365
|
-
UseGuards(TrustedOriginGuard, AuthRateLimitGuard),
|
|
15568
|
+
UseGuards(RequestEncodingGuard, TrustedOriginGuard, AuthRateLimitGuard),
|
|
15366
15569
|
UsePipes(createAuthValidationPipe({
|
|
15367
15570
|
forbidUnknownValues: true
|
|
15368
15571
|
})),
|
|
15369
15572
|
_ts_param37(0, Inject(OAuthService)),
|
|
15370
15573
|
_ts_param37(1, Inject(TokenDeliveryService)),
|
|
15371
15574
|
_ts_param37(2, Inject(BYMAX_AUTH_OPTIONS)),
|
|
15372
|
-
|
|
15373
|
-
|
|
15575
|
+
_ts_metadata60("design:type", Function),
|
|
15576
|
+
_ts_metadata60("design:paramtypes", [
|
|
15374
15577
|
typeof OAuthService === "undefined" ? Object : OAuthService,
|
|
15375
15578
|
typeof TokenDeliveryService === "undefined" ? Object : TokenDeliveryService,
|
|
15376
15579
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
@@ -15509,7 +15712,7 @@ var GoogleOAuthPlugin = class {
|
|
|
15509
15712
|
};
|
|
15510
15713
|
|
|
15511
15714
|
// src/server/oauth/oauth.module.ts
|
|
15512
|
-
function
|
|
15715
|
+
function _ts_decorate63(decorators, target, key, desc) {
|
|
15513
15716
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15514
15717
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
15515
15718
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -15522,7 +15725,7 @@ function _ts_decorate62(decorators, target, key, desc) {
|
|
|
15522
15725
|
}
|
|
15523
15726
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15524
15727
|
}
|
|
15525
|
-
__name(
|
|
15728
|
+
__name(_ts_decorate63, "_ts_decorate");
|
|
15526
15729
|
function buildOAuthPlugins(options) {
|
|
15527
15730
|
const plugins = [];
|
|
15528
15731
|
if (options.oauth?.google) {
|
|
@@ -15592,7 +15795,7 @@ var OAuthModule = class _OAuthModule {
|
|
|
15592
15795
|
};
|
|
15593
15796
|
}
|
|
15594
15797
|
};
|
|
15595
|
-
OAuthModule =
|
|
15798
|
+
OAuthModule = _ts_decorate63([
|
|
15596
15799
|
Module({})
|
|
15597
15800
|
], OAuthModule);
|
|
15598
15801
|
|
|
@@ -16487,7 +16690,7 @@ function schemesFor(options, registered, cookieDelivery, bearerDelivery) {
|
|
|
16487
16690
|
__name(schemesFor, "schemesFor");
|
|
16488
16691
|
|
|
16489
16692
|
// src/server/openapi/auth-openapi.contributor.ts
|
|
16490
|
-
function
|
|
16693
|
+
function _ts_decorate64(decorators, target, key, desc) {
|
|
16491
16694
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16492
16695
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
16493
16696
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -16500,13 +16703,13 @@ function _ts_decorate63(decorators, target, key, desc) {
|
|
|
16500
16703
|
}
|
|
16501
16704
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16502
16705
|
}
|
|
16503
|
-
__name(
|
|
16504
|
-
function
|
|
16706
|
+
__name(_ts_decorate64, "_ts_decorate");
|
|
16707
|
+
function _ts_metadata61(metadataKey, metadataValue) {
|
|
16505
16708
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
16506
16709
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
16507
16710
|
}
|
|
16508
16711
|
}
|
|
16509
|
-
__name(
|
|
16712
|
+
__name(_ts_metadata61, "_ts_metadata");
|
|
16510
16713
|
function _ts_param38(paramIndex, decorator) {
|
|
16511
16714
|
return function(target, key) {
|
|
16512
16715
|
decorator(target, key, paramIndex);
|
|
@@ -16532,18 +16735,18 @@ var AuthOpenApiContributor = class {
|
|
|
16532
16735
|
return buildAuthOpenApiFragment(this.options, this.registered);
|
|
16533
16736
|
}
|
|
16534
16737
|
};
|
|
16535
|
-
AuthOpenApiContributor =
|
|
16738
|
+
AuthOpenApiContributor = _ts_decorate64([
|
|
16536
16739
|
Injectable(),
|
|
16537
16740
|
SetMetadata(OPENAPI_CONTRIBUTOR_METADATA, true),
|
|
16538
16741
|
_ts_param38(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
16539
16742
|
_ts_param38(1, Inject(BYMAX_AUTH_REGISTERED_CONTROLLERS)),
|
|
16540
|
-
|
|
16541
|
-
|
|
16743
|
+
_ts_metadata61("design:type", Function),
|
|
16744
|
+
_ts_metadata61("design:paramtypes", [
|
|
16542
16745
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
16543
16746
|
typeof RegisteredControllers === "undefined" ? Object : RegisteredControllers
|
|
16544
16747
|
])
|
|
16545
16748
|
], AuthOpenApiContributor);
|
|
16546
|
-
function
|
|
16749
|
+
function _ts_decorate65(decorators, target, key, desc) {
|
|
16547
16750
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16548
16751
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
16549
16752
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -16556,13 +16759,13 @@ function _ts_decorate64(decorators, target, key, desc) {
|
|
|
16556
16759
|
}
|
|
16557
16760
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16558
16761
|
}
|
|
16559
|
-
__name(
|
|
16560
|
-
function
|
|
16762
|
+
__name(_ts_decorate65, "_ts_decorate");
|
|
16763
|
+
function _ts_metadata62(metadataKey, metadataValue) {
|
|
16561
16764
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
16562
16765
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
16563
16766
|
}
|
|
16564
16767
|
}
|
|
16565
|
-
__name(
|
|
16768
|
+
__name(_ts_metadata62, "_ts_metadata");
|
|
16566
16769
|
function _ts_param39(paramIndex, decorator) {
|
|
16567
16770
|
return function(target, key) {
|
|
16568
16771
|
decorator(target, key, paramIndex);
|
|
@@ -16874,16 +17077,16 @@ var CommonPasswordChecker = class {
|
|
|
16874
17077
|
return false;
|
|
16875
17078
|
}
|
|
16876
17079
|
};
|
|
16877
|
-
CommonPasswordChecker =
|
|
17080
|
+
CommonPasswordChecker = _ts_decorate65([
|
|
16878
17081
|
Injectable(),
|
|
16879
17082
|
_ts_param39(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
16880
17083
|
_ts_param39(0, Optional()),
|
|
16881
|
-
|
|
16882
|
-
|
|
17084
|
+
_ts_metadata62("design:type", Function),
|
|
17085
|
+
_ts_metadata62("design:paramtypes", [
|
|
16883
17086
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
16884
17087
|
])
|
|
16885
17088
|
], CommonPasswordChecker);
|
|
16886
|
-
function
|
|
17089
|
+
function _ts_decorate66(decorators, target, key, desc) {
|
|
16887
17090
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16888
17091
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
16889
17092
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -16896,7 +17099,7 @@ function _ts_decorate65(decorators, target, key, desc) {
|
|
|
16896
17099
|
}
|
|
16897
17100
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16898
17101
|
}
|
|
16899
|
-
__name(
|
|
17102
|
+
__name(_ts_decorate66, "_ts_decorate");
|
|
16900
17103
|
var NoOpEmailProvider = class _NoOpEmailProvider {
|
|
16901
17104
|
static {
|
|
16902
17105
|
__name(this, "NoOpEmailProvider");
|
|
@@ -16931,7 +17134,7 @@ var NoOpEmailProvider = class _NoOpEmailProvider {
|
|
|
16931
17134
|
this.logger.log(`sendInvitation \u2192 ${maskEmail(email)} (no-op)`);
|
|
16932
17135
|
}
|
|
16933
17136
|
};
|
|
16934
|
-
NoOpEmailProvider =
|
|
17137
|
+
NoOpEmailProvider = _ts_decorate66([
|
|
16935
17138
|
Injectable()
|
|
16936
17139
|
], NoOpEmailProvider);
|
|
16937
17140
|
|
|
@@ -16945,7 +17148,7 @@ var SystemApiKeyClock = class {
|
|
|
16945
17148
|
return /* @__PURE__ */ new Date();
|
|
16946
17149
|
}
|
|
16947
17150
|
};
|
|
16948
|
-
function
|
|
17151
|
+
function _ts_decorate67(decorators, target, key, desc) {
|
|
16949
17152
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16950
17153
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
16951
17154
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -16958,13 +17161,13 @@ function _ts_decorate66(decorators, target, key, desc) {
|
|
|
16958
17161
|
}
|
|
16959
17162
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16960
17163
|
}
|
|
16961
|
-
__name(
|
|
16962
|
-
function
|
|
17164
|
+
__name(_ts_decorate67, "_ts_decorate");
|
|
17165
|
+
function _ts_metadata63(metadataKey, metadataValue) {
|
|
16963
17166
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
16964
17167
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
16965
17168
|
}
|
|
16966
17169
|
}
|
|
16967
|
-
__name(
|
|
17170
|
+
__name(_ts_metadata63, "_ts_metadata");
|
|
16968
17171
|
function _ts_param40(paramIndex, decorator) {
|
|
16969
17172
|
return function(target, key) {
|
|
16970
17173
|
decorator(target, key, paramIndex);
|
|
@@ -17013,21 +17216,21 @@ var ApiKeyScopeAuditService = class {
|
|
|
17013
17216
|
}
|
|
17014
17217
|
}
|
|
17015
17218
|
};
|
|
17016
|
-
ApiKeyScopeAuditService =
|
|
17219
|
+
ApiKeyScopeAuditService = _ts_decorate67([
|
|
17017
17220
|
Injectable(),
|
|
17018
17221
|
_ts_param40(0, Inject(DiscoveryService)),
|
|
17019
17222
|
_ts_param40(1, Inject(MetadataScanner)),
|
|
17020
17223
|
_ts_param40(2, Inject(Reflector)),
|
|
17021
17224
|
_ts_param40(3, Inject(BYMAX_AUTH_OPTIONS)),
|
|
17022
|
-
|
|
17023
|
-
|
|
17225
|
+
_ts_metadata63("design:type", Function),
|
|
17226
|
+
_ts_metadata63("design:paramtypes", [
|
|
17024
17227
|
typeof DiscoveryService === "undefined" ? Object : DiscoveryService,
|
|
17025
17228
|
typeof MetadataScanner === "undefined" ? Object : MetadataScanner,
|
|
17026
17229
|
typeof Reflector === "undefined" ? Object : Reflector,
|
|
17027
17230
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
17028
17231
|
])
|
|
17029
17232
|
], ApiKeyScopeAuditService);
|
|
17030
|
-
function
|
|
17233
|
+
function _ts_decorate68(decorators, target, key, desc) {
|
|
17031
17234
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17032
17235
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
17033
17236
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -17040,13 +17243,13 @@ function _ts_decorate67(decorators, target, key, desc) {
|
|
|
17040
17243
|
}
|
|
17041
17244
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17042
17245
|
}
|
|
17043
|
-
__name(
|
|
17044
|
-
function
|
|
17246
|
+
__name(_ts_decorate68, "_ts_decorate");
|
|
17247
|
+
function _ts_metadata64(metadataKey, metadataValue) {
|
|
17045
17248
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
17046
17249
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
17047
17250
|
}
|
|
17048
17251
|
}
|
|
17049
|
-
__name(
|
|
17252
|
+
__name(_ts_metadata64, "_ts_metadata");
|
|
17050
17253
|
function _ts_param41(paramIndex, decorator) {
|
|
17051
17254
|
return function(target, key) {
|
|
17052
17255
|
decorator(target, key, paramIndex);
|
|
@@ -17181,13 +17384,13 @@ var ApiKeyService = class {
|
|
|
17181
17384
|
return value;
|
|
17182
17385
|
}
|
|
17183
17386
|
};
|
|
17184
|
-
ApiKeyService =
|
|
17387
|
+
ApiKeyService = _ts_decorate68([
|
|
17185
17388
|
Injectable(),
|
|
17186
17389
|
_ts_param41(0, Inject(BYMAX_AUTH_API_KEY_REPOSITORY)),
|
|
17187
17390
|
_ts_param41(1, Inject(BYMAX_AUTH_API_KEY_CLOCK)),
|
|
17188
17391
|
_ts_param41(2, Inject(BYMAX_AUTH_OPTIONS)),
|
|
17189
|
-
|
|
17190
|
-
|
|
17392
|
+
_ts_metadata64("design:type", Function),
|
|
17393
|
+
_ts_metadata64("design:paramtypes", [
|
|
17191
17394
|
typeof IApiKeyRepository === "undefined" ? Object : IApiKeyRepository,
|
|
17192
17395
|
typeof ApiKeyClock === "undefined" ? Object : ApiKeyClock,
|
|
17193
17396
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
@@ -17269,7 +17472,7 @@ async function assertTenantBinding(options, handshake, tenantId) {
|
|
|
17269
17472
|
__name(assertTenantBinding, "assertTenantBinding");
|
|
17270
17473
|
|
|
17271
17474
|
// src/server/services/auth-token-verifier.service.ts
|
|
17272
|
-
function
|
|
17475
|
+
function _ts_decorate69(decorators, target, key, desc) {
|
|
17273
17476
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17274
17477
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
17275
17478
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -17282,13 +17485,13 @@ function _ts_decorate68(decorators, target, key, desc) {
|
|
|
17282
17485
|
}
|
|
17283
17486
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17284
17487
|
}
|
|
17285
|
-
__name(
|
|
17286
|
-
function
|
|
17488
|
+
__name(_ts_decorate69, "_ts_decorate");
|
|
17489
|
+
function _ts_metadata65(metadataKey, metadataValue) {
|
|
17287
17490
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
17288
17491
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
17289
17492
|
}
|
|
17290
17493
|
}
|
|
17291
|
-
__name(
|
|
17494
|
+
__name(_ts_metadata65, "_ts_metadata");
|
|
17292
17495
|
function _ts_param42(paramIndex, decorator) {
|
|
17293
17496
|
return function(target, key) {
|
|
17294
17497
|
decorator(target, key, paramIndex);
|
|
@@ -17478,14 +17681,14 @@ var AuthTokenVerifierService = class _AuthTokenVerifierService {
|
|
|
17478
17681
|
}
|
|
17479
17682
|
}
|
|
17480
17683
|
};
|
|
17481
|
-
AuthTokenVerifierService =
|
|
17684
|
+
AuthTokenVerifierService = _ts_decorate69([
|
|
17482
17685
|
Injectable(),
|
|
17483
17686
|
_ts_param42(0, Inject(JwtService)),
|
|
17484
17687
|
_ts_param42(1, Inject(BYMAX_AUTH_OPTIONS)),
|
|
17485
17688
|
_ts_param42(2, Inject(AuthRevocationService)),
|
|
17486
17689
|
_ts_param42(3, Inject(AccountStatusService)),
|
|
17487
|
-
|
|
17488
|
-
|
|
17690
|
+
_ts_metadata65("design:type", Function),
|
|
17691
|
+
_ts_metadata65("design:paramtypes", [
|
|
17489
17692
|
typeof JwtService === "undefined" ? Object : JwtService,
|
|
17490
17693
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions,
|
|
17491
17694
|
typeof AuthRevocationService === "undefined" ? Object : AuthRevocationService,
|
|
@@ -17494,7 +17697,7 @@ AuthTokenVerifierService = _ts_decorate68([
|
|
|
17494
17697
|
], AuthTokenVerifierService);
|
|
17495
17698
|
|
|
17496
17699
|
// src/server/bymax-auth.module.ts
|
|
17497
|
-
function
|
|
17700
|
+
function _ts_decorate70(decorators, target, key, desc) {
|
|
17498
17701
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17499
17702
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
17500
17703
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -17507,7 +17710,7 @@ function _ts_decorate69(decorators, target, key, desc) {
|
|
|
17507
17710
|
}
|
|
17508
17711
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17509
17712
|
}
|
|
17510
|
-
__name(
|
|
17713
|
+
__name(_ts_decorate70, "_ts_decorate");
|
|
17511
17714
|
function hasProviderToken(providers, token) {
|
|
17512
17715
|
return providers.some((p) => {
|
|
17513
17716
|
if (typeof p === "function") return false;
|
|
@@ -17767,6 +17970,7 @@ var BymaxAuthModule = class _BymaxAuthModule {
|
|
|
17767
17970
|
AuthService,
|
|
17768
17971
|
// Guards — registered as providers so they can be applied via @UseGuards().
|
|
17769
17972
|
JwtAuthGuard,
|
|
17973
|
+
RequestEncodingGuard,
|
|
17770
17974
|
TrustedOriginGuard,
|
|
17771
17975
|
AuthRateLimitGuard,
|
|
17772
17976
|
// Response-header interceptor — every library controller applies it, so it must be
|
|
@@ -17799,6 +18003,7 @@ var BymaxAuthModule = class _BymaxAuthModule {
|
|
|
17799
18003
|
AuthService,
|
|
17800
18004
|
// Export guards so host-app modules can apply them without reimporting.
|
|
17801
18005
|
JwtAuthGuard,
|
|
18006
|
+
RequestEncodingGuard,
|
|
17802
18007
|
TrustedOriginGuard,
|
|
17803
18008
|
AuthRateLimitGuard,
|
|
17804
18009
|
RolesGuard,
|
|
@@ -17897,7 +18102,7 @@ var BymaxAuthModule = class _BymaxAuthModule {
|
|
|
17897
18102
|
};
|
|
17898
18103
|
}
|
|
17899
18104
|
};
|
|
17900
|
-
BymaxAuthModule =
|
|
18105
|
+
BymaxAuthModule = _ts_decorate70([
|
|
17901
18106
|
Module({})
|
|
17902
18107
|
], BymaxAuthModule);
|
|
17903
18108
|
|
|
@@ -18225,7 +18430,7 @@ var DefaultAuthEmailProvider = class _DefaultAuthEmailProvider {
|
|
|
18225
18430
|
}
|
|
18226
18431
|
}
|
|
18227
18432
|
};
|
|
18228
|
-
function
|
|
18433
|
+
function _ts_decorate71(decorators, target, key, desc) {
|
|
18229
18434
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18230
18435
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18231
18436
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18238,13 +18443,13 @@ function _ts_decorate70(decorators, target, key, desc) {
|
|
|
18238
18443
|
}
|
|
18239
18444
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18240
18445
|
}
|
|
18241
|
-
__name(
|
|
18242
|
-
function
|
|
18446
|
+
__name(_ts_decorate71, "_ts_decorate");
|
|
18447
|
+
function _ts_metadata66(metadataKey, metadataValue) {
|
|
18243
18448
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
18244
18449
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
18245
18450
|
}
|
|
18246
18451
|
}
|
|
18247
|
-
__name(
|
|
18452
|
+
__name(_ts_metadata66, "_ts_metadata");
|
|
18248
18453
|
var HIBP_RANGE_URL = "https://api.pwnedpasswords.com/range/";
|
|
18249
18454
|
var PREFIX_LENGTH = 5;
|
|
18250
18455
|
var DEFAULT_TIMEOUT_MS = 1500;
|
|
@@ -18301,10 +18506,10 @@ var HibpBreachChecker = class _HibpBreachChecker {
|
|
|
18301
18506
|
}
|
|
18302
18507
|
}
|
|
18303
18508
|
};
|
|
18304
|
-
HibpBreachChecker =
|
|
18509
|
+
HibpBreachChecker = _ts_decorate71([
|
|
18305
18510
|
Injectable(),
|
|
18306
|
-
|
|
18307
|
-
|
|
18511
|
+
_ts_metadata66("design:type", Function),
|
|
18512
|
+
_ts_metadata66("design:paramtypes", [
|
|
18308
18513
|
Number
|
|
18309
18514
|
])
|
|
18310
18515
|
], HibpBreachChecker);
|
|
@@ -18317,10 +18522,10 @@ var AllowAllBreachChecker = class {
|
|
|
18317
18522
|
return false;
|
|
18318
18523
|
}
|
|
18319
18524
|
};
|
|
18320
|
-
AllowAllBreachChecker =
|
|
18525
|
+
AllowAllBreachChecker = _ts_decorate71([
|
|
18321
18526
|
Injectable()
|
|
18322
18527
|
], AllowAllBreachChecker);
|
|
18323
|
-
function
|
|
18528
|
+
function _ts_decorate72(decorators, target, key, desc) {
|
|
18324
18529
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18325
18530
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18326
18531
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18333,7 +18538,7 @@ function _ts_decorate71(decorators, target, key, desc) {
|
|
|
18333
18538
|
}
|
|
18334
18539
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18335
18540
|
}
|
|
18336
|
-
__name(
|
|
18541
|
+
__name(_ts_decorate72, "_ts_decorate");
|
|
18337
18542
|
var OptionalAuthGuard = class extends JwtAuthGuard {
|
|
18338
18543
|
static {
|
|
18339
18544
|
__name(this, "OptionalAuthGuard");
|
|
@@ -18348,10 +18553,10 @@ var OptionalAuthGuard = class extends JwtAuthGuard {
|
|
|
18348
18553
|
return super.canActivate(context);
|
|
18349
18554
|
}
|
|
18350
18555
|
};
|
|
18351
|
-
OptionalAuthGuard =
|
|
18556
|
+
OptionalAuthGuard = _ts_decorate72([
|
|
18352
18557
|
Injectable()
|
|
18353
18558
|
], OptionalAuthGuard);
|
|
18354
|
-
function
|
|
18559
|
+
function _ts_decorate73(decorators, target, key, desc) {
|
|
18355
18560
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18356
18561
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18357
18562
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18364,13 +18569,13 @@ function _ts_decorate72(decorators, target, key, desc) {
|
|
|
18364
18569
|
}
|
|
18365
18570
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18366
18571
|
}
|
|
18367
|
-
__name(
|
|
18368
|
-
function
|
|
18572
|
+
__name(_ts_decorate73, "_ts_decorate");
|
|
18573
|
+
function _ts_metadata67(metadataKey, metadataValue) {
|
|
18369
18574
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
18370
18575
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
18371
18576
|
}
|
|
18372
18577
|
}
|
|
18373
|
-
__name(
|
|
18578
|
+
__name(_ts_metadata67, "_ts_metadata");
|
|
18374
18579
|
function _ts_param43(paramIndex, decorator) {
|
|
18375
18580
|
return function(target, key) {
|
|
18376
18581
|
decorator(target, key, paramIndex);
|
|
@@ -18406,11 +18611,11 @@ var SelfOrAdminGuard = class {
|
|
|
18406
18611
|
throw new AuthException(AUTH_ERROR_CODES.INSUFFICIENT_ROLE);
|
|
18407
18612
|
}
|
|
18408
18613
|
};
|
|
18409
|
-
SelfOrAdminGuard =
|
|
18614
|
+
SelfOrAdminGuard = _ts_decorate73([
|
|
18410
18615
|
Injectable(),
|
|
18411
18616
|
_ts_param43(0, Inject(BYMAX_AUTH_OPTIONS)),
|
|
18412
|
-
|
|
18413
|
-
|
|
18617
|
+
_ts_metadata67("design:type", Function),
|
|
18618
|
+
_ts_metadata67("design:paramtypes", [
|
|
18414
18619
|
typeof ResolvedOptions === "undefined" ? Object : ResolvedOptions
|
|
18415
18620
|
])
|
|
18416
18621
|
], SelfOrAdminGuard);
|
|
@@ -18423,7 +18628,7 @@ function isHexLooking(value) {
|
|
|
18423
18628
|
return value.length === 64 && /^[a-fA-F0-9]{64}$/.test(value);
|
|
18424
18629
|
}
|
|
18425
18630
|
__name(isHexLooking, "isHexLooking");
|
|
18426
|
-
function
|
|
18631
|
+
function _ts_decorate74(decorators, target, key, desc) {
|
|
18427
18632
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18428
18633
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18429
18634
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18436,13 +18641,13 @@ function _ts_decorate73(decorators, target, key, desc) {
|
|
|
18436
18641
|
}
|
|
18437
18642
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18438
18643
|
}
|
|
18439
|
-
__name(
|
|
18440
|
-
function
|
|
18644
|
+
__name(_ts_decorate74, "_ts_decorate");
|
|
18645
|
+
function _ts_metadata68(metadataKey, metadataValue) {
|
|
18441
18646
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
18442
18647
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
18443
18648
|
}
|
|
18444
18649
|
}
|
|
18445
|
-
__name(
|
|
18650
|
+
__name(_ts_metadata68, "_ts_metadata");
|
|
18446
18651
|
function _ts_param44(paramIndex, decorator) {
|
|
18447
18652
|
return function(target, key) {
|
|
18448
18653
|
decorator(target, key, paramIndex);
|
|
@@ -18512,14 +18717,14 @@ var WsJwtGuard = class {
|
|
|
18512
18717
|
return true;
|
|
18513
18718
|
}
|
|
18514
18719
|
};
|
|
18515
|
-
WsJwtGuard =
|
|
18720
|
+
WsJwtGuard = _ts_decorate74([
|
|
18516
18721
|
Injectable(),
|
|
18517
18722
|
_ts_param44(0, Inject(JwtService)),
|
|
18518
18723
|
_ts_param44(1, Inject(AuthRevocationService)),
|
|
18519
18724
|
_ts_param44(2, Inject(WsTicketService)),
|
|
18520
18725
|
_ts_param44(3, Inject(BYMAX_AUTH_OPTIONS)),
|
|
18521
|
-
|
|
18522
|
-
|
|
18726
|
+
_ts_metadata68("design:type", Function),
|
|
18727
|
+
_ts_metadata68("design:paramtypes", [
|
|
18523
18728
|
typeof JwtService === "undefined" ? Object : JwtService,
|
|
18524
18729
|
typeof AuthRevocationService === "undefined" ? Object : AuthRevocationService,
|
|
18525
18730
|
typeof WsTicketService === "undefined" ? Object : WsTicketService,
|
|
@@ -18559,7 +18764,7 @@ function bindingInput(handshake) {
|
|
|
18559
18764
|
};
|
|
18560
18765
|
}
|
|
18561
18766
|
__name(bindingInput, "bindingInput");
|
|
18562
|
-
function
|
|
18767
|
+
function _ts_decorate75(decorators, target, key, desc) {
|
|
18563
18768
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18564
18769
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18565
18770
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18572,7 +18777,7 @@ function _ts_decorate74(decorators, target, key, desc) {
|
|
|
18572
18777
|
}
|
|
18573
18778
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18574
18779
|
}
|
|
18575
|
-
__name(
|
|
18780
|
+
__name(_ts_decorate75, "_ts_decorate");
|
|
18576
18781
|
function isAuthEnvelope(body) {
|
|
18577
18782
|
if (typeof body !== "object" || body === null) return false;
|
|
18578
18783
|
const error = body.error;
|
|
@@ -18598,6 +18803,12 @@ function bodyParserStatus(exception) {
|
|
|
18598
18803
|
return typeof status === "number" && status >= 400 && status < 500 ? status : void 0;
|
|
18599
18804
|
}
|
|
18600
18805
|
__name(bodyParserStatus, "bodyParserStatus");
|
|
18806
|
+
function isUntypedParserRefusal(exception) {
|
|
18807
|
+
if (!(exception instanceof Error)) return false;
|
|
18808
|
+
const { status, statusCode, expose, type } = exception;
|
|
18809
|
+
return status === HttpStatus.BAD_REQUEST && statusCode === HttpStatus.BAD_REQUEST && expose === true && type === void 0;
|
|
18810
|
+
}
|
|
18811
|
+
__name(isUntypedParserRefusal, "isUntypedParserRefusal");
|
|
18601
18812
|
function bodyParserMessage(status) {
|
|
18602
18813
|
if (status === HttpStatus.PAYLOAD_TOO_LARGE) return "Request entity too large";
|
|
18603
18814
|
if (status === HttpStatus.UNSUPPORTED_MEDIA_TYPE) return "Unsupported media type";
|
|
@@ -18663,6 +18874,16 @@ var AuthExceptionFilter = class _AuthExceptionFilter {
|
|
|
18663
18874
|
});
|
|
18664
18875
|
return;
|
|
18665
18876
|
}
|
|
18877
|
+
if (isUntypedParserRefusal(exception) && http.getRequest().route === void 0) {
|
|
18878
|
+
res.status(HttpStatus.BAD_REQUEST).json({
|
|
18879
|
+
error: {
|
|
18880
|
+
code: AUTH_ERROR_CODES.VALIDATION,
|
|
18881
|
+
message: MALFORMED_REQUEST_MESSAGE,
|
|
18882
|
+
details: null
|
|
18883
|
+
}
|
|
18884
|
+
});
|
|
18885
|
+
return;
|
|
18886
|
+
}
|
|
18666
18887
|
this.logger.error(`unhandled exception: ${describeChannelStatus(exception)}`);
|
|
18667
18888
|
res.status(HttpStatus.INTERNAL_SERVER_ERROR).json({
|
|
18668
18889
|
error: {
|
|
@@ -18675,10 +18896,10 @@ var AuthExceptionFilter = class _AuthExceptionFilter {
|
|
|
18675
18896
|
});
|
|
18676
18897
|
}
|
|
18677
18898
|
};
|
|
18678
|
-
AuthExceptionFilter =
|
|
18899
|
+
AuthExceptionFilter = _ts_decorate75([
|
|
18679
18900
|
Catch()
|
|
18680
18901
|
], AuthExceptionFilter);
|
|
18681
|
-
function
|
|
18902
|
+
function _ts_decorate76(decorators, target, key, desc) {
|
|
18682
18903
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18683
18904
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
18684
18905
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18691,7 +18912,7 @@ function _ts_decorate75(decorators, target, key, desc) {
|
|
|
18691
18912
|
}
|
|
18692
18913
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18693
18914
|
}
|
|
18694
|
-
__name(
|
|
18915
|
+
__name(_ts_decorate76, "_ts_decorate");
|
|
18695
18916
|
function isEmittingClient(client) {
|
|
18696
18917
|
return typeof client?.emit === "function";
|
|
18697
18918
|
}
|
|
@@ -18735,10 +18956,10 @@ var WsAuthExceptionFilter = class _WsAuthExceptionFilter {
|
|
|
18735
18956
|
this.logger.error(`refused a request on a client this filter cannot answer: ${describeChannelStatus(exception)}`);
|
|
18736
18957
|
}
|
|
18737
18958
|
};
|
|
18738
|
-
WsAuthExceptionFilter =
|
|
18959
|
+
WsAuthExceptionFilter = _ts_decorate76([
|
|
18739
18960
|
Catch(AuthException)
|
|
18740
18961
|
], WsAuthExceptionFilter);
|
|
18741
18962
|
var ServiceKey = /* @__PURE__ */ __name((...scopes) => applyDecorators(SetMetadata(IS_PUBLIC_KEY, true), ApiKeyScopes(...scopes), UseGuards(ApiKeyGuard)), "ServiceKey");
|
|
18742
18963
|
var CurrentApiKey = createParamDecorator((_data, ctx) => ctx.switchToHttp().getRequest().apiKey);
|
|
18743
18964
|
|
|
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 };
|
|
18965
|
+
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 };
|