@adonis-agora/config 0.5.4 → 0.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @adonis-agora/config
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#22](https://github.com/DavideCarvalho/adonis-agora-config/pull/22) [`1330550`](https://github.com/DavideCarvalho/adonis-agora-config/commit/1330550e8c25296f647f5743ce9438b7b4ce25bd) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - `importRemoteConfig(appRoot, (env) => options)` in `@adonis-agora/config/bootstrap`: called at the top of `start/env.ts`, it brings the app's configuration into `process.env` before `Env.create` validates it, like Spring's `spring.config.import`. Precedence: process env, then `.env` files, then the server. With authkit-client installed, an issuer plus a service client is enough: the token, the server URL (from discovery) and the app name (from the token) are found for you. Without credentials it does nothing. With the server down, it boots on the snapshot or on the local environment.
8
+
3
9
  ## 0.5.4
4
10
 
5
11
  ### Patch Changes
@@ -32,4 +32,6 @@ export interface BootstrapResult {
32
32
  * configures. The client is cached; the provider reuses it instead of fetching twice.
33
33
  */
34
34
  export declare function bootstrapConfig(options: BootstrapOptions): Promise<BootstrapResult>;
35
+ export type { ImportRemoteConfigOptions, ImportRemoteConfigResult, LocalEnv, } from './import_remote.js';
36
+ export { CONFIG_RESOURCE, importRemoteConfig } from './import_remote.js';
35
37
  //# sourceMappingURL=bootstrap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EAEzB,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,wGAAwG;IACxG,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,2EAA2E;IAC3E,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAWzF"}
1
+ {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EAEzB,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,wGAAwG;IACxG,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,2EAA2E;IAC3E,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAWzF;AAED,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,QAAQ,GACT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -32,4 +32,5 @@ export async function bootstrapConfig(options) {
32
32
  version: status.version,
33
33
  };
34
34
  }
35
+ export { CONFIG_RESOURCE, importRemoteConfig } from './import_remote.js';
35
36
  //# sourceMappingURL=bootstrap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,E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AC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM;QAC7C,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC;AAOD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,76 @@
1
+ import { type TenantClient } from './topology/tenant_client.js';
2
+ import type { TenantTokenSource } from './topology/token.js';
3
+ /** The resource indicator of the config control plane in authkit. */
4
+ export declare const CONFIG_RESOURCE = "urn:agora:config";
5
+ /** What {@link importRemoteConfig} needs, read from the local environment by the app. */
6
+ export interface ImportRemoteConfigOptions {
7
+ /**
8
+ * The authkit issuer the service token comes from. With `clientId`/`clientSecret` and
9
+ * `@adonis-agora/authkit-client` installed, the token is fetched and refreshed for you.
10
+ */
11
+ issuer?: string | undefined;
12
+ clientId?: string | undefined;
13
+ clientSecret?: string | undefined;
14
+ /** A token instead of the three above (a string, or a function returning one). */
15
+ token?: TenantTokenSource | undefined;
16
+ /**
17
+ * The config server. Default: what the issuer publishes for `urn:agora:config` in its discovery
18
+ * document (`agora_control_planes`).
19
+ */
20
+ url?: string | undefined;
21
+ /** This app's name. Default: the `partition` of the service token. */
22
+ partition?: string | undefined;
23
+ /** Default `production`. */
24
+ environment?: string | undefined;
25
+ label?: string | undefined;
26
+ /**
27
+ * The last document received, to boot with the server down. Relative paths are resolved
28
+ * against the app root. Default `tmp/config/snapshot.json`; `false` keeps none.
29
+ */
30
+ snapshotPath?: string | false | undefined;
31
+ /** How long the first fetch may take. Default 5000 ms. */
32
+ timeoutMs?: number | undefined;
33
+ }
34
+ export interface ImportRemoteConfigResult {
35
+ /** Where the values came from. */
36
+ source: 'remote' | 'snapshot' | 'none';
37
+ /** The variables set from the config server (not those already set locally). */
38
+ applied: string[];
39
+ /** Keys the server has that the local environment already sets (it wins). */
40
+ shadowed: string[];
41
+ version: number;
42
+ client: TenantClient;
43
+ }
44
+ /** The local environment: `process.env` and the app's `.env` files, as `Env.create` reads them. */
45
+ export type LocalEnv = Readonly<Record<string, string | undefined>>;
46
+ /**
47
+ * Brings the app's configuration from the config server into `process.env` **before**
48
+ * `Env.create` validates it: the AdonisJS counterpart of Spring's `spring.config.import`, called at
49
+ * the top of `start/env.ts`.
50
+ *
51
+ * ```ts
52
+ * // start/env.ts
53
+ * await importRemoteConfig(new URL('../', import.meta.url), (env) => ({
54
+ * issuer: env.AUTHKIT_ISSUER,
55
+ * clientId: env.SERVICE_CLIENT_ID,
56
+ * clientSecret: env.SERVICE_CLIENT_SECRET,
57
+ * url: env.CONFIG_URL,
58
+ * }))
59
+ *
60
+ * export default await Env.create(new URL('../', import.meta.url), { … })
61
+ * ```
62
+ *
63
+ * Precedence, like Spring's default: **the process environment > the `.env` files > the config
64
+ * server**. The `.env` files are loaded first (the same files, in the same order, as `Env.create`),
65
+ * so a variable set locally is never replaced; the server only fills what is missing. Every value
66
+ * then goes through the app's env schema like any other.
67
+ *
68
+ * `options` is called with that local environment, so credentials may live in `.env` in
69
+ * development. Without credentials (no token, no issuer + client) nothing is fetched and the app
70
+ * boots on its local environment: tests and local dev keep working untouched.
71
+ *
72
+ * The server down: the last snapshot is used; without one, the app boots on its local environment
73
+ * and a warning is logged. The boot never fails because of the config server.
74
+ */
75
+ export declare function importRemoteConfig(appRoot: URL | string, options: ImportRemoteConfigOptions | ((env: LocalEnv) => ImportRemoteConfigOptions | undefined | null | false)): Promise<ImportRemoteConfigResult | null>;
76
+ //# sourceMappingURL=import_remote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import_remote.d.ts","sourceRoot":"","sources":["../../src/import_remote.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,qEAAqE;AACrE,eAAO,MAAM,eAAe,qBAAqB,CA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AG,IAAI,GAAG,KAAK,CAAC,GAC5E,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAiE1C"}
@@ -0,0 +1,160 @@
1
+ import { envNameOf, envValueOf } from '@adonis-agora/config-core';
2
+ import { EnvProcessor } from '@adonisjs/core/env';
3
+ import { createTenantClient, setTenantBootstrap, tenantBootstrapKey, } from './topology/tenant_client.js';
4
+ /** The resource indicator of the config control plane in authkit. */
5
+ export const CONFIG_RESOURCE = 'urn:agora:config';
6
+ /**
7
+ * Brings the app's configuration from the config server into `process.env` **before**
8
+ * `Env.create` validates it: the AdonisJS counterpart of Spring's `spring.config.import`, called at
9
+ * the top of `start/env.ts`.
10
+ *
11
+ * ```ts
12
+ * // start/env.ts
13
+ * await importRemoteConfig(new URL('../', import.meta.url), (env) => ({
14
+ * issuer: env.AUTHKIT_ISSUER,
15
+ * clientId: env.SERVICE_CLIENT_ID,
16
+ * clientSecret: env.SERVICE_CLIENT_SECRET,
17
+ * url: env.CONFIG_URL,
18
+ * }))
19
+ *
20
+ * export default await Env.create(new URL('../', import.meta.url), { … })
21
+ * ```
22
+ *
23
+ * Precedence, like Spring's default: **the process environment > the `.env` files > the config
24
+ * server**. The `.env` files are loaded first (the same files, in the same order, as `Env.create`),
25
+ * so a variable set locally is never replaced; the server only fills what is missing. Every value
26
+ * then goes through the app's env schema like any other.
27
+ *
28
+ * `options` is called with that local environment, so credentials may live in `.env` in
29
+ * development. Without credentials (no token, no issuer + client) nothing is fetched and the app
30
+ * boots on its local environment: tests and local dev keep working untouched.
31
+ *
32
+ * The server down: the last snapshot is used; without one, the app boots on its local environment
33
+ * and a warning is logged. The boot never fails because of the config server.
34
+ */
35
+ export async function importRemoteConfig(appRoot, options) {
36
+ const root = typeof appRoot === 'string' ? new URL(`file://${appRoot.replace(/\/?$/, '/')}`) : appRoot;
37
+ // The same files and order as `Env.create`: they land in `process.env` without replacing it.
38
+ await new EnvProcessor(root).process();
39
+ const local = { ...process.env };
40
+ const resolved = typeof options === 'function' ? options(local) : options;
41
+ if (!resolved)
42
+ return null;
43
+ const token = await tokenSource(resolved);
44
+ if (token === null)
45
+ return null;
46
+ const url = await urlSource(resolved);
47
+ if (url === null) {
48
+ warn('no config server URL (pass `url`, or an `issuer` that publishes urn:agora:config)');
49
+ return null;
50
+ }
51
+ const partition = resolved.partition ?? (await partitionFromToken(token));
52
+ if (!partition) {
53
+ warn('could not tell the app name (pass `partition`, or use a service token with one)');
54
+ return null;
55
+ }
56
+ const snapshot = resolved.snapshotPath === false
57
+ ? undefined
58
+ : (resolved.snapshotPath ?? 'tmp/config/snapshot.json');
59
+ const client = createTenantClient({
60
+ url,
61
+ partition,
62
+ token,
63
+ environment: resolved.environment ?? 'production',
64
+ ...(resolved.label !== undefined ? { label: resolved.label } : {}),
65
+ ...(snapshot !== undefined ? { snapshotPath: new URL(snapshot, root).pathname } : {}),
66
+ required: false,
67
+ onError: (error) => warn(`config server: ${error instanceof Error ? error.message : String(error)}`),
68
+ });
69
+ await withTimeout(client.start(), resolved.timeoutMs ?? 5000);
70
+ setTenantBootstrap(tenantBootstrapKey({
71
+ url,
72
+ partition,
73
+ environment: resolved.environment ?? 'production',
74
+ ...(resolved.label !== undefined ? { label: resolved.label } : {}),
75
+ }), client);
76
+ const applied = [];
77
+ const shadowed = [];
78
+ for (const [key, value] of Object.entries(client.values())) {
79
+ const name = envNameOf(key);
80
+ if (process.env[name] !== undefined) {
81
+ shadowed.push(name);
82
+ continue;
83
+ }
84
+ process.env[name] = envValueOf(value);
85
+ applied.push(name);
86
+ }
87
+ const status = client.status();
88
+ if (status.source === 'none') {
89
+ warn('config server unreachable and no snapshot: booting on the local environment');
90
+ }
91
+ return { source: status.source, applied, shadowed, version: status.version, client };
92
+ }
93
+ function warn(message) {
94
+ process.emitWarning(`[@adonis-agora/config] ${message}`);
95
+ }
96
+ async function withTimeout(promise, ms) {
97
+ let timer;
98
+ try {
99
+ await Promise.race([
100
+ promise,
101
+ new Promise((resolve) => {
102
+ timer = setTimeout(resolve, ms);
103
+ timer.unref?.();
104
+ }),
105
+ ]);
106
+ }
107
+ finally {
108
+ if (timer)
109
+ clearTimeout(timer);
110
+ }
111
+ }
112
+ async function authkitClient() {
113
+ try {
114
+ return (await import('@adonis-agora/authkit-client'));
115
+ }
116
+ catch {
117
+ return null;
118
+ }
119
+ }
120
+ async function tokenSource(options) {
121
+ if (options.token !== undefined)
122
+ return options.token;
123
+ const { issuer, clientId, clientSecret } = options;
124
+ if (!issuer || !clientId || !clientSecret)
125
+ return null;
126
+ const authkit = await authkitClient();
127
+ if (!authkit) {
128
+ warn('issuer + client given but @adonis-agora/authkit-client is not installed: pass `token`');
129
+ return null;
130
+ }
131
+ return authkit.authkitTenantToken({ issuer, clientId, clientSecret, resource: CONFIG_RESOURCE });
132
+ }
133
+ async function urlSource(options) {
134
+ if (options.url)
135
+ return options.url;
136
+ if (!options.issuer)
137
+ return null;
138
+ const authkit = await authkitClient();
139
+ if (!authkit)
140
+ return null;
141
+ return authkit.controlPlaneUrl({ issuer: options.issuer, resource: CONFIG_RESOURCE });
142
+ }
143
+ /** The `partition` claim of the service token (decoded, not verified: it is our own token). */
144
+ async function partitionFromToken(source) {
145
+ try {
146
+ const token = typeof source === 'string'
147
+ ? source
148
+ : typeof source === 'function'
149
+ ? await source()
150
+ : await source.get();
151
+ const payload = JSON.parse(Buffer.from(token.split('.')[1] ?? '', 'base64url').toString('utf8'));
152
+ return typeof payload?.partition === 'string' && payload.partition !== ''
153
+ ? payload.partition
154
+ : undefined;
155
+ }
156
+ catch {
157
+ return undefined;
158
+ }
159
+ }
160
+ //# sourceMappingURL=import_remote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import_remote.js","sourceRoot":"","sources":["../../src/import_remote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,kBAAkB,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+F;AAC/F,KAAK,UAAU,kBAAkB,CAAC,MAAyB;IACzD,IAAI,CAAC;QACH,MAAM,KAAK,GACT,OAAO,MAAM,KAAK,QAAQ;YACxB,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,OAAO,MAAM,KAAK,UAAU;gBAC5B,CAAC,CAAC,MAAM,MAAM,EAAE;gBAChB,CAAC,CAAC,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CACrE,CAAC;QACF,OAAO,OAAO,OAAO,EAAE,SAAS,KAAK,QAAQ,IAAI,OAAO,CAAC,SAAS,KAAK,EAAE;YACvE,CAAC,CAAC,OAAO,CAAC,SAAS;YACnB,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonis-agora/config",
3
- "version": "0.5.4",
3
+ "version": "0.6.0",
4
4
  "description": "Centralized configuration for AdonisJS apps, Spring Cloud Config style — one control plane, per-app per-environment documents with history and audit, tenants that boot from the server or a snapshot and hot-reload what can be reloaded. Part of the Agora ecosystem.",
5
5
  "license": "MIT",
6
6
  "repository": {