@adonisjs/core 7.1.1 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{ace-DBm6EcQ-.js → ace-WfzFjXRM.js} +3 -3
- package/build/{app-BCcG_oDd.js → app-XhU0L_kQ.js} +1 -1
- package/build/{chunk-Do49iUES.js → chunk-ZRW5x4aP.js} +1 -3
- package/build/commands/add.js +3 -13
- package/build/commands/build.d.ts +4 -0
- package/build/commands/build.js +4 -4
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.js +2 -3
- package/build/commands/eject.js +2 -3
- package/build/commands/env/add.js +2 -3
- package/build/commands/generate_key.js +2 -3
- package/build/commands/inspect_rcfile.js +1 -2
- package/build/commands/list/routes.js +2 -3
- package/build/commands/make/command.d.ts +4 -0
- package/build/commands/make/command.js +9 -4
- package/build/commands/make/controller.d.ts +4 -0
- package/build/commands/make/controller.js +9 -4
- package/build/commands/make/event.d.ts +4 -0
- package/build/commands/make/event.js +9 -4
- package/build/commands/make/exception.d.ts +4 -0
- package/build/commands/make/exception.js +9 -4
- package/build/commands/make/listener.d.ts +4 -0
- package/build/commands/make/listener.js +7 -3
- package/build/commands/make/middleware.d.ts +4 -0
- package/build/commands/make/middleware.js +7 -3
- package/build/commands/make/preload.d.ts +4 -0
- package/build/commands/make/preload.js +7 -3
- package/build/commands/make/provider.d.ts +4 -0
- package/build/commands/make/provider.js +7 -3
- package/build/commands/make/service.d.ts +4 -0
- package/build/commands/make/service.js +9 -4
- package/build/commands/make/test.d.ts +4 -0
- package/build/commands/make/test.js +12 -4
- package/build/commands/make/transformer.d.ts +4 -0
- package/build/commands/make/transformer.js +9 -4
- package/build/commands/make/validator.d.ts +4 -0
- package/build/commands/make/validator.js +9 -4
- package/build/commands/make/view.d.ts +4 -0
- package/build/commands/make/view.js +9 -4
- package/build/commands/repl.js +1 -2
- package/build/commands/serve.js +2 -3
- package/build/commands/test.js +2 -3
- package/build/{config-Coti2q6R.js → config-dLMqZYix.js} +1 -1
- package/build/{container-CGfEwWof.js → container-BB6VBj9q.js} +1 -1
- package/build/{core-aRg0soJX.js → core-X32M3Zo8.js} +4 -0
- package/build/{create_kernel-D38-0Zbt.js → create_kernel-CziaAklz.js} +1 -1
- package/build/create_kernel-D6ZvFwXO.js +2 -0
- package/build/{decorate-B9Uz0anB.js → decorate-yKe-VEeE.js} +1 -1
- package/build/{dumper-3R77st8F.js → dumper-V22ueBaO.js} +1 -1
- package/build/{events-DlKX1ZdL.js → events-DIYBcPfM.js} +1 -1
- package/build/factories/app.js +0 -1
- package/build/factories/bodyparser.js +0 -1
- package/build/factories/core/ace.js +1 -16
- package/build/factories/core/ignitor.js +1 -13
- package/build/factories/core/main.js +3 -25
- package/build/factories/core/test_utils.js +1 -22
- package/build/factories/encryption.js +0 -1
- package/build/factories/events.js +0 -1
- package/build/factories/hash.js +0 -1
- package/build/factories/http.js +0 -1
- package/build/factories/logger.js +0 -1
- package/build/factories/stubs.js +1 -10
- package/build/{ignitor-Kym3gR-I.js → ignitor-CEEHASdH.js} +5 -5
- package/build/index.js +3 -9
- package/build/{logger-DIdZPHCe.js → logger-Cj7AOEsL.js} +1 -1
- package/build/{main-Ck0GqLx4.js → main-BDd3QiJF.js} +1 -1
- package/build/{main-B50zECAi.js → main-CG-utHjr.js} +1 -1
- package/build/{main-zxNP7iRl.js → main-DpE5rTyk.js} +1 -1
- package/build/{main-CRnMnrH7.js → main-DzNXtXg3.js} +2 -2
- package/build/{main-bRYXIHgD.js → main-_4BIfRkS.js} +2 -2
- package/build/{main-CoZI4Ezs.js → main-nex7ClUz.js} +2 -0
- package/build/{main-D1MSq4Uu.js → main-zFY2qkGC.js} +2 -2
- package/build/make/validator/resource.stub +2 -6
- package/build/modules/ace/codemods.d.ts +6 -0
- package/build/modules/ace/codemods.js +9 -1
- package/build/modules/ace/main.d.ts +1 -1
- package/build/modules/ace/main.js +2 -3
- package/build/modules/app.js +1 -2
- package/build/modules/bodyparser/bodyparser_middleware.js +0 -1
- package/build/modules/bodyparser/main.js +1 -2
- package/build/modules/config.js +1 -2
- package/build/modules/container.js +1 -2
- package/build/modules/dumper/main.js +1 -2
- package/build/modules/dumper/plugins/edge.js +0 -1
- package/build/modules/encryption/drivers/aes_256_cbc.js +0 -1
- package/build/modules/encryption/drivers/aes_256_gcm.js +0 -1
- package/build/modules/encryption/drivers/aes_siv.js +0 -1
- package/build/modules/encryption/drivers/chacha20_poly1305.js +0 -1
- package/build/modules/encryption/drivers/legacy.js +0 -2
- package/build/modules/encryption/main.js +1 -5
- package/build/modules/env/editor.js +0 -1
- package/build/modules/env/main.js +0 -1
- package/build/modules/events.js +1 -2
- package/build/modules/hash/drivers/argon.js +0 -1
- package/build/modules/hash/drivers/bcrypt.js +0 -1
- package/build/modules/hash/drivers/scrypt.js +0 -1
- package/build/modules/hash/main.js +1 -4
- package/build/modules/hash/phc_formatter.js +0 -1
- package/build/modules/health.js +0 -1
- package/build/modules/http/helpers.js +0 -1
- package/build/modules/http/main.js +1 -2
- package/build/modules/http/url_builder_client.js +0 -1
- package/build/modules/logger.js +1 -2
- package/build/modules/repl.js +1 -2
- package/build/modules/transformers/main.js +0 -1
- package/build/providers/app_provider.js +8 -12
- package/build/providers/edge_provider.js +1 -2
- package/build/providers/hash_provider.js +1 -3
- package/build/providers/repl_provider.js +1 -2
- package/build/providers/vinejs_provider.js +1 -2
- package/build/{repl-C02Re0Yd.js → repl-DL_vrd08.js} +1 -1
- package/build/safe_timing-AjC3K21F.js +49 -0
- package/build/services/ace.js +0 -1
- package/build/services/app.js +0 -1
- package/build/services/config.js +0 -1
- package/build/services/dumper.js +0 -1
- package/build/services/emitter.js +0 -1
- package/build/services/encryption.js +0 -1
- package/build/services/hash.js +0 -1
- package/build/services/logger.js +0 -1
- package/build/services/repl.js +0 -1
- package/build/services/router.js +0 -1
- package/build/services/server.js +0 -1
- package/build/services/test_utils.js +0 -1
- package/build/services/url_builder.js +0 -1
- package/build/src/exceptions.js +0 -1
- package/build/src/helpers/assert.js +0 -1
- package/build/src/helpers/http.js +0 -1
- package/build/src/helpers/is.js +0 -1
- package/build/src/helpers/main.d.ts +5 -0
- package/build/src/helpers/main.js +2 -2
- package/build/src/helpers/safe_timing.d.ts +28 -0
- package/build/src/helpers/safe_timing.js +2 -0
- package/build/src/helpers/string.js +0 -1
- package/build/src/helpers/types.js +0 -1
- package/build/src/helpers/verification_token.js +0 -1
- package/build/src/test_utils/main.js +1 -9
- package/build/src/types.js +0 -1
- package/build/src/vine.js +0 -1
- package/build/{test_utils-DbJS_uEu.js → test_utils-CX2woeem.js} +4 -3
- package/build/toolkit/main.js +1 -2
- package/build/types/ace.js +0 -1
- package/build/types/app.js +0 -1
- package/build/types/bodyparser.js +0 -1
- package/build/types/common.js +0 -1
- package/build/types/container.js +0 -1
- package/build/types/encryption.js +0 -1
- package/build/types/events.js +0 -1
- package/build/types/hash.js +0 -1
- package/build/types/health.js +0 -1
- package/build/types/helpers.js +0 -1
- package/build/types/http.js +0 -1
- package/build/types/logger.js +0 -1
- package/build/types/repl.js +0 -1
- package/build/types/transformers.js +0 -1
- package/package.json +12 -12
- package/build/create_kernel-BV3swyCg.js +0 -4
|
@@ -40,6 +40,12 @@ export declare class Codemods extends EventEmitter {
|
|
|
40
40
|
*/
|
|
41
41
|
verboseInstallOutput: boolean;
|
|
42
42
|
constructor(app: Application<any>, cliLogger: UIPrimitives['logger']);
|
|
43
|
+
/**
|
|
44
|
+
* Replace the logger used for all subsequent codemod
|
|
45
|
+
* operations. Useful to suppress output by passing a
|
|
46
|
+
* dummy logger when running inside a tasks manager.
|
|
47
|
+
*/
|
|
48
|
+
useLogger(logger: UIPrimitives['logger']): this;
|
|
43
49
|
/**
|
|
44
50
|
* Define one or more environment variables in the .env file
|
|
45
51
|
*
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "../../chunk-Do49iUES.js";
|
|
2
1
|
import { t as debug_default } from "../../debug-DWofTfIX.js";
|
|
3
2
|
import { t as stringHelpers } from "../../string-8_8He-HH.js";
|
|
4
3
|
import { EnvEditor } from "@adonisjs/env/editor";
|
|
@@ -58,6 +57,15 @@ var Codemods = class extends EventEmitter {
|
|
|
58
57
|
this.#cliLogger = cliLogger;
|
|
59
58
|
}
|
|
60
59
|
/**
|
|
60
|
+
* Replace the logger used for all subsequent codemod
|
|
61
|
+
* operations. Useful to suppress output by passing a
|
|
62
|
+
* dummy logger when running inside a tasks manager.
|
|
63
|
+
*/
|
|
64
|
+
useLogger(logger) {
|
|
65
|
+
this.#cliLogger = logger;
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
61
69
|
* - Lazily import the code transformer
|
|
62
70
|
* - Return a fresh or reused instance of the code transformer
|
|
63
71
|
*/
|
|
@@ -30,4 +30,4 @@
|
|
|
30
30
|
*/
|
|
31
31
|
export { Kernel } from './kernel.ts';
|
|
32
32
|
export { BaseCommand, ListCommand } from './commands.ts';
|
|
33
|
-
export { args, flags, errors, Parser, FsLoader, ListLoader, cliHelpers, HelpCommand, IndexGenerator, tracingChannels, } from '@adonisjs/ace';
|
|
33
|
+
export { args, flags, errors, cliui, Parser, FsLoader, ListLoader, cliHelpers, HelpCommand, IndexGenerator, tracingChannels, } from '@adonisjs/ace';
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
|
|
3
|
-
export { BaseCommand, FsLoader, HelpCommand, IndexGenerator, Kernel, ListCommand, ListLoader, Parser, args, cliHelpers, errors, flags, tracingChannels };
|
|
1
|
+
import { a as Parser, c as cliui, d as tracingChannels, f as Kernel, i as ListLoader, l as errors, m as ListCommand, n as HelpCommand, o as args, p as BaseCommand, r as IndexGenerator, s as cliHelpers, t as FsLoader, u as flags } from "../../main-DzNXtXg3.js";
|
|
2
|
+
export { BaseCommand, FsLoader, HelpCommand, IndexGenerator, Kernel, ListCommand, ListLoader, Parser, args, cliHelpers, cliui, errors, flags, tracingChannels };
|
package/build/modules/app.js
CHANGED
package/build/modules/config.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import { n as errors_exports, t as Dumper } from "../../dumper-3R77st8F.js";
|
|
1
|
+
import { n as errors_exports, t as Dumper } from "../../dumper-V22ueBaO.js";
|
|
3
2
|
//#region modules/dumper/define_config.ts
|
|
4
3
|
/**
|
|
5
4
|
* Define configuration for the dumper service exported by the
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "../../../chunk-Do49iUES.js";
|
|
2
|
-
import "../../../exceptions-B2MzIlHY.js";
|
|
3
1
|
import { t as E_BLIND_INDEX_NOT_SUPPORTED } from "../../../errors-BScZTzBu.js";
|
|
4
2
|
import { BaseDriver, Hmac, base64UrlDecode, base64UrlEncode, errors } from "@boringnode/encryption";
|
|
5
3
|
import { MessageBuilder } from "@poppinss/utils";
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import "../../chunk-Do49iUES.js";
|
|
2
|
-
import "../../debug-DWofTfIX.js";
|
|
3
|
-
import "../../config_provider-Do9af1ze.js";
|
|
4
|
-
import "../../exceptions-B2MzIlHY.js";
|
|
5
1
|
import { n as errors } from "../../errors-BScZTzBu.js";
|
|
6
2
|
import { n as drivers, t as defineConfig } from "../../define_config--5euEdi8.js";
|
|
7
|
-
import { i as Hmac, n as Encryption, r as EncryptionManager, t as BaseDriver } from "../../main-
|
|
3
|
+
import { i as Hmac, n as Encryption, r as EncryptionManager, t as BaseDriver } from "../../main-nex7ClUz.js";
|
|
8
4
|
export { BaseDriver, Encryption, EncryptionManager, Hmac, defineConfig, drivers, errors };
|
package/build/modules/events.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../debug-DWofTfIX.js";
|
|
3
|
-
import "../../config_provider-Do9af1ze.js";
|
|
4
|
-
import { n as defineConfig, r as drivers } from "../../main-B50zECAi.js";
|
|
1
|
+
import { n as defineConfig, r as drivers } from "../../main-CG-utHjr.js";
|
|
5
2
|
export * from "@adonisjs/hash";
|
|
6
3
|
export { defineConfig, drivers };
|
package/build/modules/health.js
CHANGED
package/build/modules/logger.js
CHANGED
package/build/modules/repl.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../debug-DWofTfIX.js";
|
|
3
|
-
import { t as app_exports } from "../app-BCcG_oDd.js";
|
|
1
|
+
import { t as app_exports } from "../app-XhU0L_kQ.js";
|
|
4
2
|
import { t as configProvider } from "../config_provider-Do9af1ze.js";
|
|
5
|
-
import { t as config_exports } from "../config-
|
|
6
|
-
import { t as events_exports } from "../events-
|
|
7
|
-
import { t as logger_exports } from "../logger-
|
|
8
|
-
import { t as Dumper } from "../dumper-
|
|
3
|
+
import { t as config_exports } from "../config-dLMqZYix.js";
|
|
4
|
+
import { t as events_exports } from "../events-DIYBcPfM.js";
|
|
5
|
+
import { t as logger_exports } from "../logger-Cj7AOEsL.js";
|
|
6
|
+
import { t as Dumper } from "../dumper-V22ueBaO.js";
|
|
9
7
|
import { r as RuntimeException } from "../exceptions-B2MzIlHY.js";
|
|
10
|
-
import { t as main_exports } from "../main-
|
|
11
|
-
import "../
|
|
12
|
-
import "../define_config--5euEdi8.js";
|
|
13
|
-
import { n as Encryption } from "../main-CoZI4Ezs.js";
|
|
8
|
+
import { t as main_exports } from "../main-BDd3QiJF.js";
|
|
9
|
+
import { n as Encryption } from "../main-nex7ClUz.js";
|
|
14
10
|
import { t as bodyparser_middleware_default } from "../bodyparser_middleware-H5FArWkI.js";
|
|
15
11
|
import { dirname } from "node:path";
|
|
16
12
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
@@ -73,7 +69,7 @@ var AppServiceProvider = class {
|
|
|
73
69
|
*/
|
|
74
70
|
registerAce() {
|
|
75
71
|
this.app.container.singleton("ace", async () => {
|
|
76
|
-
const { createAceKernel } = await import("../create_kernel-
|
|
72
|
+
const { createAceKernel } = await import("../create_kernel-D6ZvFwXO.js");
|
|
77
73
|
return createAceKernel(this.app);
|
|
78
74
|
});
|
|
79
75
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import { t as main_exports } from "../main-Ck0GqLx4.js";
|
|
1
|
+
import { t as main_exports } from "../main-BDd3QiJF.js";
|
|
3
2
|
import { t as pluginEdgeDumper } from "../edge-BG5ZYp6Z.js";
|
|
4
3
|
import edge from "edge.js";
|
|
5
4
|
//#region providers/edge_provider.ts
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import "../chunk-Do49iUES.js";
|
|
2
|
-
import "../debug-DWofTfIX.js";
|
|
3
1
|
import { t as configProvider } from "../config_provider-Do9af1ze.js";
|
|
4
|
-
import { t as main_exports } from "../main-
|
|
2
|
+
import { t as main_exports } from "../main-CG-utHjr.js";
|
|
5
3
|
import { RuntimeException } from "@poppinss/utils/exception";
|
|
6
4
|
//#region providers/hash_provider.ts
|
|
7
5
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import { t as repl_exports } from "../repl-C02Re0Yd.js";
|
|
1
|
+
import { t as repl_exports } from "../repl-DL_vrd08.js";
|
|
3
2
|
import { join } from "node:path";
|
|
4
3
|
import { homedir } from "node:os";
|
|
5
4
|
import { fsImportAll } from "@poppinss/utils/fs";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import { n as RequestValidator, t as main_exports } from "../main-Ck0GqLx4.js";
|
|
1
|
+
import { n as RequestValidator, t as main_exports } from "../main-BDd3QiJF.js";
|
|
3
2
|
import { t as VineMultipartFile } from "../vine-DkIupA3Z.js";
|
|
4
3
|
import { Vine } from "@vinejs/vine";
|
|
5
4
|
//#region providers/vinejs_provider.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as __reExport, t as __exportAll } from "./chunk-
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./chunk-ZRW5x4aP.js";
|
|
2
2
|
//#region modules/repl.ts
|
|
3
3
|
var repl_exports = /* @__PURE__ */ __exportAll({});
|
|
4
4
|
import * as import__adonisjs_repl from "@adonisjs/repl";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { setTimeout } from "node:timers/promises";
|
|
2
|
+
//#region src/helpers/safe_timing.ts
|
|
3
|
+
/**
|
|
4
|
+
* Ensures a callback takes at least a minimum amount of time to execute.
|
|
5
|
+
* This helps prevent timing attacks where an attacker measures response times
|
|
6
|
+
* to infer sensitive information (e.g., user enumeration via password reset).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // Password reset: both paths (user exists or not) take same minimum time
|
|
11
|
+
* return safeTiming(200, async () => {
|
|
12
|
+
* const user = await User.findBy('email', email)
|
|
13
|
+
* if (user) await sendResetEmail(user)
|
|
14
|
+
* return { message: 'If this email exists, you will receive a reset link.' }
|
|
15
|
+
* })
|
|
16
|
+
*
|
|
17
|
+
* // API token verification: skip the delay on valid token
|
|
18
|
+
* return safeTiming(200, async (timing) => {
|
|
19
|
+
* const token = await Token.findBy('value', request.header('x-api-key'))
|
|
20
|
+
* if (token) {
|
|
21
|
+
* timing.returnEarly()
|
|
22
|
+
* return token.owner
|
|
23
|
+
* }
|
|
24
|
+
* throw new UnauthorizedException()
|
|
25
|
+
* })
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
async function safeTiming(minimumMs, callback) {
|
|
29
|
+
const startTime = performance.now();
|
|
30
|
+
let shouldReturnEarly = false;
|
|
31
|
+
const timing = { returnEarly() {
|
|
32
|
+
shouldReturnEarly = true;
|
|
33
|
+
} };
|
|
34
|
+
let result;
|
|
35
|
+
let caughtError;
|
|
36
|
+
try {
|
|
37
|
+
result = await callback(timing);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
caughtError = error;
|
|
40
|
+
}
|
|
41
|
+
if (!shouldReturnEarly) {
|
|
42
|
+
const remaining = minimumMs - (performance.now() - startTime);
|
|
43
|
+
if (remaining > 0) await setTimeout(remaining);
|
|
44
|
+
}
|
|
45
|
+
if (caughtError) throw caughtError;
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { safeTiming as t };
|
package/build/services/ace.js
CHANGED
package/build/services/app.js
CHANGED
package/build/services/config.js
CHANGED
package/build/services/dumper.js
CHANGED
package/build/services/hash.js
CHANGED
package/build/services/logger.js
CHANGED
package/build/services/repl.js
CHANGED
package/build/services/router.js
CHANGED
package/build/services/server.js
CHANGED
package/build/src/exceptions.js
CHANGED
package/build/src/helpers/is.js
CHANGED
|
@@ -42,3 +42,8 @@ export { compose, Secret, safeEqual, MessageBuilder, defineStaticProperty } from
|
|
|
42
42
|
* Verification token utility for creating secure tokens.
|
|
43
43
|
*/
|
|
44
44
|
export { VerificationToken } from './verification_token.ts';
|
|
45
|
+
/**
|
|
46
|
+
* Ensures a callback takes at least a minimum amount of time
|
|
47
|
+
* to prevent timing attacks.
|
|
48
|
+
*/
|
|
49
|
+
export { safeTiming } from './safe_timing.ts';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../../chunk-Do49iUES.js";
|
|
2
1
|
import { t as VerificationToken } from "../../verification_token-WCrZtUgZ.js";
|
|
2
|
+
import { t as safeTiming } from "../../safe_timing-AjC3K21F.js";
|
|
3
3
|
import { fsImportAll, fsReadAll } from "@poppinss/utils/fs";
|
|
4
4
|
import base64 from "@poppinss/utils/base64";
|
|
5
5
|
import { MessageBuilder, Secret, compose, defineStaticProperty, safeEqual } from "@poppinss/utils";
|
|
6
|
-
export { MessageBuilder, Secret, VerificationToken, base64, compose, defineStaticProperty, fsImportAll, fsReadAll, safeEqual };
|
|
6
|
+
export { MessageBuilder, Secret, VerificationToken, base64, compose, defineStaticProperty, fsImportAll, fsReadAll, safeEqual, safeTiming };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ensures a callback takes at least a minimum amount of time to execute.
|
|
3
|
+
* This helps prevent timing attacks where an attacker measures response times
|
|
4
|
+
* to infer sensitive information (e.g., user enumeration via password reset).
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* // Password reset: both paths (user exists or not) take same minimum time
|
|
9
|
+
* return safeTiming(200, async () => {
|
|
10
|
+
* const user = await User.findBy('email', email)
|
|
11
|
+
* if (user) await sendResetEmail(user)
|
|
12
|
+
* return { message: 'If this email exists, you will receive a reset link.' }
|
|
13
|
+
* })
|
|
14
|
+
*
|
|
15
|
+
* // API token verification: skip the delay on valid token
|
|
16
|
+
* return safeTiming(200, async (timing) => {
|
|
17
|
+
* const token = await Token.findBy('value', request.header('x-api-key'))
|
|
18
|
+
* if (token) {
|
|
19
|
+
* timing.returnEarly()
|
|
20
|
+
* return token.owner
|
|
21
|
+
* }
|
|
22
|
+
* throw new UnauthorizedException()
|
|
23
|
+
* })
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function safeTiming<T>(minimumMs: number, callback: (timing: {
|
|
27
|
+
returnEarly(): void;
|
|
28
|
+
}) => Promise<T>): Promise<T>;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../debug-DWofTfIX.js";
|
|
3
|
-
import "../../config_provider-Do9af1ze.js";
|
|
4
|
-
import "../../exceptions-B2MzIlHY.js";
|
|
5
|
-
import "../../main-Ck0GqLx4.js";
|
|
6
|
-
import "../../errors-BScZTzBu.js";
|
|
7
|
-
import "../../define_config--5euEdi8.js";
|
|
8
|
-
import "../../main-CoZI4Ezs.js";
|
|
9
|
-
import { t as TestUtils } from "../../main-bRYXIHgD.js";
|
|
1
|
+
import { t as TestUtils } from "../../main-_4BIfRkS.js";
|
|
10
2
|
export { TestUtils };
|
package/build/src/types.js
CHANGED
package/build/src/vine.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { t as Ignitor } from "./main-
|
|
2
|
-
import
|
|
3
|
-
import { t as
|
|
1
|
+
import { t as Ignitor } from "./main-zFY2qkGC.js";
|
|
2
|
+
import "./core-X32M3Zo8.js";
|
|
3
|
+
import { t as IgnitorFactory } from "./ignitor-CEEHASdH.js";
|
|
4
|
+
import { t as TestUtils } from "./main-_4BIfRkS.js";
|
|
4
5
|
//#region factories/core/test_utils.ts
|
|
5
6
|
/**
|
|
6
7
|
* Factory for creating TestUtils instances used in AdonisJS testing scenarios.
|
package/build/toolkit/main.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "../
|
|
3
|
-
import { t as __decorate } from "../decorate-B9Uz0anB.js";
|
|
2
|
+
import { t as __decorate } from "../decorate-yKe-VEeE.js";
|
|
4
3
|
import { BaseCommand, HelpCommand, IndexGenerator, Kernel, ListLoader, args } from "@adonisjs/ace";
|
|
5
4
|
import { join } from "node:path";
|
|
6
5
|
//#region toolkit/commands/index_commands.ts
|
package/build/types/ace.js
CHANGED
package/build/types/app.js
CHANGED
package/build/types/common.js
CHANGED
package/build/types/container.js
CHANGED
package/build/types/events.js
CHANGED
package/build/types/hash.js
CHANGED