@runa-ai/runa-cli 0.5.28 → 0.5.31
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/dist/commands/ci/commands/ci-prod-apply.d.ts.map +1 -1
- package/dist/commands/ci/commands/ci-prod-db-operations.d.ts +4 -0
- package/dist/commands/ci/commands/ci-prod-db-operations.d.ts.map +1 -1
- package/dist/commands/ci/utils/env-security.d.ts +58 -0
- package/dist/commands/ci/utils/env-security.d.ts.map +1 -0
- package/dist/commands/ci/utils/execa-helpers.d.ts +4 -0
- package/dist/commands/ci/utils/execa-helpers.d.ts.map +1 -1
- package/dist/commands/ci/utils/github.d.ts +6 -0
- package/dist/commands/ci/utils/github.d.ts.map +1 -1
- package/dist/commands/ci/utils/pgtap-installer.d.ts +3 -0
- package/dist/commands/ci/utils/pgtap-installer.d.ts.map +1 -1
- package/dist/commands/ci/utils/rls-verification.d.ts +3 -0
- package/dist/commands/ci/utils/rls-verification.d.ts.map +1 -1
- package/dist/commands/ci/utils/workflow-idempotency.d.ts +90 -0
- package/dist/commands/ci/utils/workflow-idempotency.d.ts.map +1 -0
- package/dist/commands/db/apply/actors.d.ts.map +1 -1
- package/dist/commands/db/apply/helpers/advisory-lock.d.ts.map +1 -1
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts +4 -0
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts.map +1 -1
- package/dist/commands/db/commands/db-derive-role-passwords.d.ts.map +1 -1
- package/dist/commands/db/commands/db-derive-urls.d.ts.map +1 -1
- package/dist/commands/db/utils/psql.d.ts +57 -0
- package/dist/commands/db/utils/psql.d.ts.map +1 -1
- package/dist/commands/db/utils/seed-manager.d.ts +4 -0
- package/dist/commands/db/utils/seed-manager.d.ts.map +1 -1
- package/dist/commands/env/commands/setup/file-export.d.ts +12 -1
- package/dist/commands/env/commands/setup/file-export.d.ts.map +1 -1
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/config/env-files.d.ts +5 -0
- package/dist/config/env-files.d.ts.map +1 -1
- package/dist/config/env.d.ts +4 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/index.js +1294 -477
- package/dist/internal/vuln-checker/analyzers/secret-analyzer.d.ts +5 -0
- package/dist/internal/vuln-checker/analyzers/secret-analyzer.d.ts.map +1 -1
- package/dist/internal/vuln-checker/config/loader.d.ts.map +1 -1
- package/dist/utils/config-updater.d.ts +5 -0
- package/dist/utils/config-updater.d.ts.map +1 -1
- package/dist/utils/github-output-security.d.ts +36 -0
- package/dist/utils/github-output-security.d.ts.map +1 -0
- package/dist/utils/path-security.d.ts +98 -0
- package/dist/utils/path-security.d.ts.map +1 -0
- package/dist/utils/secure-exec.d.ts +22 -12
- package/dist/utils/secure-exec.d.ts.map +1 -1
- package/dist/utils/template-fetcher.d.ts +11 -0
- package/dist/utils/template-fetcher.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-prod-apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/commands/ci-prod-apply.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ci-prod-apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/commands/ci-prod-apply.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmUpC,eAAO,MAAM,kBAAkB,SA0G3B,CAAC"}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Purpose: Schema operations, snapshots, risks, audit
|
|
5
5
|
* Used by: ci-prod-apply.ts
|
|
6
|
+
*
|
|
7
|
+
* Security (Issue #458):
|
|
8
|
+
* - Uses getFilteredEnv() instead of ...process.env to prevent secret leakage
|
|
9
|
+
* - Database URLs passed as required secrets only to commands that need them
|
|
6
10
|
*/
|
|
7
11
|
export declare function detectStack(repoRoot: string, tmpDir: string, productionDbUrlAdmin: string): Promise<string>;
|
|
8
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-prod-db-operations.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/commands/ci-prod-db-operations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ci-prod-db-operations.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/commands/ci-prod-db-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAAC,MAAM,CAAC,CAejB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,kEAAkE;IAClE,mBAAmB,EAAE,OAAO,CAAC;IAC7B,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,GACtB,sBAAsB,CAmFxB;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgEpF;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuCjF;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,MAAM,EAC5B,MAAM,EAAE,MA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,OAAO,CAAC,IAAI,CAAC,CA0Ef;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE;IACN,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB,GACA,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Environment Variable Security Utilities
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Protect sensitive environment variables in CI contexts
|
|
5
|
+
* Security (Issue #458):
|
|
6
|
+
* - Filter sensitive env vars before passing to child processes
|
|
7
|
+
* - Redact secrets from debug logs
|
|
8
|
+
* - Centralized secret pattern definitions
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* - Use `getSafeEnv()` instead of `...process.env` for child processes
|
|
12
|
+
* - Use `redactSecrets()` before logging any strings that may contain secrets
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Check if an environment variable name is sensitive.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isSensitiveEnvVar(name: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Get a filtered environment object safe for child processes.
|
|
20
|
+
* Only includes whitelisted variables.
|
|
21
|
+
*
|
|
22
|
+
* @param additionalSafe - Additional variable names to include
|
|
23
|
+
* @param requiredSecrets - Secret names explicitly required (will be included but logged)
|
|
24
|
+
*/
|
|
25
|
+
export declare function getSafeEnv(additionalSafe?: string[], requiredSecrets?: string[]): NodeJS.ProcessEnv;
|
|
26
|
+
/**
|
|
27
|
+
* Get environment with all variables EXCEPT sensitive ones.
|
|
28
|
+
* Use this when you need most env vars but want to exclude secrets.
|
|
29
|
+
*
|
|
30
|
+
* CAUTION: This is less secure than getSafeEnv() but may be needed
|
|
31
|
+
* for compatibility with tools that require specific env vars.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getFilteredEnv(): NodeJS.ProcessEnv;
|
|
34
|
+
/**
|
|
35
|
+
* Redact sensitive values from a string for safe logging.
|
|
36
|
+
*
|
|
37
|
+
* @param input - The string to redact
|
|
38
|
+
* @returns The string with sensitive values replaced
|
|
39
|
+
*/
|
|
40
|
+
export declare function redactSecrets(input: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Create a safe debug logger that redacts secrets.
|
|
43
|
+
* Only logs when RUNA_DEBUG is set.
|
|
44
|
+
*
|
|
45
|
+
* @param prefix - Prefix for log messages
|
|
46
|
+
*/
|
|
47
|
+
export declare function createSafeDebugLogger(prefix: string): (message: string, data?: unknown) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Mask a value in GitHub Actions logs.
|
|
50
|
+
* The value will be replaced with *** in all subsequent logs.
|
|
51
|
+
*/
|
|
52
|
+
export declare function maskInGitHub(value: string | undefined): void;
|
|
53
|
+
/**
|
|
54
|
+
* Mask all sensitive environment variables in GitHub Actions.
|
|
55
|
+
* Call this early in CI execution.
|
|
56
|
+
*/
|
|
57
|
+
export declare function maskSensitiveEnvVars(): void;
|
|
58
|
+
//# sourceMappingURL=env-security.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-security.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/env-security.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAmHH;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,cAAc,GAAE,MAAM,EAAO,EAC7B,eAAe,GAAE,MAAM,EAAO,GAC7B,MAAM,CAAC,UAAU,CAmBnB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAAC,UAAU,CAUlD;AAqDD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYnD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAmB/F;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAI5D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAQ3C"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AI HINT: Execa helpers for CI orchestration
|
|
3
|
+
*
|
|
4
|
+
* Security (Issue #458):
|
|
5
|
+
* - Uses redactSecrets for comprehensive secret redaction in logs
|
|
6
|
+
* - Uses shell: false for all execa calls (defense in depth)
|
|
3
7
|
*/
|
|
4
8
|
import { type ResultPromise } from 'execa';
|
|
5
9
|
export declare function ensureRunaTmpDir(cwd?: string): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execa-helpers.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/execa-helpers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"execa-helpers.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/execa-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAS,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AA4ClD,wBAAsB,gBAAgB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKpE;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,aAAa,CAwBhB"}
|
|
@@ -8,7 +8,13 @@
|
|
|
8
8
|
* - PR context parsing
|
|
9
9
|
*
|
|
10
10
|
* All functions are no-op when not running in GitHub Actions.
|
|
11
|
+
*
|
|
12
|
+
* Security (Issue #458):
|
|
13
|
+
* - Re-exports maskSensitiveEnvVars for early CI initialization
|
|
14
|
+
* - Use addGithubMask for individual values
|
|
15
|
+
* - NEVER write secrets to GITHUB_OUTPUT
|
|
11
16
|
*/
|
|
17
|
+
export { maskSensitiveEnvVars, maskInGitHub } from './env-security.js';
|
|
12
18
|
/**
|
|
13
19
|
* Append markdown to GitHub Actions step summary.
|
|
14
20
|
* No-op when not running in GitHub Actions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/github.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/github.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMvE;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7E;AAMD;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAOrF;AAMD;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAOlF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAI7D;AAeD,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,eAAe,CAAC,CAcpE"}
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
* - Avoid hardcoding repo-specific roles/tables
|
|
9
9
|
* - Only probe standard Supabase roles (authenticated, service_role)
|
|
10
10
|
* - Best-effort: never fail CI if pgTAP is unavailable
|
|
11
|
+
*
|
|
12
|
+
* Security (Issue #458):
|
|
13
|
+
* - Uses getSafeEnv() to avoid passing secrets to child processes
|
|
11
14
|
*/
|
|
12
15
|
export interface PgTapInstallResult {
|
|
13
16
|
available: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pgtap-installer.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/pgtap-installer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pgtap-installer.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/pgtap-installer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CA6G7B"}
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
* - Only probe standard Supabase roles (authenticated, service_role)
|
|
9
9
|
* - Avoid hardcoding repo-specific roles/tables
|
|
10
10
|
* - Best-effort remediation: grant privileges when possible, skip when not
|
|
11
|
+
*
|
|
12
|
+
* Security (Issue #458):
|
|
13
|
+
* - Uses getSafeEnv() to avoid passing secrets to child processes
|
|
11
14
|
*/
|
|
12
15
|
export interface QueryScalarParams {
|
|
13
16
|
repoRoot: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rls-verification.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/rls-verification.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rls-verification.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/rls-verification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAU5E;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoF9F;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AA4BD;;;;;;;;;GASG;AACH,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAwDf;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC,CAazF"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Workflow Idempotency Check
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Prevent duplicate production deployments via commit-based idempotency
|
|
5
|
+
* Security: Uses PostgreSQL advisory lock + audit table check
|
|
6
|
+
*
|
|
7
|
+
* Pattern:
|
|
8
|
+
* 1. Acquire advisory lock to ensure single execution
|
|
9
|
+
* 2. Check audit table for existing deployment of this commit
|
|
10
|
+
* 3. Proceed only if this is a new deployment
|
|
11
|
+
*
|
|
12
|
+
* @see Issue #451 - Race condition in production schema deployment
|
|
13
|
+
*/
|
|
14
|
+
/** Unique lock ID for production deployments (distinct from migration lock) */
|
|
15
|
+
export declare const PROD_DEPLOY_LOCK_ID = 88889;
|
|
16
|
+
/** Unique lock ID for snapshot operations */
|
|
17
|
+
export declare const SNAPSHOT_LOCK_ID = 88890;
|
|
18
|
+
interface AdvisoryLockResult {
|
|
19
|
+
acquired: boolean;
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Acquire an advisory lock for a specific operation.
|
|
24
|
+
* Uses pg_try_advisory_lock for non-blocking acquisition.
|
|
25
|
+
*
|
|
26
|
+
* @param dbUrl - Database URL
|
|
27
|
+
* @param lockId - Unique lock identifier
|
|
28
|
+
* @returns Lock acquisition result
|
|
29
|
+
*/
|
|
30
|
+
export declare function acquireWorkflowLock(dbUrl: string, lockId: number): AdvisoryLockResult;
|
|
31
|
+
/**
|
|
32
|
+
* Release an advisory lock.
|
|
33
|
+
*
|
|
34
|
+
* @param dbUrl - Database URL
|
|
35
|
+
* @param lockId - Unique lock identifier
|
|
36
|
+
*/
|
|
37
|
+
export declare function releaseWorkflowLock(dbUrl: string, lockId: number): void;
|
|
38
|
+
interface IdempotencyCheckResult {
|
|
39
|
+
alreadyDeployed: boolean;
|
|
40
|
+
deployedAt?: string;
|
|
41
|
+
checkSuccessful: boolean;
|
|
42
|
+
error?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Check if a commit has already been deployed to production.
|
|
46
|
+
* Queries the audit table (if configured) to detect duplicate deployments.
|
|
47
|
+
*
|
|
48
|
+
* @param dbUrl - Database URL
|
|
49
|
+
* @param commit - Commit SHA to check
|
|
50
|
+
* @returns Idempotency check result
|
|
51
|
+
*/
|
|
52
|
+
export declare function checkDeploymentIdempotency(dbUrl: string, commit: string): IdempotencyCheckResult;
|
|
53
|
+
interface WorkflowGuardResult {
|
|
54
|
+
canProceed: boolean;
|
|
55
|
+
lockAcquired: boolean;
|
|
56
|
+
alreadyDeployed: boolean;
|
|
57
|
+
message: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Guard function for production deployment workflow.
|
|
61
|
+
* Combines lock acquisition and idempotency check.
|
|
62
|
+
*
|
|
63
|
+
* @param dbUrl - Database URL
|
|
64
|
+
* @param commit - Commit SHA being deployed
|
|
65
|
+
* @returns Guard result indicating if workflow can proceed
|
|
66
|
+
*/
|
|
67
|
+
export declare function guardProductionDeployment(dbUrl: string, commit: string): WorkflowGuardResult;
|
|
68
|
+
/**
|
|
69
|
+
* Cleanup function to ensure lock is released.
|
|
70
|
+
* Should be called in finally block or error handler.
|
|
71
|
+
*
|
|
72
|
+
* @param dbUrl - Database URL
|
|
73
|
+
* @param lockAcquired - Whether lock was acquired (from guardProductionDeployment)
|
|
74
|
+
*/
|
|
75
|
+
export declare function releaseProductionDeploymentLock(dbUrl: string, lockAcquired: boolean): void;
|
|
76
|
+
/**
|
|
77
|
+
* Guard for snapshot operations to prevent concurrent snapshots.
|
|
78
|
+
*
|
|
79
|
+
* @param dbUrl - Database URL
|
|
80
|
+
* @returns Whether lock was acquired
|
|
81
|
+
*/
|
|
82
|
+
export declare function acquireSnapshotLock(dbUrl: string): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Release snapshot operation lock.
|
|
85
|
+
*
|
|
86
|
+
* @param dbUrl - Database URL
|
|
87
|
+
*/
|
|
88
|
+
export declare function releaseSnapshotLock(dbUrl: string): void;
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=workflow-idempotency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-idempotency.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/workflow-idempotency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AAEtC,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,kBAAkB,CA0BrF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAYvE;AAED,UAAU,sBAAsB;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,sBAAsB,CA0DhG;AAED,UAAU,mBAAmB;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,mBAAmB,CA2C5F;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI,CAI1F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAG1D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/actors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/actors.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAuElD,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAwwBD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;WAExB,YAAY;eAAa,MAAM;gCAgCxC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;WAEnB,YAAY;eAAa,MAAM;gCA6DxC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;aACV,OAAO;;WACT,YAAY;eAAa,MAAM;gCAqDxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advisory-lock.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/advisory-lock.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"advisory-lock.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/advisory-lock.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,gFAAgF;AAChF,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAsB5E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAWzE"}
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
* - AUTHZ_UPDATE hazards for roles defined in idempotent/*.sql are filtered
|
|
9
9
|
* - Reason: idempotent files (e.g., 15_rbac_roles.sql) grant privileges that
|
|
10
10
|
* pg-schema-diff doesn't know about (it only manages declarative/*.sql)
|
|
11
|
+
*
|
|
12
|
+
* Security:
|
|
13
|
+
* - All psql calls use parsePostgresUrl + buildPsqlArgs to prevent SQL injection
|
|
14
|
+
* - Passwords are passed via PGPASSWORD env var, not command line
|
|
11
15
|
*/
|
|
12
16
|
import type { DbApplyInput } from '../contract.js';
|
|
13
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg-schema-diff-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/pg-schema-diff-helpers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pg-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AAO,EAAE,YAAY,EAAE,EACvB,OAAO,EAAE,OAAO,GACf;IAAE,cAAc,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAE,CAgCtD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAOzD;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI,CAgB3E;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAmBjF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAchE;AAMD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAyBjE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAsB1E;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,YAAY,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,cAAc,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAE,CAsDzE;AAMD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EAAE,EACxB,OAAO,EAAE,OAAO,GACf;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CA2C5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-derive-role-passwords.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-derive-role-passwords.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"db-derive-role-passwords.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-derive-role-passwords.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgCpC,eAAO,MAAM,0BAA0B,SA6BnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-derive-urls.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-derive-urls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"db-derive-urls.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-derive-urls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0GpC,eAAO,MAAM,iBAAiB,SAqB2D,CAAC"}
|
|
@@ -5,6 +5,63 @@ export interface PsqlConnectionParams {
|
|
|
5
5
|
database: string;
|
|
6
6
|
password?: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Parse a PostgreSQL URL into individual connection parameters.
|
|
10
|
+
* Used to pass parameters safely as separate arguments instead of a single URL.
|
|
11
|
+
*
|
|
12
|
+
* Security: This prevents command injection by avoiding shell interpolation
|
|
13
|
+
* of special characters in passwords or other URL components.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parsePostgresUrl(url: string): PsqlConnectionParams;
|
|
16
|
+
/**
|
|
17
|
+
* Build psql arguments from connection parameters.
|
|
18
|
+
* Avoids passing the full URL which could contain special characters.
|
|
19
|
+
*
|
|
20
|
+
* @param conn - Connection parameters
|
|
21
|
+
* @param options - Optional flags
|
|
22
|
+
* @returns Array of psql arguments
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildPsqlArgs(conn: PsqlConnectionParams, options?: {
|
|
25
|
+
onErrorStop?: boolean;
|
|
26
|
+
}): string[];
|
|
27
|
+
/**
|
|
28
|
+
* Build environment with PGPASSWORD if password is provided.
|
|
29
|
+
* Passing password via env var is safer than command line arguments.
|
|
30
|
+
*
|
|
31
|
+
* Security: Env vars are still captured in some contexts, but they are
|
|
32
|
+
* not visible in process listings (ps aux) unlike command line arguments.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildPsqlEnv(conn: PsqlConnectionParams): NodeJS.ProcessEnv;
|
|
35
|
+
/**
|
|
36
|
+
* Execute a psql command synchronously with safe parameter passing.
|
|
37
|
+
*
|
|
38
|
+
* @param params - Query parameters
|
|
39
|
+
* @returns Result with status, stdout, stderr
|
|
40
|
+
*/
|
|
41
|
+
export declare function psqlSyncQuery(params: {
|
|
42
|
+
databaseUrl: string;
|
|
43
|
+
sql: string;
|
|
44
|
+
timeout?: number;
|
|
45
|
+
}): {
|
|
46
|
+
status: number | null;
|
|
47
|
+
stdout: string;
|
|
48
|
+
stderr: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Execute a psql file synchronously with safe parameter passing.
|
|
52
|
+
*
|
|
53
|
+
* @param params - File execution parameters
|
|
54
|
+
* @returns Result with status, stdout, stderr
|
|
55
|
+
*/
|
|
56
|
+
export declare function psqlSyncFile(params: {
|
|
57
|
+
databaseUrl: string;
|
|
58
|
+
filePath: string;
|
|
59
|
+
onErrorStop?: boolean;
|
|
60
|
+
}): {
|
|
61
|
+
status: number | null;
|
|
62
|
+
stdout: string;
|
|
63
|
+
stderr: string;
|
|
64
|
+
};
|
|
8
65
|
export declare function psqlQuery(params: {
|
|
9
66
|
databaseUrl: string;
|
|
10
67
|
sql: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psql.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/utils/psql.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"psql.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/utils/psql.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW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CAAC,CAkBlB;AAED,wBAAsB,QAAQ,CAAC,MAAM,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAO1F"}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Purpose: Parse, apply, and validate seed data files
|
|
5
5
|
* Design: Config.toml parsing + psql execution
|
|
6
|
+
*
|
|
7
|
+
* Security:
|
|
8
|
+
* - Path traversal protection via validateSafePath
|
|
9
|
+
* - All user-provided paths are validated before use
|
|
6
10
|
*/
|
|
7
11
|
/**
|
|
8
12
|
* Parse seed paths from config.toml
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed-manager.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/utils/seed-manager.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"seed-manager.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/utils/seed-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAgC3D;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAalF;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBnE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAU3D"}
|
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
* Purpose: Write environment variables to file for review
|
|
5
5
|
* Extracted from: env-setup.ts (lines 1517-1585)
|
|
6
6
|
*
|
|
7
|
-
* SECURITY NOTES:
|
|
7
|
+
* SECURITY NOTES (Issue #461):
|
|
8
8
|
* - Temporary files are written with restrictive permissions (600)
|
|
9
9
|
* - Files contain sensitive credentials and should be deleted after use
|
|
10
10
|
* - Owner-only read/write prevents other users from accessing credentials
|
|
11
|
+
* - Cleanup registered with signal handlers for SIGINT/SIGTERM cleanup
|
|
12
|
+
* - cleanupEnvSetupFile() function exported for explicit cleanup
|
|
13
|
+
*
|
|
14
|
+
* @see Issue #461 - Sensitive data leakage in temporary files and error messages
|
|
11
15
|
*/
|
|
12
16
|
import type { createCLILogger } from '@runa-ai/runa';
|
|
13
17
|
import type { EnvVariable } from './types.js';
|
|
@@ -17,4 +21,11 @@ export declare const ENV_SETUP_TMP_FILE = ".env.setup-tmp";
|
|
|
17
21
|
* This allows users to review and manually register the values
|
|
18
22
|
*/
|
|
19
23
|
export declare function writeEnvSetupFile(envVars: EnvVariable[], drizzleAppPassword: string, drizzleServicePassword: string, logger: ReturnType<typeof createCLILogger>): void;
|
|
24
|
+
/**
|
|
25
|
+
* SECURITY (Issue #461): Cleanup the env setup temp file.
|
|
26
|
+
* Call this when the temp file is no longer needed.
|
|
27
|
+
*
|
|
28
|
+
* @returns true if file was deleted, false if file didn't exist
|
|
29
|
+
*/
|
|
30
|
+
export declare function cleanupEnvSetupFile(): boolean;
|
|
20
31
|
//# sourceMappingURL=file-export.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-export.d.ts","sourceRoot":"","sources":["../../../../../src/commands/env/commands/setup/file-export.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"file-export.d.ts","sourceRoot":"","sources":["../../../../../src/commands/env/commands/setup/file-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAYnD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,EAAE,EACtB,kBAAkB,EAAE,MAAM,EAC1B,sBAAsB,EAAE,MAAM,EAC9B,MAAM,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,GACzC,IAAI,CA4EN;AAiBD;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAgB7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAeH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAeH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA63BpC,eAAO,MAAM,cAAc,SA2DvB,CAAC"}
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
* - Works in both runa-repo (workspace) and pj-repo (standalone).
|
|
21
21
|
* - Matches Next.js/Vercel environment naming convention.
|
|
22
22
|
* - AI-friendly: `runa db sync` works without special wrappers.
|
|
23
|
+
*
|
|
24
|
+
* Security (Issue #462):
|
|
25
|
+
* - Maximum depth limit on directory traversal
|
|
26
|
+
* - Environment suffix validation (prevents path traversal via env names)
|
|
27
|
+
* - Path containment checks
|
|
23
28
|
*/
|
|
24
29
|
type VercelEnvironment = 'development' | 'preview' | 'production';
|
|
25
30
|
type RunaEnvironment = 'local' | 'preview' | 'main' | 'production';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-files.d.ts","sourceRoot":"","sources":["../../src/config/env-files.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"env-files.d.ts","sourceRoot":"","sources":["../../src/config/env-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAiBH,KAAK,iBAAiB,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AAClE,KAAK,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,CAAC;AAEnE,KAAK,mBAAmB,GAAG;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,aAAa,GAAG,YAAY,GAAG,MAAM,CAAC;IAChD;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAiFF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,kBAAkB,CAwFlF"}
|
package/dist/config/env.d.ts
CHANGED
|
@@ -125,6 +125,10 @@ export declare function isDebug(): boolean;
|
|
|
125
125
|
/**
|
|
126
126
|
* Sanitize sensitive data from environment variables
|
|
127
127
|
* Useful for logging
|
|
128
|
+
*
|
|
129
|
+
* SECURITY (Issue #461):
|
|
130
|
+
* - Redacts known sensitive keys
|
|
131
|
+
* - Detects and redacts values that look like secrets (pattern-based)
|
|
128
132
|
*/
|
|
129
133
|
export declare function sanitizeEnv(envVars: Partial<Env>): Record<string, string | boolean | undefined>;
|
|
130
134
|
export {};
|
package/dist/config/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB;;;GAG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