@shipfox/api-secrets 8.0.0 → 9.0.1
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +37 -0
- package/dist/core/identifier-policy.d.ts +4 -0
- package/dist/core/identifier-policy.d.ts.map +1 -0
- package/dist/core/identifier-policy.js +12 -0
- package/dist/core/identifier-policy.js.map +1 -0
- package/dist/core/store-validation.d.ts.map +1 -1
- package/dist/core/store-validation.js +2 -1
- package/dist/core/store-validation.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/presentation/routes/warnings.d.ts.map +1 -1
- package/dist/presentation/routes/warnings.js +4 -3
- package/dist/presentation/routes/warnings.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +15 -16
- package/src/core/identifier-policy.test.ts +25 -0
- package/src/core/identifier-policy.ts +13 -0
- package/src/core/store-validation.ts +2 -1
- package/src/index.ts +2 -2
- package/src/presentation/routes/warnings.ts +3 -6
- package/tsconfig.build.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
$ shipfox-swc
|
|
2
|
-
Successfully compiled:
|
|
2
|
+
Successfully compiled: 53 files with swc (468.35ms)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @shipfox/api-secrets
|
|
2
2
|
|
|
3
|
+
## 9.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 475ce59: Republishes all public packages after restoring release authorization.
|
|
8
|
+
- Updated dependencies [8436596]
|
|
9
|
+
- Updated dependencies [475ce59]
|
|
10
|
+
- Updated dependencies [154e03f]
|
|
11
|
+
- @shipfox/api-secrets-dto@9.0.1
|
|
12
|
+
- @shipfox/api-auth-context@9.0.1
|
|
13
|
+
- @shipfox/api-projects-dto@9.0.1
|
|
14
|
+
- @shipfox/config@1.2.3
|
|
15
|
+
- @shipfox/inter-module@0.2.1
|
|
16
|
+
- @shipfox/node-drizzle@0.3.3
|
|
17
|
+
- @shipfox/node-fastify@0.3.1
|
|
18
|
+
- @shipfox/node-module@1.0.0
|
|
19
|
+
- @shipfox/node-opentelemetry@0.6.1
|
|
20
|
+
- @shipfox/node-outbox@0.2.5
|
|
21
|
+
- @shipfox/node-postgres@0.4.3
|
|
22
|
+
|
|
23
|
+
## 9.0.0
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [02974d6]
|
|
28
|
+
- @shipfox/api-secrets-dto@9.0.0
|
|
29
|
+
- @shipfox/api-auth-context@9.0.0
|
|
30
|
+
- @shipfox/api-projects-dto@8.0.0
|
|
31
|
+
- @shipfox/config@1.2.2
|
|
32
|
+
- @shipfox/inter-module@0.2.0
|
|
33
|
+
- @shipfox/node-drizzle@0.3.2
|
|
34
|
+
- @shipfox/node-fastify@0.3.0
|
|
35
|
+
- @shipfox/node-module@0.5.0
|
|
36
|
+
- @shipfox/node-opentelemetry@0.6.0
|
|
37
|
+
- @shipfox/node-outbox@0.2.4
|
|
38
|
+
- @shipfox/node-postgres@0.4.2
|
|
39
|
+
|
|
3
40
|
## 8.0.0
|
|
4
41
|
|
|
5
42
|
### Patch Changes
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function isSystemNamespace(namespace: string): boolean;
|
|
2
|
+
export declare function isSensitiveSecretName(key: string): boolean;
|
|
3
|
+
export declare function isShortSecretValue(value: string, threshold: number): boolean;
|
|
4
|
+
//# sourceMappingURL=identifier-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier-policy.d.ts","sourceRoot":"","sources":["../../src/core/identifier-policy.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAE5E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SENSITIVE_NAME_PATTERNS, SYSTEM_NAMESPACE_PREFIX } from '@shipfox/api-secrets-dto';
|
|
2
|
+
export function isSystemNamespace(namespace) {
|
|
3
|
+
return namespace.startsWith(SYSTEM_NAMESPACE_PREFIX);
|
|
4
|
+
}
|
|
5
|
+
export function isSensitiveSecretName(key) {
|
|
6
|
+
return SENSITIVE_NAME_PATTERNS.some((pattern)=>key.includes(pattern));
|
|
7
|
+
}
|
|
8
|
+
export function isShortSecretValue(value, threshold) {
|
|
9
|
+
return value.length > 0 && value.length < threshold;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=identifier-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/identifier-policy.ts"],"sourcesContent":["import {SENSITIVE_NAME_PATTERNS, SYSTEM_NAMESPACE_PREFIX} from '@shipfox/api-secrets-dto';\n\nexport function isSystemNamespace(namespace: string): boolean {\n return namespace.startsWith(SYSTEM_NAMESPACE_PREFIX);\n}\n\nexport function isSensitiveSecretName(key: string): boolean {\n return SENSITIVE_NAME_PATTERNS.some((pattern) => key.includes(pattern));\n}\n\nexport function isShortSecretValue(value: string, threshold: number): boolean {\n return value.length > 0 && value.length < threshold;\n}\n"],"names":["SENSITIVE_NAME_PATTERNS","SYSTEM_NAMESPACE_PREFIX","isSystemNamespace","namespace","startsWith","isSensitiveSecretName","key","some","pattern","includes","isShortSecretValue","value","threshold","length"],"mappings":"AAAA,SAAQA,uBAAuB,EAAEC,uBAAuB,QAAO,2BAA2B;AAE1F,OAAO,SAASC,kBAAkBC,SAAiB;IACjD,OAAOA,UAAUC,UAAU,CAACH;AAC9B;AAEA,OAAO,SAASI,sBAAsBC,GAAW;IAC/C,OAAON,wBAAwBO,IAAI,CAAC,CAACC,UAAYF,IAAIG,QAAQ,CAACD;AAChE;AAEA,OAAO,SAASE,mBAAmBC,KAAa,EAAEC,SAAiB;IACjE,OAAOD,MAAME,MAAM,GAAG,KAAKF,MAAME,MAAM,GAAGD;AAC5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-validation.d.ts","sourceRoot":"","sources":["../../src/core/store-validation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,KAAK,EAAE,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"store-validation.d.ts","sourceRoot":"","sources":["../../src/core/store-validation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,KAAK,EAAE,EAAC,MAAM,cAAc,CAAC;AAS5D,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAGzD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAI/D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAMjE;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,EAAE,EAAE,EAAE,CAAC;CACR,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { namespaceSchema, secretKeySchema } from '@shipfox/api-secrets-dto';
|
|
2
2
|
import { config, MAX_VALUE_BYTES } from '#config.js';
|
|
3
3
|
import { countWorkspaceEntries } from '#db/index.js';
|
|
4
4
|
import { NamespaceValidationError, SecretKeyValidationError, SecretValueTooLargeError, WorkspaceSecretCapExceededError } from './errors.js';
|
|
5
|
+
import { isSystemNamespace } from './identifier-policy.js';
|
|
5
6
|
export function validateNamespace(namespace) {
|
|
6
7
|
if (namespaceSchema.safeParse(namespace).success) return;
|
|
7
8
|
throw new NamespaceValidationError(namespace);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/store-validation.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/core/store-validation.ts"],"sourcesContent":["import {namespaceSchema, secretKeySchema} from '@shipfox/api-secrets-dto';\nimport {config, MAX_VALUE_BYTES} from '#config.js';\nimport {countWorkspaceEntries, type Tx} from '#db/index.js';\nimport {\n NamespaceValidationError,\n SecretKeyValidationError,\n SecretValueTooLargeError,\n WorkspaceSecretCapExceededError,\n} from './errors.js';\nimport {isSystemNamespace} from './identifier-policy.js';\n\nexport function validateNamespace(namespace: string): void {\n if (namespaceSchema.safeParse(namespace).success) return;\n throw new NamespaceValidationError(namespace);\n}\n\nexport function validateSecretKeys(keys: Iterable<string>): void {\n for (const key of keys) {\n if (!secretKeySchema.safeParse(key).success) throw new SecretKeyValidationError(key);\n }\n}\n\nexport function validateValueBytes(values: Iterable<string>): void {\n for (const value of values) {\n if (Buffer.byteLength(value, 'utf8') > MAX_VALUE_BYTES) {\n throw new SecretValueTooLargeError(MAX_VALUE_BYTES);\n }\n }\n}\n\nexport async function assertWorkspaceCap(params: {\n workspaceId: string;\n namespace: string;\n incomingEntries: number;\n tx: Tx;\n}): Promise<void> {\n // System namespaces are internal-only; public management routes do not accept a namespace.\n if (isSystemNamespace(params.namespace)) return;\n\n const count = await countWorkspaceEntries(params.workspaceId, params.tx);\n if (count + params.incomingEntries > config.SECRETS_MAX_PER_WORKSPACE) {\n throw new WorkspaceSecretCapExceededError(params.workspaceId, config.SECRETS_MAX_PER_WORKSPACE);\n }\n}\n"],"names":["namespaceSchema","secretKeySchema","config","MAX_VALUE_BYTES","countWorkspaceEntries","NamespaceValidationError","SecretKeyValidationError","SecretValueTooLargeError","WorkspaceSecretCapExceededError","isSystemNamespace","validateNamespace","namespace","safeParse","success","validateSecretKeys","keys","key","validateValueBytes","values","value","Buffer","byteLength","assertWorkspaceCap","params","count","workspaceId","tx","incomingEntries","SECRETS_MAX_PER_WORKSPACE"],"mappings":"AAAA,SAAQA,eAAe,EAAEC,eAAe,QAAO,2BAA2B;AAC1E,SAAQC,MAAM,EAAEC,eAAe,QAAO,aAAa;AACnD,SAAQC,qBAAqB,QAAgB,eAAe;AAC5D,SACEC,wBAAwB,EACxBC,wBAAwB,EACxBC,wBAAwB,EACxBC,+BAA+B,QAC1B,cAAc;AACrB,SAAQC,iBAAiB,QAAO,yBAAyB;AAEzD,OAAO,SAASC,kBAAkBC,SAAiB;IACjD,IAAIX,gBAAgBY,SAAS,CAACD,WAAWE,OAAO,EAAE;IAClD,MAAM,IAAIR,yBAAyBM;AACrC;AAEA,OAAO,SAASG,mBAAmBC,IAAsB;IACvD,KAAK,MAAMC,OAAOD,KAAM;QACtB,IAAI,CAACd,gBAAgBW,SAAS,CAACI,KAAKH,OAAO,EAAE,MAAM,IAAIP,yBAAyBU;IAClF;AACF;AAEA,OAAO,SAASC,mBAAmBC,MAAwB;IACzD,KAAK,MAAMC,SAASD,OAAQ;QAC1B,IAAIE,OAAOC,UAAU,CAACF,OAAO,UAAUhB,iBAAiB;YACtD,MAAM,IAAII,yBAAyBJ;QACrC;IACF;AACF;AAEA,OAAO,eAAemB,mBAAmBC,MAKxC;IACC,2FAA2F;IAC3F,IAAId,kBAAkBc,OAAOZ,SAAS,GAAG;IAEzC,MAAMa,QAAQ,MAAMpB,sBAAsBmB,OAAOE,WAAW,EAAEF,OAAOG,EAAE;IACvE,IAAIF,QAAQD,OAAOI,eAAe,GAAGzB,OAAO0B,yBAAyB,EAAE;QACrE,MAAM,IAAIpB,gCAAgCe,OAAOE,WAAW,EAAEvB,OAAO0B,yBAAyB;IAChG;AACF"}
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,8 @@ export function createSecretsModule(projects) {
|
|
|
10
10
|
name: 'secrets',
|
|
11
11
|
database: {
|
|
12
12
|
db,
|
|
13
|
-
migrationsPath
|
|
13
|
+
migrationsPath,
|
|
14
|
+
databaseNamespace: 'secrets'
|
|
14
15
|
},
|
|
15
16
|
routes: createSecretsRoutes(projects),
|
|
16
17
|
e2eRoutes: [
|
|
@@ -35,7 +36,8 @@ export const secretsModule = {
|
|
|
35
36
|
name: 'secrets',
|
|
36
37
|
database: {
|
|
37
38
|
db,
|
|
38
|
-
migrationsPath
|
|
39
|
+
migrationsPath,
|
|
40
|
+
databaseNamespace: 'secrets'
|
|
39
41
|
}
|
|
40
42
|
};
|
|
41
43
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {secretsEventSchemas} from '@shipfox/api-secrets-dto';\nimport type {ShipfoxModule} from '@shipfox/node-module';\nimport {db, migrationsPath, secretsOutbox} from '#db/index.js';\nimport {registerSecretsServiceMetrics} from '#metrics/index.js';\nimport {secretsE2eRoutes} from '#presentation/e2eRoutes/index.js';\nimport {createSecretsInterModulePresentation} from '#presentation/inter-module.js';\nimport {createSecretsRoutes} from '#presentation/routes/index.js';\n\nexport {\n BUILTIN_LOCAL_STORE,\n DekUnwrapError,\n DekWrapError,\n deleteManagedSecret,\n deleteManagedVariable,\n deleteSecrets,\n deleteVariables,\n getManagedVariable,\n getSecret,\n getSecretsByNamespace,\n getVariable,\n getVariablesByNamespace,\n KekConfigurationError,\n KekVersionStrandedError,\n listManagedSecrets,\n listManagedVariables,\n NamespaceValidationError,\n resolveSecretStore,\n rotateWorkspaceDataKeys,\n SecretBatchScopeMismatchError,\n SecretDecryptionError,\n SecretKeyValidationError,\n SecretNotFoundError,\n type SecretStoreProvider,\n SecretValueTooLargeError,\n setManagedSecrets,\n setManagedVariables,\n setSecrets,\n setVariables,\n UnknownSecretStoreError,\n VariableNotFoundError,\n WorkspaceSecretCapExceededError,\n} from '#core/index.js';\n\nexport function createSecretsModule(projects: ProjectsModuleClient): ShipfoxModule {\n return {\n name: 'secrets',\n database: {db, migrationsPath},\n routes: createSecretsRoutes(projects),\n e2eRoutes: [secretsE2eRoutes],\n metrics: registerSecretsServiceMetrics,\n publishers: [{name: 'secrets', table: secretsOutbox, db, eventSchemas: secretsEventSchemas}],\n interModulePresentations: [createSecretsInterModulePresentation()],\n };\n}\n\n// Migration setup imports this declaration only for the owned database metadata.\nexport const secretsModule: ShipfoxModule = {\n name: 'secrets',\n database: {db, migrationsPath},\n};\n"],"names":["secretsEventSchemas","db","migrationsPath","secretsOutbox","registerSecretsServiceMetrics","secretsE2eRoutes","createSecretsInterModulePresentation","createSecretsRoutes","BUILTIN_LOCAL_STORE","DekUnwrapError","DekWrapError","deleteManagedSecret","deleteManagedVariable","deleteSecrets","deleteVariables","getManagedVariable","getSecret","getSecretsByNamespace","getVariable","getVariablesByNamespace","KekConfigurationError","KekVersionStrandedError","listManagedSecrets","listManagedVariables","NamespaceValidationError","resolveSecretStore","rotateWorkspaceDataKeys","SecretBatchScopeMismatchError","SecretDecryptionError","SecretKeyValidationError","SecretNotFoundError","SecretValueTooLargeError","setManagedSecrets","setManagedVariables","setSecrets","setVariables","UnknownSecretStoreError","VariableNotFoundError","WorkspaceSecretCapExceededError","createSecretsModule","projects","name","database","routes","e2eRoutes","metrics","publishers","table","eventSchemas","interModulePresentations","secretsModule"],"mappings":"AACA,SAAQA,mBAAmB,QAAO,2BAA2B;AAE7D,SAAQC,EAAE,EAAEC,cAAc,EAAEC,aAAa,QAAO,eAAe;AAC/D,SAAQC,6BAA6B,QAAO,oBAAoB;AAChE,SAAQC,gBAAgB,QAAO,mCAAmC;AAClE,SAAQC,oCAAoC,QAAO,gCAAgC;AACnF,SAAQC,mBAAmB,QAAO,gCAAgC;AAElE,SACEC,mBAAmB,EACnBC,cAAc,EACdC,YAAY,EACZC,mBAAmB,EACnBC,qBAAqB,EACrBC,aAAa,EACbC,eAAe,EACfC,kBAAkB,EAClBC,SAAS,EACTC,qBAAqB,EACrBC,WAAW,EACXC,uBAAuB,EACvBC,qBAAqB,EACrBC,uBAAuB,EACvBC,kBAAkB,EAClBC,oBAAoB,EACpBC,wBAAwB,EACxBC,kBAAkB,EAClBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,qBAAqB,EACrBC,wBAAwB,EACxBC,mBAAmB,EAEnBC,wBAAwB,EACxBC,iBAAiB,EACjBC,mBAAmB,EACnBC,UAAU,EACVC,YAAY,EACZC,uBAAuB,EACvBC,qBAAqB,EACrBC,+BAA+B,QAC1B,iBAAiB;AAExB,OAAO,SAASC,oBAAoBC,QAA8B;IAChE,OAAO;QACLC,MAAM;QACNC,UAAU;YAACzC;YAAIC;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {secretsEventSchemas} from '@shipfox/api-secrets-dto';\nimport type {ShipfoxModule} from '@shipfox/node-module';\nimport {db, migrationsPath, secretsOutbox} from '#db/index.js';\nimport {registerSecretsServiceMetrics} from '#metrics/index.js';\nimport {secretsE2eRoutes} from '#presentation/e2eRoutes/index.js';\nimport {createSecretsInterModulePresentation} from '#presentation/inter-module.js';\nimport {createSecretsRoutes} from '#presentation/routes/index.js';\n\nexport {\n BUILTIN_LOCAL_STORE,\n DekUnwrapError,\n DekWrapError,\n deleteManagedSecret,\n deleteManagedVariable,\n deleteSecrets,\n deleteVariables,\n getManagedVariable,\n getSecret,\n getSecretsByNamespace,\n getVariable,\n getVariablesByNamespace,\n KekConfigurationError,\n KekVersionStrandedError,\n listManagedSecrets,\n listManagedVariables,\n NamespaceValidationError,\n resolveSecretStore,\n rotateWorkspaceDataKeys,\n SecretBatchScopeMismatchError,\n SecretDecryptionError,\n SecretKeyValidationError,\n SecretNotFoundError,\n type SecretStoreProvider,\n SecretValueTooLargeError,\n setManagedSecrets,\n setManagedVariables,\n setSecrets,\n setVariables,\n UnknownSecretStoreError,\n VariableNotFoundError,\n WorkspaceSecretCapExceededError,\n} from '#core/index.js';\n\nexport function createSecretsModule(projects: ProjectsModuleClient): ShipfoxModule {\n return {\n name: 'secrets',\n database: {db, migrationsPath, databaseNamespace: 'secrets'},\n routes: createSecretsRoutes(projects),\n e2eRoutes: [secretsE2eRoutes],\n metrics: registerSecretsServiceMetrics,\n publishers: [{name: 'secrets', table: secretsOutbox, db, eventSchemas: secretsEventSchemas}],\n interModulePresentations: [createSecretsInterModulePresentation()],\n };\n}\n\n// Migration setup imports this declaration only for the owned database metadata.\nexport const secretsModule: ShipfoxModule = {\n name: 'secrets',\n database: {db, migrationsPath, databaseNamespace: 'secrets'},\n};\n"],"names":["secretsEventSchemas","db","migrationsPath","secretsOutbox","registerSecretsServiceMetrics","secretsE2eRoutes","createSecretsInterModulePresentation","createSecretsRoutes","BUILTIN_LOCAL_STORE","DekUnwrapError","DekWrapError","deleteManagedSecret","deleteManagedVariable","deleteSecrets","deleteVariables","getManagedVariable","getSecret","getSecretsByNamespace","getVariable","getVariablesByNamespace","KekConfigurationError","KekVersionStrandedError","listManagedSecrets","listManagedVariables","NamespaceValidationError","resolveSecretStore","rotateWorkspaceDataKeys","SecretBatchScopeMismatchError","SecretDecryptionError","SecretKeyValidationError","SecretNotFoundError","SecretValueTooLargeError","setManagedSecrets","setManagedVariables","setSecrets","setVariables","UnknownSecretStoreError","VariableNotFoundError","WorkspaceSecretCapExceededError","createSecretsModule","projects","name","database","databaseNamespace","routes","e2eRoutes","metrics","publishers","table","eventSchemas","interModulePresentations","secretsModule"],"mappings":"AACA,SAAQA,mBAAmB,QAAO,2BAA2B;AAE7D,SAAQC,EAAE,EAAEC,cAAc,EAAEC,aAAa,QAAO,eAAe;AAC/D,SAAQC,6BAA6B,QAAO,oBAAoB;AAChE,SAAQC,gBAAgB,QAAO,mCAAmC;AAClE,SAAQC,oCAAoC,QAAO,gCAAgC;AACnF,SAAQC,mBAAmB,QAAO,gCAAgC;AAElE,SACEC,mBAAmB,EACnBC,cAAc,EACdC,YAAY,EACZC,mBAAmB,EACnBC,qBAAqB,EACrBC,aAAa,EACbC,eAAe,EACfC,kBAAkB,EAClBC,SAAS,EACTC,qBAAqB,EACrBC,WAAW,EACXC,uBAAuB,EACvBC,qBAAqB,EACrBC,uBAAuB,EACvBC,kBAAkB,EAClBC,oBAAoB,EACpBC,wBAAwB,EACxBC,kBAAkB,EAClBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,qBAAqB,EACrBC,wBAAwB,EACxBC,mBAAmB,EAEnBC,wBAAwB,EACxBC,iBAAiB,EACjBC,mBAAmB,EACnBC,UAAU,EACVC,YAAY,EACZC,uBAAuB,EACvBC,qBAAqB,EACrBC,+BAA+B,QAC1B,iBAAiB;AAExB,OAAO,SAASC,oBAAoBC,QAA8B;IAChE,OAAO;QACLC,MAAM;QACNC,UAAU;YAACzC;YAAIC;YAAgByC,mBAAmB;QAAS;QAC3DC,QAAQrC,oBAAoBiC;QAC5BK,WAAW;YAACxC;SAAiB;QAC7ByC,SAAS1C;QACT2C,YAAY;YAAC;gBAACN,MAAM;gBAAWO,OAAO7C;gBAAeF;gBAAIgD,cAAcjD;YAAmB;SAAE;QAC5FkD,0BAA0B;YAAC5C;SAAuC;IACpE;AACF;AAEA,iFAAiF;AACjF,OAAO,MAAM6C,gBAA+B;IAC1CV,MAAM;IACNC,UAAU;QAACzC;QAAIC;QAAgByC,mBAAmB;IAAS;AAC7D,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warnings.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/warnings.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,
|
|
1
|
+
{"version":3,"file":"warnings.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/warnings.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAEpD,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,qBAAqB,EAAE,CAIlF;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,qBAAqB,EAAE,CAIpF"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { SENSITIVE_VARIABLE_NAME_WARNING, SHORT_SECRET_VALUE_WARNING
|
|
1
|
+
import { SENSITIVE_VARIABLE_NAME_WARNING, SHORT_SECRET_VALUE_WARNING } from '@shipfox/api-secrets-dto';
|
|
2
2
|
import { config } from '#config.js';
|
|
3
|
+
import { isSensitiveSecretName, isShortSecretValue } from '#core/identifier-policy.js';
|
|
3
4
|
export function secretWarnings(entries) {
|
|
4
|
-
return entries.filter((entry)=>
|
|
5
|
+
return entries.filter((entry)=>isShortSecretValue(entry.value, config.SECRETS_SHORT_VALUE_WARN_LENGTH)).map((entry)=>({
|
|
5
6
|
code: SHORT_SECRET_VALUE_WARNING,
|
|
6
7
|
key: entry.key
|
|
7
8
|
}));
|
|
8
9
|
}
|
|
9
10
|
export function variableWarnings(entries) {
|
|
10
|
-
return entries.filter((entry)=>
|
|
11
|
+
return entries.filter((entry)=>isSensitiveSecretName(entry.key)).map((entry)=>({
|
|
11
12
|
code: SENSITIVE_VARIABLE_NAME_WARNING,
|
|
12
13
|
key: entry.key
|
|
13
14
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/presentation/routes/warnings.ts"],"sourcesContent":["import {\n SENSITIVE_VARIABLE_NAME_WARNING,\n type SecretWriteWarningDto,\n SHORT_SECRET_VALUE_WARNING,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/routes/warnings.ts"],"sourcesContent":["import {\n SENSITIVE_VARIABLE_NAME_WARNING,\n type SecretWriteWarningDto,\n SHORT_SECRET_VALUE_WARNING,\n} from '@shipfox/api-secrets-dto';\nimport {config} from '#config.js';\nimport {isSensitiveSecretName, isShortSecretValue} from '#core/identifier-policy.js';\nimport type {ManagementEntry} from '#core/index.js';\n\nexport function secretWarnings(entries: ManagementEntry[]): SecretWriteWarningDto[] {\n return entries\n .filter((entry) => isShortSecretValue(entry.value, config.SECRETS_SHORT_VALUE_WARN_LENGTH))\n .map((entry) => ({code: SHORT_SECRET_VALUE_WARNING, key: entry.key}));\n}\n\nexport function variableWarnings(entries: ManagementEntry[]): SecretWriteWarningDto[] {\n return entries\n .filter((entry) => isSensitiveSecretName(entry.key))\n .map((entry) => ({code: SENSITIVE_VARIABLE_NAME_WARNING, key: entry.key}));\n}\n"],"names":["SENSITIVE_VARIABLE_NAME_WARNING","SHORT_SECRET_VALUE_WARNING","config","isSensitiveSecretName","isShortSecretValue","secretWarnings","entries","filter","entry","value","SECRETS_SHORT_VALUE_WARN_LENGTH","map","code","key","variableWarnings"],"mappings":"AAAA,SACEA,+BAA+B,EAE/BC,0BAA0B,QACrB,2BAA2B;AAClC,SAAQC,MAAM,QAAO,aAAa;AAClC,SAAQC,qBAAqB,EAAEC,kBAAkB,QAAO,6BAA6B;AAGrF,OAAO,SAASC,eAAeC,OAA0B;IACvD,OAAOA,QACJC,MAAM,CAAC,CAACC,QAAUJ,mBAAmBI,MAAMC,KAAK,EAAEP,OAAOQ,+BAA+B,GACxFC,GAAG,CAAC,CAACH,QAAW,CAAA;YAACI,MAAMX;YAA4BY,KAAKL,MAAMK,GAAG;QAAA,CAAA;AACtE;AAEA,OAAO,SAASC,iBAAiBR,OAA0B;IACzD,OAAOA,QACJC,MAAM,CAAC,CAACC,QAAUL,sBAAsBK,MAAMK,GAAG,GACjDF,GAAG,CAAC,CAACH,QAAW,CAAA;YAACI,MAAMZ;YAAiCa,KAAKL,MAAMK,GAAG;QAAA,CAAA;AAC3E"}
|