@acmekit/secrets-local 2.13.53

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.
@@ -0,0 +1,11 @@
1
+ import { ModuleExports } from "@acmekit/framework/types";
2
+ declare const moduleDefinition: ModuleExports;
3
+ export default moduleDefinition;
4
+ export * from "./initialize";
5
+ export * from "./types";
6
+ /**
7
+ * Bootstrap injection hook called by `secretsBootstrapLoader` before modules initialize.
8
+ * The local provider is a no-op here — `process.env` is already populated by `loadEnv()`.
9
+ */
10
+ export declare function bootstrapInject(): Promise<void>;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAOxD,QAAA,MAAM,gBAAgB,EAAE,aAGvB,CAAA;AAED,eAAe,gBAAgB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AAEvB;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAErD"}
package/dist/index.js ADDED
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.bootstrapInject = bootstrapInject;
21
+ const loaders_1 = __importDefault(require("./loaders"));
22
+ const local_secrets_1 = __importDefault(require("./services/local-secrets"));
23
+ const service = local_secrets_1.default;
24
+ const loaders = [loaders_1.default];
25
+ const moduleDefinition = {
26
+ service,
27
+ loaders,
28
+ };
29
+ exports.default = moduleDefinition;
30
+ __exportStar(require("./initialize"), exports);
31
+ __exportStar(require("./types"), exports);
32
+ /**
33
+ * Bootstrap injection hook called by `secretsBootstrapLoader` before modules initialize.
34
+ * The local provider is a no-op here — `process.env` is already populated by `loadEnv()`.
35
+ */
36
+ async function bootstrapInject() {
37
+ // no-op: local provider reads directly from process.env at runtime
38
+ }
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,0CAEC;AArBD,wDAA8B;AAC9B,6EAA0D;AAE1D,MAAM,OAAO,GAAG,uBAAmB,CAAA;AACnC,MAAM,OAAO,GAAG,CAAC,iBAAM,CAAC,CAAA;AAExB,MAAM,gBAAgB,GAAkB;IACtC,OAAO;IACP,OAAO;CACR,CAAA;AAED,kBAAe,gBAAgB,CAAA;AAC/B,+CAA4B;AAC5B,0CAAuB;AAEvB;;;GAGG;AACI,KAAK,UAAU,eAAe;IACnC,mEAAmE;AACrE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ExternalModuleDeclaration, ISecretsModuleService } from "@acmekit/framework/types";
2
+ import { LocalSecretsModuleOptions } from "../types";
3
+ export declare const initialize: (options?: LocalSecretsModuleOptions | ExternalModuleDeclaration) => Promise<ISecretsModuleService>;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EAEtB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAEpD,eAAO,MAAM,UAAU,GACrB,UAAU,yBAAyB,GAAG,yBAAyB,KAC9D,OAAO,CAAC,qBAAqB,CAW/B,CAAA"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initialize = void 0;
4
+ const modules_sdk_1 = require("@acmekit/framework/modules-sdk");
5
+ const utils_1 = require("@acmekit/framework/utils");
6
+ const initialize = async (options) => {
7
+ const serviceKey = utils_1.Modules.SECRETS;
8
+ const loaded = await modules_sdk_1.AcmeKitModule.bootstrap({
9
+ moduleKey: serviceKey,
10
+ defaultPath: "@acmekit/acmekit/secrets-local",
11
+ declaration: options,
12
+ });
13
+ return loaded[serviceKey];
14
+ };
15
+ exports.initialize = initialize;
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":";;;AAAA,gEAA8D;AAM9D,oDAAkD;AAG3C,MAAM,UAAU,GAAG,KAAK,EAC7B,OAA+D,EAC/B,EAAE;IAClC,MAAM,UAAU,GAAG,eAAO,CAAC,OAAO,CAAA;IAClC,MAAM,MAAM,GAAG,MAAM,2BAAa,CAAC,SAAS,CAAwB;QAClE,SAAS,EAAE,UAAU;QACrB,WAAW,EAAE,gCAAgC;QAC7C,WAAW,EAAE,OAEgB;KAC9B,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,UAAU,CAAC,CAAA;AAC3B,CAAC,CAAA;AAbY,QAAA,UAAU,cAatB"}
@@ -0,0 +1,4 @@
1
+ import { LoaderOptions } from "@acmekit/framework/types";
2
+ declare const _default: ({ logger }: LoaderOptions) => Promise<void>;
3
+ export default _default;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;yBAElC,YAAY,aAAa,KAAG,OAAO,CAAC,IAAI,CAAC;AAA/D,wBAKC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = async ({ logger }) => {
4
+ logger?.warn("Local Secrets provider is active. Secrets are read from process.env. " +
5
+ "Configure @acmekit/secrets-aws or another provider for production.");
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":";;AAEA,kBAAe,KAAK,EAAE,EAAE,MAAM,EAAiB,EAAiB,EAAE;IAChE,MAAM,EAAE,IAAI,CACV,uEAAuE;QACrE,oEAAoE,CACvE,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { default as LocalSecretsService } from "./local-secrets";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.LocalSecretsService = void 0;
7
+ var local_secrets_1 = require("./local-secrets");
8
+ Object.defineProperty(exports, "LocalSecretsService", { enumerable: true, get: function () { return __importDefault(local_secrets_1).default; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAgE;AAAvD,qIAAA,OAAO,OAAuB"}
@@ -0,0 +1,20 @@
1
+ import { ISecretsModuleService, SecretGetOptions } from "@acmekit/framework/types";
2
+ import { LocalSecretsModuleOptions } from "../types";
3
+ type InjectedDependencies = {};
4
+ /**
5
+ * Default secrets provider that reads from `process.env`.
6
+ * Suitable for development. Use `@acmekit/secrets-aws` or another
7
+ * provider in production.
8
+ *
9
+ * Since `loadEnv()` populates `process.env` before modules initialize,
10
+ * this provider requires no configuration and has no external dependencies.
11
+ */
12
+ declare class LocalSecretsService implements ISecretsModuleService {
13
+ constructor(_deps: InjectedDependencies, _options?: LocalSecretsModuleOptions);
14
+ get(secretId: string, _options?: SecretGetOptions): Promise<string | null>;
15
+ getJSON<T>(secretId: string, _options?: SecretGetOptions): Promise<T | null>;
16
+ getKey(secretId: string, key: string, options?: SecretGetOptions): Promise<string | null>;
17
+ invalidate(_secretId: string): void;
18
+ }
19
+ export default LocalSecretsService;
20
+ //# sourceMappingURL=local-secrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-secrets.d.ts","sourceRoot":"","sources":["../../src/services/local-secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAEpD,KAAK,oBAAoB,GAAG,EAAE,CAAA;AAE9B;;;;;;;GAOG;AACH,cAAM,mBAAoB,YAAW,qBAAqB;gBAEtD,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,GAAE,yBAA8B;IAGpC,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAI1E,OAAO,CAAC,CAAC,EACb,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAYd,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAMzB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CACpC;AAED,eAAe,mBAAmB,CAAA"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Default secrets provider that reads from `process.env`.
5
+ * Suitable for development. Use `@acmekit/secrets-aws` or another
6
+ * provider in production.
7
+ *
8
+ * Since `loadEnv()` populates `process.env` before modules initialize,
9
+ * this provider requires no configuration and has no external dependencies.
10
+ */
11
+ class LocalSecretsService {
12
+ constructor(_deps, _options = {}) { }
13
+ async get(secretId, _options) {
14
+ return process.env[secretId] ?? null;
15
+ }
16
+ async getJSON(secretId, _options) {
17
+ const value = process.env[secretId];
18
+ if (value === undefined) {
19
+ return null;
20
+ }
21
+ try {
22
+ return JSON.parse(value);
23
+ }
24
+ catch {
25
+ return null;
26
+ }
27
+ }
28
+ async getKey(secretId, key, options) {
29
+ const json = await this.getJSON(secretId, options);
30
+ return json?.[key] ?? null;
31
+ }
32
+ // No-op: local provider has no cache to invalidate
33
+ invalidate(_secretId) { }
34
+ }
35
+ exports.default = LocalSecretsService;
36
+ //# sourceMappingURL=local-secrets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-secrets.js","sourceRoot":"","sources":["../../src/services/local-secrets.ts"],"names":[],"mappings":";;AAQA;;;;;;;GAOG;AACH,MAAM,mBAAmB;IACvB,YACE,KAA2B,EAC3B,WAAsC,EAAE,IACvC,CAAC;IAEJ,KAAK,CAAC,GAAG,CAAC,QAAgB,EAAE,QAA2B;QACrD,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,OAAO,CACX,QAAgB,EAChB,QAA2B;QAE3B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACnC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,IAAI,CAAA;QACb,CAAC;QACD,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAM,CAAA;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CACV,QAAgB,EAChB,GAAW,EACX,OAA0B;QAE1B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAyB,QAAQ,EAAE,OAAO,CAAC,CAAA;QAC1E,OAAO,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAA;IAC5B,CAAC;IAED,mDAAmD;IACnD,UAAU,CAAC,SAAiB,IAAS,CAAC;CACvC;AAED,kBAAe,mBAAmB,CAAA"}
@@ -0,0 +1 @@
1
+ {"root":["../src/index.ts","../src/initialize/index.ts","../src/loaders/index.ts","../src/services/index.ts","../src/services/local-secrets.ts","../src/services/__tests__/local-secrets.spec.ts","../src/types/index.ts"],"version":"5.9.3"}
@@ -0,0 +1,8 @@
1
+ export type LocalSecretsModuleOptions = {};
2
+ declare module "@acmekit/types" {
3
+ interface ModuleOptions {
4
+ "@acmekit/secrets-local": LocalSecretsModuleOptions;
5
+ "@acmekit/acmekit/secrets-local": LocalSecretsModuleOptions;
6
+ }
7
+ }
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yBAAyB,GAAG,EAGvC,CAAA;AAED,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,aAAa;QACrB,wBAAwB,EAAE,yBAAyB,CAAA;QACnD,gCAAgC,EAAE,yBAAyB,CAAA;KAC5D;CACF"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@acmekit/secrets-local",
3
+ "version": "2.13.53",
4
+ "description": "Local (process.env) Secrets Module for AcmeKit — default development provider",
5
+ "main": "dist/index.js",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/acmekit/acmekit",
9
+ "directory": "packages/modules/secrets-local"
10
+ },
11
+ "engines": {
12
+ "node": ">=20"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "!dist/**/__tests__",
20
+ "!dist/**/__mocks__",
21
+ "!dist/**/__fixtures__"
22
+ ],
23
+ "author": "AcmeKit",
24
+ "license": "MIT",
25
+ "scripts": {
26
+ "watch": "yarn run -T tsc --build --watch",
27
+ "build": "yarn run -T rimraf dist && yarn run -T tsc --build",
28
+ "test": "../../../node_modules/.bin/jest --passWithNoTests"
29
+ },
30
+ "devDependencies": {
31
+ "@acmekit/framework": "2.13.53"
32
+ },
33
+ "peerDependencies": {
34
+ "@acmekit/framework": "2.13.53"
35
+ }
36
+ }