@adonisjs/core 7.0.0-next.14 → 7.0.0-next.15
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-DDzvaSs_.js → ace-CYvqhV0y.js} +3 -3
- package/build/commands/add.d.ts +4 -3
- package/build/commands/add.js +52 -16
- package/build/commands/build.js +3 -3
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.js +2 -2
- package/build/commands/eject.js +3 -3
- package/build/commands/env/add.js +3 -3
- package/build/commands/generate_key.js +2 -2
- package/build/commands/inspect_rcfile.js +1 -1
- package/build/commands/list/routes.js +2 -2
- package/build/commands/make/command.js +2 -2
- package/build/commands/make/controller.js +2 -2
- package/build/commands/make/event.js +2 -2
- package/build/commands/make/exception.js +2 -2
- package/build/commands/make/listener.js +2 -2
- package/build/commands/make/middleware.js +3 -3
- package/build/commands/make/preload.js +3 -3
- package/build/commands/make/provider.js +3 -3
- package/build/commands/make/service.js +2 -2
- package/build/commands/make/test.js +2 -2
- package/build/commands/make/transformer.js +2 -2
- package/build/commands/make/validator.js +2 -2
- package/build/commands/make/view.js +2 -2
- package/build/commands/repl.js +1 -1
- package/build/commands/serve.js +3 -3
- package/build/commands/test.js +3 -3
- package/build/{config_provider-CY-xuo2R.js → config_provider-DWVFHOQX.js} +3 -1
- package/build/{core-CffBtWJW.js → core-BuRVIObK.js} +37 -11
- package/build/create_kernel-Cn8zVtvt.js +3 -0
- package/build/{create_kernel-B7zWS8Zz.js → create_kernel-Cpqqa931.js} +1 -1
- package/build/define_config-BvoRgVYO.js +62 -0
- package/build/exceptions-DNMesP42.js +2 -0
- package/build/factories/core/ace.js +12 -11
- package/build/factories/core/ignitor.js +9 -8
- package/build/factories/core/main.js +18 -16
- package/build/factories/core/test_utils.js +15 -13
- package/build/factories/encryption.d.ts +1 -1
- package/build/factories/encryption.js +1 -1
- package/build/factories/stubs.js +5 -6
- package/build/{ignitor-Dil-rtCo.js → ignitor-BAHDhsmQ.js} +14 -6
- package/build/index.d.ts +1 -1
- package/build/index.js +5 -6
- package/build/{main-BTUXw6He.js → main-B3Y59dQ2.js} +2 -2
- package/build/{main-CFmDHDls.js → main-BA5_XHM0.js} +2 -7
- package/build/{main-BrJQ1VAM.js → main-BPDqyZic.js} +1 -2
- package/build/main-Bfnr5tAw.js +2 -0
- package/build/{main-2-nm3TiB.js → main-TtUIT86D.js} +4 -3
- package/build/modules/ace/codemods.js +1 -1
- package/build/modules/ace/main.js +1 -1
- package/build/modules/bodyparser/bodyparser_middleware.js +1 -1
- package/build/modules/bodyparser/main.js +1 -1
- package/build/modules/config.js +1 -1
- package/build/modules/dumper/main.js +1 -1
- package/build/modules/dumper/plugins/edge.js +1 -1
- package/build/modules/encryption/define_config.d.ts +127 -0
- package/build/modules/encryption/drivers/aes_256_cbc.d.ts +20 -0
- package/build/modules/encryption/drivers/aes_256_cbc.js +2 -0
- package/build/modules/encryption/drivers/aes_256_gcm.d.ts +21 -0
- package/build/modules/encryption/drivers/aes_256_gcm.js +2 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.d.ts +21 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.js +2 -0
- package/build/modules/encryption/main.d.ts +85 -0
- package/build/modules/encryption/main.js +5 -0
- package/build/modules/events.js +1 -1
- package/build/modules/hash/main.js +2 -3
- package/build/modules/http/main.js +1 -1
- package/build/modules/http/request_validator.d.ts +1 -3
- package/build/modules/logger.js +1 -1
- package/build/modules/repl.js +1 -1
- package/build/modules/transformers/main.js +1 -1
- package/build/providers/app_provider.d.ts +5 -4
- package/build/providers/app_provider.js +22 -14
- package/build/providers/edge_provider.js +2 -2
- package/build/providers/hash_provider.js +2 -3
- package/build/providers/repl_provider.js +1 -1
- package/build/providers/vinejs_provider.js +3 -4
- package/build/src/debug.d.ts +1 -1
- package/build/src/exceptions.js +1 -1
- package/build/src/helpers/main.js +1 -1
- package/build/src/helpers/string.js +1 -1
- package/build/src/helpers/verification_token.js +1 -1
- package/build/src/test_utils/main.js +6 -3
- package/build/src/types.d.ts +65 -8
- package/build/src/vine.js +1 -1
- package/build/{test_utils-c_TEaEHW.js → test_utils-DCaos98d.js} +3 -3
- package/build/toolkit/main.js +1 -1
- package/build/types/encryption.d.ts +39 -1
- package/build/types/encryption.js +0 -1
- package/build/{utils-Dpa3iJz-.js → utils-CtGytdtt.js} +1 -0
- package/package.json +44 -42
- package/build/create_kernel-CsTq0pWc.js +0 -3
- package/build/debug-DURPi9xn.js +0 -3
- package/build/encryption-D2HGu0bU.js +0 -5
- package/build/modules/encryption.d.ts +0 -18
- package/build/modules/encryption.js +0 -4
- /package/build/{bodyparser_middleware-DTW0epKM.js → bodyparser_middleware-BmARtnYe.js} +0 -0
- /package/build/{config-B2S2xfmN.js → config-BwupGyeJ.js} +0 -0
- /package/build/{decorate-DM0Sx1ye.js → decorate-CJcHOoD-.js} +0 -0
- /package/build/{dumper-C_sMcyFb.js → dumper-D29dE_xc.js} +0 -0
- /package/build/{edge-LQdCc1L3.js → edge-BVYR-Vjr.js} +0 -0
- /package/build/{events-B8hK42QT.js → events-BW2flEef.js} +0 -0
- /package/build/{logger-Dha-0hp1.js → logger-C2asB8px.js} +0 -0
- /package/build/{main-BWftwyAK.js → main-BlJhxJJ2.js} +0 -0
- /package/build/{main-D5xz2ZN1.js → main-CP75MhEW.js} +0 -0
- /package/build/{main-q9TMzWUj.js → main-OHZwVYZ4.js} +0 -0
- /package/build/{repl-CumYg2V_.js → repl-BF2TbFoO.js} +0 -0
- /package/build/{string-CJ7ewUFq.js → string-Cx6q_win.js} +0 -0
- /package/build/{verification_token-DXsW81rl.js → verification_token-DrdoU4RH.js} +0 -0
- /package/build/{vine-Bt4ymkM0.js → vine-DGint2rk.js} +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main encryption class for encrypting and decrypting values.
|
|
3
|
+
*
|
|
4
|
+
* Provides methods to encrypt strings and objects with optional purpose
|
|
5
|
+
* binding, decrypt values, and manage encryption keys.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const encryption = new Encryption({ key: 'secret-key' })
|
|
10
|
+
* const encrypted = encryption.encrypt('sensitive data')
|
|
11
|
+
* const decrypted = encryption.decrypt(encrypted)
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export { Encryption } from '@boringnode/encryption';
|
|
15
|
+
/**
|
|
16
|
+
* Manager class for handling multiple encryption instances.
|
|
17
|
+
*
|
|
18
|
+
* Allows you to configure and manage multiple encryption drivers,
|
|
19
|
+
* switch between them, and use different encryption keys for
|
|
20
|
+
* different purposes.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const manager = new EncryptionManager({
|
|
25
|
+
* default: 'app',
|
|
26
|
+
* list: {
|
|
27
|
+
* app: {
|
|
28
|
+
* driver: (key) => new AES256GCM({ key }),
|
|
29
|
+
* keys: ['app-key']
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* })
|
|
33
|
+
* const encryptor = manager.use('app')
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export { EncryptionManager } from '@boringnode/encryption';
|
|
37
|
+
/**
|
|
38
|
+
* HMAC (Hash-based Message Authentication Code) class for creating
|
|
39
|
+
* and verifying message authentication codes.
|
|
40
|
+
*
|
|
41
|
+
* Provides methods to generate cryptographic hashes with a secret key
|
|
42
|
+
* and verify them to ensure data integrity and authenticity.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const hmac = new Hmac('secret-key')
|
|
47
|
+
* const signature = hmac.generate('message')
|
|
48
|
+
* const isValid = hmac.verify('message', signature)
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export { Hmac } from '@boringnode/encryption';
|
|
52
|
+
/**
|
|
53
|
+
* Base class for implementing custom encryption drivers.
|
|
54
|
+
*
|
|
55
|
+
* Extend this class to create custom encryption implementations
|
|
56
|
+
* that can be used with the EncryptionManager.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* class CustomDriver extends BaseDriver {
|
|
61
|
+
* encrypt(value: string) {
|
|
62
|
+
* // Custom encryption logic
|
|
63
|
+
* }
|
|
64
|
+
* decrypt(payload: string) {
|
|
65
|
+
* // Custom decryption logic
|
|
66
|
+
* }
|
|
67
|
+
* }
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export { BaseDriver } from '@boringnode/encryption';
|
|
71
|
+
/**
|
|
72
|
+
* Defines the encryption configuration for the application.
|
|
73
|
+
*
|
|
74
|
+
* @see {defineConfig} in define_config.ts for detailed documentation
|
|
75
|
+
*/
|
|
76
|
+
export { defineConfig } from './define_config.ts';
|
|
77
|
+
/**
|
|
78
|
+
* Collection of built-in encryption driver factory functions.
|
|
79
|
+
*
|
|
80
|
+
* Includes factories for ChaCha20-Poly1305, AES-256-CBC, and
|
|
81
|
+
* AES-256-GCM encryption algorithms.
|
|
82
|
+
*
|
|
83
|
+
* @see {drivers} in define_config.ts for detailed documentation
|
|
84
|
+
*/
|
|
85
|
+
export { drivers } from './define_config.ts';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "../../config_provider-DWVFHOQX.js";
|
|
2
|
+
import "../../exceptions-DNMesP42.js";
|
|
3
|
+
import { n as drivers, t as defineConfig } from "../../define_config-BvoRgVYO.js";
|
|
4
|
+
import { i as Hmac, n as Encryption, r as EncryptionManager, t as BaseDriver } from "../../main-Bfnr5tAw.js";
|
|
5
|
+
export { BaseDriver, Encryption, EncryptionManager, Hmac, defineConfig, drivers };
|
package/build/modules/events.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "../../chunk-MjwdjG2f.js";
|
|
2
|
-
import "../../
|
|
3
|
-
import "../../
|
|
4
|
-
import { n as defineConfig, r as drivers } from "../../main-BrJQ1VAM.js";
|
|
2
|
+
import "../../config_provider-DWVFHOQX.js";
|
|
3
|
+
import { n as defineConfig, r as drivers } from "../../main-BPDqyZic.js";
|
|
5
4
|
export * from "@adonisjs/hash";
|
|
6
5
|
export { defineConfig, drivers };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { VineValidator } from '@vinejs/vine';
|
|
2
2
|
import type { Infer, SchemaTypes, ErrorReporterContract, MessagesProviderContact } from '@vinejs/vine/types';
|
|
3
3
|
import type { HttpContext } from './main.ts';
|
|
4
|
-
import type { FeatureFlags } from '../app.ts';
|
|
5
|
-
import type { ExperimentalFlagsList } from '../../types/app.ts';
|
|
6
4
|
import type { RequestValidationOptions } from '../../types/http.ts';
|
|
7
5
|
/**
|
|
8
6
|
* Request validator for validating HTTP request data using VineJS validators.
|
|
@@ -19,7 +17,7 @@ import type { RequestValidationOptions } from '../../types/http.ts';
|
|
|
19
17
|
*/
|
|
20
18
|
export declare class RequestValidator {
|
|
21
19
|
#private;
|
|
22
|
-
constructor(ctx: HttpContext
|
|
20
|
+
constructor(ctx: HttpContext);
|
|
23
21
|
/**
|
|
24
22
|
* The error reporter method returns the error reporter
|
|
25
23
|
* to use for reporting errors.
|
package/build/modules/logger.js
CHANGED
package/build/modules/repl.js
CHANGED
|
@@ -116,14 +116,15 @@ export default class AppServiceProvider {
|
|
|
116
116
|
*/
|
|
117
117
|
protected registerEmitter(): void;
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
119
|
+
* Registers the encryption service with the container
|
|
120
120
|
*
|
|
121
|
-
* Creates
|
|
122
|
-
* the
|
|
121
|
+
* Creates singleton bindings for both the encryption manager and
|
|
122
|
+
* the default encryption instance. Resolves configuration from
|
|
123
|
+
* config/encryption.ts file.
|
|
123
124
|
*
|
|
124
125
|
* @example
|
|
125
126
|
* const encryption = await container.make('encryption')
|
|
126
|
-
* const encrypted = encryption.encrypt('
|
|
127
|
+
* const encrypted = encryption.encrypt('secret-data')
|
|
127
128
|
*/
|
|
128
129
|
protected registerEncryption(): void;
|
|
129
130
|
/**
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import "../chunk-MjwdjG2f.js";
|
|
2
|
+
import { t as configProvider } from "../config_provider-DWVFHOQX.js";
|
|
2
3
|
import { t as app_exports } from "../app-BK0PN3li.js";
|
|
3
|
-
import { t as config_exports } from "../config-
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
4
|
+
import { t as config_exports } from "../config-BwupGyeJ.js";
|
|
5
|
+
import { t as events_exports } from "../events-BW2flEef.js";
|
|
6
|
+
import { t as logger_exports } from "../logger-C2asB8px.js";
|
|
7
|
+
import { t as Dumper } from "../dumper-D29dE_xc.js";
|
|
8
|
+
import { t as main_exports } from "../main-BA5_XHM0.js";
|
|
9
|
+
import { r as RuntimeException } from "../exceptions-DNMesP42.js";
|
|
10
|
+
import "../define_config-BvoRgVYO.js";
|
|
11
|
+
import { n as Encryption } from "../main-Bfnr5tAw.js";
|
|
12
|
+
import { t as main_exports$1 } from "../main-CP75MhEW.js";
|
|
13
|
+
import { t as bodyparser_middleware_default } from "../bodyparser_middleware-BmARtnYe.js";
|
|
11
14
|
import { dirname } from "node:path";
|
|
12
15
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
13
16
|
var AppServiceProvider = class {
|
|
@@ -22,7 +25,7 @@ var AppServiceProvider = class {
|
|
|
22
25
|
}
|
|
23
26
|
registerAce() {
|
|
24
27
|
this.app.container.singleton("ace", async () => {
|
|
25
|
-
const { createAceKernel } = await import("../create_kernel-
|
|
28
|
+
const { createAceKernel } = await import("../create_kernel-Cn8zVtvt.js");
|
|
26
29
|
return createAceKernel(this.app);
|
|
27
30
|
});
|
|
28
31
|
}
|
|
@@ -52,15 +55,20 @@ var AppServiceProvider = class {
|
|
|
52
55
|
this.app.container.alias("emitter", events_exports.Emitter);
|
|
53
56
|
}
|
|
54
57
|
registerEncryption() {
|
|
55
|
-
this.app.container.singleton(
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
+
this.app.container.singleton("encryption", async () => {
|
|
59
|
+
const encryptionConfigProvider = this.app.config.get("encryption");
|
|
60
|
+
const config = await configProvider.resolve(this.app, encryptionConfigProvider);
|
|
61
|
+
if (!config) throw new RuntimeException("Invalid \"config/encryption.ts\" file. Make sure you are using the \"defineConfig\" method");
|
|
62
|
+
const { EncryptionManager } = await import("../modules/encryption/main.js");
|
|
63
|
+
return new EncryptionManager(config);
|
|
64
|
+
});
|
|
65
|
+
this.app.container.singleton(Encryption, async (resolver) => {
|
|
66
|
+
return (await resolver.make("encryption")).use();
|
|
58
67
|
});
|
|
59
|
-
this.app.container.alias("encryption", encryption_exports.Encryption);
|
|
60
68
|
}
|
|
61
69
|
registerServer() {
|
|
62
70
|
this.app.container.singleton(main_exports.Server, async (resolver) => {
|
|
63
|
-
const encryption = await resolver.make(
|
|
71
|
+
const encryption = await resolver.make(Encryption);
|
|
64
72
|
const emitter = await resolver.make("emitter");
|
|
65
73
|
const logger = await resolver.make("logger");
|
|
66
74
|
const config = this.app.config.get("app.http");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-MjwdjG2f.js";
|
|
2
|
-
import { t as main_exports } from "../main-
|
|
3
|
-
import { t as pluginEdgeDumper } from "../edge-
|
|
2
|
+
import { t as main_exports } from "../main-BA5_XHM0.js";
|
|
3
|
+
import { t as pluginEdgeDumper } from "../edge-BVYR-Vjr.js";
|
|
4
4
|
import edge from "edge.js";
|
|
5
5
|
var EdgeServiceProvider = class {
|
|
6
6
|
constructor(app) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "../chunk-MjwdjG2f.js";
|
|
2
|
-
import "../
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as main_exports } from "../main-BrJQ1VAM.js";
|
|
2
|
+
import { t as configProvider } from "../config_provider-DWVFHOQX.js";
|
|
3
|
+
import { t as main_exports } from "../main-BPDqyZic.js";
|
|
5
4
|
import { RuntimeException } from "@poppinss/utils/exception";
|
|
6
5
|
var HashServiceProvider = class {
|
|
7
6
|
constructor(app) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-MjwdjG2f.js";
|
|
2
|
-
import { t as repl_exports } from "../repl-
|
|
2
|
+
import { t as repl_exports } from "../repl-BF2TbFoO.js";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { fsImportAll } from "@poppinss/utils/fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-MjwdjG2f.js";
|
|
2
|
-
import { n as RequestValidator, t as main_exports } from "../main-
|
|
3
|
-
import { t as VineMultipartFile } from "../vine-
|
|
2
|
+
import { n as RequestValidator, t as main_exports } from "../main-BA5_XHM0.js";
|
|
3
|
+
import { t as VineMultipartFile } from "../vine-DGint2rk.js";
|
|
4
4
|
import { Vine } from "@vinejs/vine";
|
|
5
5
|
var VineJSServiceProvider = class {
|
|
6
6
|
constructor(app) {
|
|
@@ -8,12 +8,11 @@ var VineJSServiceProvider = class {
|
|
|
8
8
|
this.app.usingVineJS = true;
|
|
9
9
|
}
|
|
10
10
|
boot() {
|
|
11
|
-
const experimentalFlags = this.app.experimentalFlags;
|
|
12
11
|
Vine.macro("file", function(options) {
|
|
13
12
|
return new VineMultipartFile(options);
|
|
14
13
|
});
|
|
15
14
|
main_exports.HttpRequest.macro("validateUsing", function(...args) {
|
|
16
|
-
return new RequestValidator(this.ctx
|
|
15
|
+
return new RequestValidator(this.ctx).validateUsing(...args);
|
|
17
16
|
});
|
|
18
17
|
}
|
|
19
18
|
};
|
package/build/src/debug.d.ts
CHANGED
package/build/src/exceptions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as createError, n as InvalidArgumentsException, r as RuntimeException, t as Exception } from "../exceptions-DNMesP42.js";
|
|
2
2
|
export { Exception, InvalidArgumentsException, RuntimeException, createError };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as VerificationToken } from "../../verification_token-
|
|
1
|
+
import { t as VerificationToken } from "../../verification_token-DrdoU4RH.js";
|
|
2
2
|
import { fsImportAll, fsReadAll } from "@poppinss/utils/fs";
|
|
3
3
|
import base64 from "@poppinss/utils/base64";
|
|
4
4
|
import { MessageBuilder, Secret, compose, defineStaticProperty, safeEqual } from "@poppinss/utils";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as string_default } from "../../string-
|
|
1
|
+
import { t as string_default } from "../../string-Cx6q_win.js";
|
|
2
2
|
export { string_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as VerificationToken } from "../../verification_token-
|
|
1
|
+
import { t as VerificationToken } from "../../verification_token-DrdoU4RH.js";
|
|
2
2
|
export { VerificationToken };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import "../../chunk-MjwdjG2f.js";
|
|
2
|
-
import "../../
|
|
3
|
-
import "../../main-
|
|
4
|
-
import
|
|
2
|
+
import "../../config_provider-DWVFHOQX.js";
|
|
3
|
+
import "../../main-BA5_XHM0.js";
|
|
4
|
+
import "../../exceptions-DNMesP42.js";
|
|
5
|
+
import "../../define_config-BvoRgVYO.js";
|
|
6
|
+
import "../../main-Bfnr5tAw.js";
|
|
7
|
+
import { t as TestUtils } from "../../main-TtUIT86D.js";
|
|
5
8
|
export { TestUtils };
|
package/build/src/types.d.ts
CHANGED
|
@@ -8,11 +8,12 @@ import type { HttpServerEvents, LookupList, RoutesList, SignedURLOptions, UrlFor
|
|
|
8
8
|
import type { Dumper } from '../modules/dumper/dumper.ts';
|
|
9
9
|
import type { LoggerManager } from '../modules/logger.ts';
|
|
10
10
|
import type { HashManager } from '../modules/hash/main.ts';
|
|
11
|
-
import type { Encryption } from '../modules/encryption.ts';
|
|
12
11
|
import type { ManagerDriverFactory } from '../types/hash.ts';
|
|
13
12
|
import type { Router, Server } from '../modules/http/main.ts';
|
|
13
|
+
import type { EncryptionManager } from '../modules/encryption/main.ts';
|
|
14
14
|
import type { ContainerResolveEventData } from '../types/container.ts';
|
|
15
15
|
import type { LoggerConfig, LoggerManagerConfig } from '../types/logger.ts';
|
|
16
|
+
import { type EncryptionDriverContract } from '../types/encryption.ts';
|
|
16
17
|
/**
|
|
17
18
|
* A config provider waits for the application to get booted
|
|
18
19
|
* and then resolves the config. It receives an instance
|
|
@@ -175,20 +176,64 @@ export interface LoggerService extends LoggerManager<LoggersList extends Record<
|
|
|
175
176
|
export interface EmitterService extends Emitter<EventsList> {
|
|
176
177
|
}
|
|
177
178
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
179
|
+
* A list of known encryptors inferred from the user config.
|
|
180
|
+
* This interface should be extended in user code to register
|
|
181
|
+
* custom encryptors.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* // Extending EncryptorsList in user code
|
|
185
|
+
* declare module '@adonisjs/core' {
|
|
186
|
+
* interface EncryptorsList {
|
|
187
|
+
* default: EncryptionConfig
|
|
188
|
+
* secondary: EncryptionConfig
|
|
189
|
+
* }
|
|
190
|
+
* }
|
|
191
|
+
*/
|
|
192
|
+
export interface EncryptorsList {
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Configuration object for encryption drivers. Defines how encryption
|
|
196
|
+
* and decryption should be performed with support for key rotation.
|
|
181
197
|
*
|
|
182
198
|
* @example
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
199
|
+
* const config: EncryptionConfig = {
|
|
200
|
+
* driver: (key) => new SecureEncryptor(key),
|
|
201
|
+
* keys: [
|
|
202
|
+
* 'new-encryption-key', // Used for encryption
|
|
203
|
+
* 'old-encryption-key' // Used only for decryption
|
|
204
|
+
* ]
|
|
205
|
+
* }
|
|
206
|
+
*/
|
|
207
|
+
export interface EncryptionConfig {
|
|
208
|
+
/**
|
|
209
|
+
* Factory function that creates a driver instance for a given key
|
|
210
|
+
* @param key - The encryption key to use
|
|
211
|
+
*/
|
|
212
|
+
driver: (key: string) => EncryptionDriverContract;
|
|
213
|
+
/**
|
|
214
|
+
* List of keys to use for encryption/decryption.
|
|
215
|
+
* The first key is used for encryption, all keys are tried for decryption.
|
|
216
|
+
*/
|
|
217
|
+
keys: string[];
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Encryption service is a singleton instance of the EncryptionManager
|
|
221
|
+
* registered in the container. It provides encryption and decryption
|
|
222
|
+
* functionality with support for multiple encryptors.
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* // Using encryption service in a controller
|
|
226
|
+
* export default class TokenController {
|
|
227
|
+
* async generate({ encryption }: { encryption: EncryptionService }) {
|
|
186
228
|
* const encrypted = encryption.encrypt('sensitive-data')
|
|
187
229
|
* const decrypted = encryption.decrypt(encrypted)
|
|
230
|
+
*
|
|
231
|
+
* // Using a specific encryptor
|
|
232
|
+
* const secondaryEncrypted = encryption.use('secondary').encrypt('data')
|
|
188
233
|
* }
|
|
189
234
|
* }
|
|
190
235
|
*/
|
|
191
|
-
export interface EncryptionService extends
|
|
236
|
+
export interface EncryptionService extends EncryptionManager<EncryptorsList extends Record<string, EncryptionConfig> ? EncryptorsList : never> {
|
|
192
237
|
}
|
|
193
238
|
/**
|
|
194
239
|
* Http server service added to the container as a singleton.
|
|
@@ -378,13 +423,25 @@ export type IndexEntitiesConfig = {
|
|
|
378
423
|
/** Path segments to skip from generated keys. Defaults to ['events'] */
|
|
379
424
|
skipSegments?: string[];
|
|
380
425
|
};
|
|
426
|
+
/** Configuration for transformers indexing */
|
|
381
427
|
transformers?: {
|
|
428
|
+
/** Whether to enable transformers indexing */
|
|
382
429
|
enabled?: boolean;
|
|
430
|
+
/** Whether to include shared props in transformers */
|
|
383
431
|
withSharedProps?: boolean;
|
|
432
|
+
/** Source directory for transformers */
|
|
384
433
|
source?: string;
|
|
434
|
+
/** Import alias for transformers */
|
|
385
435
|
importAlias?: string;
|
|
436
|
+
/** Glob patterns for matching transformer files */
|
|
386
437
|
glob?: string[];
|
|
387
438
|
/** Path segments to skip from generated keys. Defaults to ['transformers'] */
|
|
388
439
|
skipSegments?: string[];
|
|
389
440
|
};
|
|
441
|
+
/** Configuration for manifest generation */
|
|
442
|
+
manifest?: {
|
|
443
|
+
/** Whether to enable manifest generation */
|
|
444
|
+
enabled?: boolean;
|
|
445
|
+
include?: string[];
|
|
446
|
+
};
|
|
390
447
|
};
|
package/build/src/vine.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as VineMultipartFile } from "../vine-
|
|
1
|
+
import { t as VineMultipartFile } from "../vine-DGint2rk.js";
|
|
2
2
|
export { VineMultipartFile };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as Ignitor } from "./main-
|
|
2
|
-
import { t as IgnitorFactory } from "./ignitor-
|
|
3
|
-
import { t as TestUtils } from "./main-
|
|
1
|
+
import { t as Ignitor } from "./main-B3Y59dQ2.js";
|
|
2
|
+
import { t as IgnitorFactory } from "./ignitor-BAHDhsmQ.js";
|
|
3
|
+
import { t as TestUtils } from "./main-TtUIT86D.js";
|
|
4
4
|
var TestUtilsFactory = class {
|
|
5
5
|
create(ignitorOrAppRoot, options) {
|
|
6
6
|
if (ignitorOrAppRoot instanceof Ignitor) return new TestUtils(ignitorOrAppRoot.createApp("test"));
|
package/build/toolkit/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as __decorate } from "../decorate-
|
|
2
|
+
import { t as __decorate } from "../decorate-CJcHOoD-.js";
|
|
3
3
|
import { BaseCommand, HelpCommand, IndexGenerator, Kernel, ListLoader, args } from "@adonisjs/ace";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
var IndexCommand = class extends BaseCommand {
|
|
@@ -1 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Contract that all encryption drivers must implement.
|
|
3
|
+
*
|
|
4
|
+
* Defines the interface for encrypting and decrypting values, including
|
|
5
|
+
* support for optional purpose binding and child key derivation.
|
|
6
|
+
*/
|
|
7
|
+
export type { EncryptionDriverContract } from '@boringnode/encryption/types';
|
|
8
|
+
/**
|
|
9
|
+
* Factory function signature for creating encryption driver instances.
|
|
10
|
+
*
|
|
11
|
+
* The factory receives an encryption key and returns a configured
|
|
12
|
+
* driver instance. This pattern allows the manager to create drivers
|
|
13
|
+
* on-demand with different keys.
|
|
14
|
+
*/
|
|
15
|
+
export type { ManagerDriverFactory } from '@boringnode/encryption/types';
|
|
16
|
+
/**
|
|
17
|
+
* Configuration options for the AES-256-CBC encryption driver.
|
|
18
|
+
*
|
|
19
|
+
* Includes the driver identifier and a list of encryption keys.
|
|
20
|
+
* The first key is used for encryption, while all keys are tried
|
|
21
|
+
* for decryption (allowing for key rotation).
|
|
22
|
+
*/
|
|
23
|
+
export type { AES256CBCDriverConfig } from '@boringnode/encryption/drivers/aes_256_cbc';
|
|
24
|
+
/**
|
|
25
|
+
* Configuration options for the AES-256-GCM encryption driver.
|
|
26
|
+
*
|
|
27
|
+
* Includes the driver identifier and a list of encryption keys.
|
|
28
|
+
* The first key is used for encryption, while all keys are tried
|
|
29
|
+
* for decryption (allowing for key rotation).
|
|
30
|
+
*/
|
|
31
|
+
export type { AES256GCMDriverConfig } from '@boringnode/encryption/drivers/aes_256_gcm';
|
|
32
|
+
/**
|
|
33
|
+
* Configuration options for the ChaCha20-Poly1305 encryption driver.
|
|
34
|
+
*
|
|
35
|
+
* Includes the driver identifier and a list of encryption keys.
|
|
36
|
+
* The first key is used for encryption, while all keys are tried
|
|
37
|
+
* for decryption (allowing for key rotation).
|
|
38
|
+
*/
|
|
39
|
+
export type { ChaCha20Poly1305DriverConfig } from '@boringnode/encryption/drivers/chacha20_poly1305';
|
|
@@ -10,6 +10,7 @@ async function importTypeScript(app) {
|
|
|
10
10
|
}
|
|
11
11
|
async function outputTransformerDataObjects(transformersList, buffer, withSharedProps) {
|
|
12
12
|
const importsBuffer = buffer.create();
|
|
13
|
+
importsBuffer.write(`/// <reference path="./manifest.d.ts" />`);
|
|
13
14
|
importsBuffer.write(`import type { InferData, InferVariants } from '@adonisjs/core/types/transformers'`);
|
|
14
15
|
if (withSharedProps) importsBuffer.write(`import type { InferSharedProps } from '@adonisjs/inertia/types'`);
|
|
15
16
|
buffer.writeLine(importsBuffer);
|