@gadicc/loom 1.37.0 → 2.0.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/.loom-source-manifest.json +97 -0
- package/README.md +113 -31
- package/db/databaseTls.js +6 -3
- package/db/databaseUrl.js +3 -2
- package/db/drizzle-config.js +14 -16
- package/db/fixtures.d.ts +1 -3
- package/db/fixtures.js +4 -7
- package/esm/bin/loom.d.ts +2 -1
- package/esm/bin/loom.d.ts.map +1 -1
- package/esm/bin/loom.js +37 -10
- package/esm/bin/loom.js.map +1 -0
- package/esm/mod.d.ts +0 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- package/esm/mod.js.map +1 -0
- package/esm/src/apiKeys/authorize.d.ts.map +1 -1
- package/esm/src/apiKeys/authorize.js +15 -14
- package/esm/src/apiKeys/authorize.js.map +1 -0
- package/esm/src/apiKeys/betterAuth.d.ts.map +1 -1
- package/esm/src/apiKeys/betterAuth.js +1 -0
- package/esm/src/apiKeys/betterAuth.js.map +1 -0
- package/esm/src/apiKeys/country.d.ts.map +1 -1
- package/esm/src/apiKeys/country.js +1 -0
- package/esm/src/apiKeys/country.js.map +1 -0
- package/esm/src/apiKeys/credentials.d.ts.map +1 -1
- package/esm/src/apiKeys/credentials.js +3 -1
- package/esm/src/apiKeys/credentials.js.map +1 -0
- package/esm/src/apiKeys/fingerprint.d.ts.map +1 -1
- package/esm/src/apiKeys/fingerprint.js +1 -0
- package/esm/src/apiKeys/fingerprint.js.map +1 -0
- package/esm/src/apiKeys/lifecycle.d.ts.map +1 -1
- package/esm/src/apiKeys/lifecycle.js +1 -0
- package/esm/src/apiKeys/lifecycle.js.map +1 -0
- package/esm/src/apiKeys/limits.d.ts.map +1 -1
- package/esm/src/apiKeys/limits.js +10 -10
- package/esm/src/apiKeys/limits.js.map +1 -0
- package/esm/src/apiKeys/mod.d.ts +0 -1
- package/esm/src/apiKeys/mod.d.ts.map +1 -1
- package/esm/src/apiKeys/mod.js +1 -1
- package/esm/src/apiKeys/mod.js.map +1 -0
- package/esm/src/apiKeys/permissions.d.ts.map +1 -1
- package/esm/src/apiKeys/permissions.js +1 -0
- package/esm/src/apiKeys/permissions.js.map +1 -0
- package/esm/src/apiKeys/policy.d.ts.map +1 -1
- package/esm/src/apiKeys/policy.js +1 -0
- package/esm/src/apiKeys/policy.js.map +1 -0
- package/esm/src/apiKeys/retention.d.ts.map +1 -1
- package/esm/src/apiKeys/retention.js +1 -0
- package/esm/src/apiKeys/retention.js.map +1 -0
- package/esm/src/apiKeys/types.d.ts.map +1 -1
- package/esm/src/apiKeys/types.js +1 -0
- package/esm/src/apiKeys/types.js.map +1 -0
- package/esm/src/cli/atomicText.d.ts +3 -0
- package/esm/src/cli/atomicText.d.ts.map +1 -0
- package/esm/src/cli/atomicText.js +33 -0
- package/esm/src/cli/atomicText.js.map +1 -0
- package/esm/src/cli/bunLocalDev.d.ts +65 -0
- package/esm/src/cli/bunLocalDev.d.ts.map +1 -0
- package/esm/src/cli/bunLocalDev.js +459 -0
- package/esm/src/cli/bunLocalDev.js.map +1 -0
- package/esm/src/cli/bunProject.d.ts +30 -0
- package/esm/src/cli/bunProject.d.ts.map +1 -0
- package/esm/src/cli/bunProject.js +309 -0
- package/esm/src/cli/bunProject.js.map +1 -0
- package/esm/src/cli/cliBootstrap.d.ts +83 -0
- package/esm/src/cli/cliBootstrap.d.ts.map +1 -0
- package/esm/src/cli/cliBootstrap.js +186 -0
- package/esm/src/cli/cliBootstrap.js.map +1 -0
- package/esm/src/cli/externalSkills.d.ts.map +1 -1
- package/esm/src/cli/externalSkills.js +9 -5
- package/esm/src/cli/externalSkills.js.map +1 -0
- package/esm/src/cli/filesR2Policy.d.ts.map +1 -1
- package/esm/src/cli/filesR2Policy.js +18 -11
- package/esm/src/cli/filesR2Policy.js.map +1 -0
- package/esm/src/cli/generatedBuild.d.ts +42 -0
- package/esm/src/cli/generatedBuild.d.ts.map +1 -0
- package/esm/src/cli/generatedBuild.js +259 -0
- package/esm/src/cli/generatedBuild.js.map +1 -0
- package/esm/src/cli/generatedCleanup.d.ts +7 -0
- package/esm/src/cli/generatedCleanup.d.ts.map +1 -0
- package/esm/src/cli/generatedCleanup.js +67 -0
- package/esm/src/cli/generatedCleanup.js.map +1 -0
- package/esm/src/cli/generatedDevLease.d.ts +8 -0
- package/esm/src/cli/generatedDevLease.d.ts.map +1 -0
- package/esm/src/cli/generatedDevLease.js +39 -0
- package/esm/src/cli/generatedDevLease.js.map +1 -0
- package/esm/src/cli/generatedInstall.d.ts +64 -0
- package/esm/src/cli/generatedInstall.d.ts.map +1 -0
- package/esm/src/cli/generatedInstall.js +466 -0
- package/esm/src/cli/generatedInstall.js.map +1 -0
- package/esm/src/cli/generatedWorkflow.d.ts +34 -0
- package/esm/src/cli/generatedWorkflow.d.ts.map +1 -0
- package/esm/src/cli/generatedWorkflow.js +85 -0
- package/esm/src/cli/generatedWorkflow.js.map +1 -0
- package/esm/src/cli/legacyManagedOutputs.d.ts.map +1 -1
- package/esm/src/cli/legacyManagedOutputs.js +1 -0
- package/esm/src/cli/legacyManagedOutputs.js.map +1 -0
- package/esm/src/cli/localDb.d.ts.map +1 -1
- package/esm/src/cli/localDb.js +35 -30
- package/esm/src/cli/localDb.js.map +1 -0
- package/esm/src/cli/localDevLock.d.ts +9 -0
- package/esm/src/cli/localDevLock.d.ts.map +1 -1
- package/esm/src/cli/localDevLock.js +54 -13
- package/esm/src/cli/localDevLock.js.map +1 -0
- package/esm/src/cli/localDevPackage.d.ts +6 -11
- package/esm/src/cli/localDevPackage.d.ts.map +1 -1
- package/esm/src/cli/localDevPackage.js +51 -48
- package/esm/src/cli/localDevPackage.js.map +1 -0
- package/esm/src/cli/managedFiles.d.ts.map +1 -1
- package/esm/src/cli/managedFiles.js +34 -18
- package/esm/src/cli/managedFiles.js.map +1 -0
- package/esm/src/cli/migrationEnv.d.ts +16 -3
- package/esm/src/cli/migrationEnv.d.ts.map +1 -1
- package/esm/src/cli/migrationEnv.js +9 -6
- package/esm/src/cli/migrationEnv.js.map +1 -0
- package/esm/src/cli/mod.d.ts +20 -7
- package/esm/src/cli/mod.d.ts.map +1 -1
- package/esm/src/cli/mod.js +2148 -730
- package/esm/src/cli/mod.js.map +1 -0
- package/esm/src/cli/packageTreeSignature.d.ts +8 -0
- package/esm/src/cli/packageTreeSignature.d.ts.map +1 -0
- package/esm/src/cli/packageTreeSignature.js +60 -0
- package/esm/src/cli/packageTreeSignature.js.map +1 -0
- package/esm/src/cli/processIdentity.d.ts +7 -0
- package/esm/src/cli/processIdentity.d.ts.map +1 -0
- package/esm/src/cli/processIdentity.js +39 -0
- package/esm/src/cli/processIdentity.js.map +1 -0
- package/esm/src/cli/projectSkills.d.ts +1 -1
- package/esm/src/cli/projectSkills.d.ts.map +1 -1
- package/esm/src/cli/projectSkills.js +31 -23
- package/esm/src/cli/projectSkills.js.map +1 -0
- package/esm/src/cli/projectTooling.d.ts +6 -3
- package/esm/src/cli/projectTooling.d.ts.map +1 -1
- package/esm/src/cli/projectTooling.js +86 -41
- package/esm/src/cli/projectTooling.js.map +1 -0
- package/esm/src/cli/releaseConfig.d.ts.map +1 -1
- package/esm/src/cli/releaseConfig.js +5 -3
- package/esm/src/cli/releaseConfig.js.map +1 -0
- package/esm/src/cli/releaseCredentials.d.ts.map +1 -1
- package/esm/src/cli/releaseCredentials.js +19 -31
- package/esm/src/cli/releaseCredentials.js.map +1 -0
- package/esm/src/cli/releaseTrust.d.ts.map +1 -1
- package/esm/src/cli/releaseTrust.js +11 -4
- package/esm/src/cli/releaseTrust.js.map +1 -0
- package/esm/src/cli/releaseTrustCommand.d.ts.map +1 -1
- package/esm/src/cli/releaseTrustCommand.js +6 -4
- package/esm/src/cli/releaseTrustCommand.js.map +1 -0
- package/esm/src/cli/sourceConfig.d.ts +3 -0
- package/esm/src/cli/sourceConfig.d.ts.map +1 -0
- package/esm/src/cli/sourceConfig.js +91 -0
- package/esm/src/cli/sourceConfig.js.map +1 -0
- package/esm/src/cli/sourceDev.d.ts +77 -0
- package/esm/src/cli/sourceDev.d.ts.map +1 -0
- package/esm/src/cli/sourceDev.js +974 -0
- package/esm/src/cli/sourceDev.js.map +1 -0
- package/esm/src/cli/vercelBuildEnv.d.ts.map +1 -1
- package/esm/src/cli/vercelBuildEnv.js +44 -21
- package/esm/src/cli/vercelBuildEnv.js.map +1 -0
- package/esm/src/cli/vercelEnvMask.d.ts +38 -0
- package/esm/src/cli/vercelEnvMask.d.ts.map +1 -0
- package/esm/src/cli/vercelEnvMask.js +140 -0
- package/esm/src/cli/vercelEnvMask.js.map +1 -0
- package/esm/src/cli/vercelProjectRelease.d.ts.map +1 -1
- package/esm/src/cli/vercelProjectRelease.js +47 -24
- package/esm/src/cli/vercelProjectRelease.js.map +1 -0
- package/esm/src/cli/vercelPulledEnv.d.ts +65 -0
- package/esm/src/cli/vercelPulledEnv.d.ts.map +1 -0
- package/esm/src/cli/vercelPulledEnv.js +133 -0
- package/esm/src/cli/vercelPulledEnv.js.map +1 -0
- package/esm/src/clientData/identity.d.ts.map +1 -1
- package/esm/src/clientData/identity.js +1 -0
- package/esm/src/clientData/identity.js.map +1 -0
- package/esm/src/clientData/mod.d.ts +0 -1
- package/esm/src/clientData/mod.d.ts.map +1 -1
- package/esm/src/clientData/mod.js +1 -0
- package/esm/src/clientData/mod.js.map +1 -0
- package/esm/src/files/client.d.ts +1 -1
- package/esm/src/files/client.d.ts.map +1 -1
- package/esm/src/files/client.js +3 -4
- package/esm/src/files/client.js.map +1 -0
- package/esm/src/files/errors.d.ts.map +1 -1
- package/esm/src/files/errors.js +3 -12
- package/esm/src/files/errors.js.map +1 -0
- package/esm/src/files/hash.d.ts +1 -1
- package/esm/src/files/hash.d.ts.map +1 -1
- package/esm/src/files/hash.js +1 -0
- package/esm/src/files/hash.js.map +1 -0
- package/esm/src/files/memory.d.ts.map +1 -1
- package/esm/src/files/memory.js +2 -1
- package/esm/src/files/memory.js.map +1 -0
- package/esm/src/files/metadata.d.ts.map +1 -1
- package/esm/src/files/metadata.js +11 -18
- package/esm/src/files/metadata.js.map +1 -0
- package/esm/src/files/mod.d.ts +0 -1
- package/esm/src/files/mod.d.ts.map +1 -1
- package/esm/src/files/mod.js +1 -1
- package/esm/src/files/mod.js.map +1 -0
- package/esm/src/files/s3.d.ts.map +1 -1
- package/esm/src/files/s3.js +6 -4
- package/esm/src/files/s3.js.map +1 -0
- package/esm/src/files/service.d.ts.map +1 -1
- package/esm/src/files/service.js +3 -4
- package/esm/src/files/service.js.map +1 -0
- package/esm/src/files/types.d.ts.map +1 -1
- package/esm/src/files/types.js +1 -0
- package/esm/src/files/types.js.map +1 -0
- package/esm/src/jobs/catalog.d.ts.map +1 -1
- package/esm/src/jobs/catalog.js +5 -1
- package/esm/src/jobs/catalog.js.map +1 -0
- package/esm/src/jobs/controller.d.ts +1 -1
- package/esm/src/jobs/controller.d.ts.map +1 -1
- package/esm/src/jobs/controller.js +11 -55
- package/esm/src/jobs/controller.js.map +1 -0
- package/esm/src/jobs/direct.d.ts.map +1 -1
- package/esm/src/jobs/direct.js +3 -3
- package/esm/src/jobs/direct.js.map +1 -0
- package/esm/src/jobs/events.d.ts.map +1 -1
- package/esm/src/jobs/events.js +1 -0
- package/esm/src/jobs/events.js.map +1 -0
- package/esm/src/jobs/format.d.ts +5 -5
- package/esm/src/jobs/format.d.ts.map +1 -1
- package/esm/src/jobs/format.js +2 -1
- package/esm/src/jobs/format.js.map +1 -0
- package/esm/src/jobs/http.d.ts +3 -3
- package/esm/src/jobs/http.d.ts.map +1 -1
- package/esm/src/jobs/http.js +1 -0
- package/esm/src/jobs/http.js.map +1 -0
- package/esm/src/jobs/log.d.ts.map +1 -1
- package/esm/src/jobs/log.js +1 -0
- package/esm/src/jobs/log.js.map +1 -0
- package/esm/src/jobs/mod.d.ts.map +1 -1
- package/esm/src/jobs/mod.js +1 -0
- package/esm/src/jobs/mod.js.map +1 -0
- package/esm/src/jobs/run.d.ts.map +1 -1
- package/esm/src/jobs/run.js +1 -0
- package/esm/src/jobs/run.js.map +1 -0
- package/esm/src/jobs/sanitize.d.ts.map +1 -1
- package/esm/src/jobs/sanitize.js +1 -0
- package/esm/src/jobs/sanitize.js.map +1 -0
- package/esm/src/jobs/types.d.ts +1 -0
- package/esm/src/jobs/types.d.ts.map +1 -1
- package/esm/src/jobs/types.js +1 -0
- package/esm/src/jobs/types.js.map +1 -0
- package/esm/src/mail/errors.d.ts.map +1 -1
- package/esm/src/mail/errors.js +8 -42
- package/esm/src/mail/errors.js.map +1 -0
- package/esm/src/mail/memory.d.ts +1 -1
- package/esm/src/mail/memory.d.ts.map +1 -1
- package/esm/src/mail/memory.js +10 -14
- package/esm/src/mail/memory.js.map +1 -0
- package/esm/src/mail/mod.d.ts +0 -1
- package/esm/src/mail/mod.d.ts.map +1 -1
- package/esm/src/mail/mod.js +1 -1
- package/esm/src/mail/mod.js.map +1 -0
- package/esm/src/mail/postal.d.ts +1 -2
- package/esm/src/mail/postal.d.ts.map +1 -1
- package/esm/src/mail/postal.js +22 -18
- package/esm/src/mail/postal.js.map +1 -0
- package/esm/src/mail/retry.d.ts.map +1 -1
- package/esm/src/mail/retry.js +1 -0
- package/esm/src/mail/retry.js.map +1 -0
- package/esm/src/mail/sender.d.ts.map +1 -1
- package/esm/src/mail/sender.js +1 -0
- package/esm/src/mail/sender.js.map +1 -0
- package/esm/src/mail/service.d.ts.map +1 -1
- package/esm/src/mail/service.js +6 -7
- package/esm/src/mail/service.js.map +1 -0
- package/esm/src/mail/types.d.ts.map +1 -1
- package/esm/src/mail/types.js +1 -0
- package/esm/src/mail/types.js.map +1 -0
- package/esm/src/mui/apiKeys.d.ts +10 -11
- package/esm/src/mui/apiKeys.d.ts.map +1 -1
- package/esm/src/mui/apiKeys.js +83 -214
- package/esm/src/mui/apiKeys.js.map +1 -0
- package/esm/src/mui/apiKeysView.d.ts +1 -1
- package/esm/src/mui/apiKeysView.d.ts.map +1 -1
- package/esm/src/mui/apiKeysView.js +11 -9
- package/esm/src/mui/apiKeysView.js.map +1 -0
- package/esm/src/mui/confirm.d.ts +2 -2
- package/esm/src/mui/confirm.d.ts.map +1 -1
- package/esm/src/mui/confirm.js +3 -7
- package/esm/src/mui/confirm.js.map +1 -0
- package/esm/src/mui/mail.d.ts +4 -4
- package/esm/src/mui/mail.d.ts.map +1 -1
- package/esm/src/mui/mail.js +11 -71
- package/esm/src/mui/mail.js.map +1 -0
- package/esm/src/mui/mailView.d.ts +1 -1
- package/esm/src/mui/mailView.d.ts.map +1 -1
- package/esm/src/mui/mailView.js +1 -0
- package/esm/src/mui/mailView.js.map +1 -0
- package/esm/src/mui/mod.d.ts +0 -1
- package/esm/src/mui/mod.d.ts.map +1 -1
- package/esm/src/mui/mod.js +1 -0
- package/esm/src/mui/mod.js.map +1 -0
- package/esm/src/next/apiKeys/mod.d.ts +2 -3
- package/esm/src/next/apiKeys/mod.d.ts.map +1 -1
- package/esm/src/next/apiKeys/mod.js +6 -5
- package/esm/src/next/apiKeys/mod.js.map +1 -0
- package/esm/src/next/auth/client.d.ts +0 -1
- package/esm/src/next/auth/client.d.ts.map +1 -1
- package/esm/src/next/auth/client.js +1 -0
- package/esm/src/next/auth/client.js.map +1 -0
- package/esm/src/next/auth/config.d.ts.map +1 -1
- package/esm/src/next/auth/config.js +11 -17
- package/esm/src/next/auth/config.js.map +1 -0
- package/esm/src/next/auth/localTestLogin.d.ts.map +1 -1
- package/esm/src/next/auth/localTestLogin.js +13 -9
- package/esm/src/next/auth/localTestLogin.js.map +1 -0
- package/esm/src/next/auth/mod.d.ts.map +1 -1
- package/esm/src/next/auth/mod.js +1 -0
- package/esm/src/next/auth/mod.js.map +1 -0
- package/esm/src/next/auth/server.d.ts +2 -2
- package/esm/src/next/auth/server.d.ts.map +1 -1
- package/esm/src/next/auth/server.js +1 -0
- package/esm/src/next/auth/server.js.map +1 -0
- package/esm/src/next/files/mod.d.ts +0 -1
- package/esm/src/next/files/mod.d.ts.map +1 -1
- package/esm/src/next/files/mod.js +1 -1
- package/esm/src/next/files/mod.js.map +1 -0
- package/esm/src/next/files/route.d.ts +1 -1
- package/esm/src/next/files/route.d.ts.map +1 -1
- package/esm/src/next/files/route.js +11 -11
- package/esm/src/next/files/route.js.map +1 -0
- package/esm/src/next/jobs/list.d.ts +5 -5
- package/esm/src/next/jobs/list.d.ts.map +1 -1
- package/esm/src/next/jobs/list.js +15 -19
- package/esm/src/next/jobs/list.js.map +1 -0
- package/esm/src/next/jobs/mod.d.ts.map +1 -1
- package/esm/src/next/jobs/mod.js +1 -0
- package/esm/src/next/jobs/mod.js.map +1 -0
- package/esm/src/next/jobs/paths.d.ts +2 -2
- package/esm/src/next/jobs/paths.d.ts.map +1 -1
- package/esm/src/next/jobs/paths.js +1 -0
- package/esm/src/next/jobs/paths.js.map +1 -0
- package/esm/src/next/jobs/route.d.ts +2 -2
- package/esm/src/next/jobs/route.d.ts.map +1 -1
- package/esm/src/next/jobs/route.js +4 -4
- package/esm/src/next/jobs/route.js.map +1 -0
- package/esm/src/next/jobs/run.d.ts +2 -2
- package/esm/src/next/jobs/run.d.ts.map +1 -1
- package/esm/src/next/jobs/run.js +68 -132
- package/esm/src/next/jobs/run.js.map +1 -0
- package/esm/src/next/jobs/runRequest.d.ts +1 -1
- package/esm/src/next/jobs/runRequest.d.ts.map +1 -1
- package/esm/src/next/jobs/runRequest.js +3 -4
- package/esm/src/next/jobs/runRequest.js.map +1 -0
- package/esm/src/next/jobs/stream.d.ts.map +1 -1
- package/esm/src/next/jobs/stream.js +1 -0
- package/esm/src/next/jobs/stream.js.map +1 -0
- package/esm/src/next/mail/mod.d.ts +0 -1
- package/esm/src/next/mail/mod.d.ts.map +1 -1
- package/esm/src/next/mail/mod.js +1 -1
- package/esm/src/next/mail/mod.js.map +1 -0
- package/esm/src/next/mail/route.d.ts +2 -2
- package/esm/src/next/mail/route.d.ts.map +1 -1
- package/esm/src/next/mail/route.js +1 -0
- package/esm/src/next/mail/route.js.map +1 -0
- package/esm/src/next/pwa/mod.d.ts +0 -4
- package/esm/src/next/pwa/mod.d.ts.map +1 -1
- package/esm/src/next/pwa/mod.js +32 -16
- package/esm/src/next/pwa/mod.js.map +1 -0
- package/esm/src/next/pwa/worker.d.ts +0 -1
- package/esm/src/next/pwa/worker.d.ts.map +1 -1
- package/esm/src/next/pwa/worker.js +1 -0
- package/esm/src/next/pwa/worker.js.map +1 -0
- package/esm/src/next/secrets/constants.d.ts +3 -0
- package/esm/src/next/secrets/constants.d.ts.map +1 -0
- package/esm/src/next/secrets/constants.js +3 -0
- package/esm/src/next/secrets/constants.js.map +1 -0
- package/esm/src/next/secrets/mod.d.ts +1 -3
- package/esm/src/next/secrets/mod.d.ts.map +1 -1
- package/esm/src/next/secrets/mod.js +6 -7
- package/esm/src/next/secrets/mod.js.map +1 -0
- package/esm/src/next/sourceDev.d.ts +6 -0
- package/esm/src/next/sourceDev.d.ts.map +1 -0
- package/esm/src/next/sourceDev.js +41 -0
- package/esm/src/next/sourceDev.js.map +1 -0
- package/esm/src/secrets/encoding.d.ts.map +1 -1
- package/esm/src/secrets/encoding.js +1 -0
- package/esm/src/secrets/encoding.js.map +1 -0
- package/esm/src/secrets/errors.d.ts.map +1 -1
- package/esm/src/secrets/errors.js +3 -7
- package/esm/src/secrets/errors.js.map +1 -0
- package/esm/src/secrets/fingerprint.d.ts.map +1 -1
- package/esm/src/secrets/fingerprint.js +1 -0
- package/esm/src/secrets/fingerprint.js.map +1 -0
- package/esm/src/secrets/frame.d.ts.map +1 -1
- package/esm/src/secrets/frame.js +4 -3
- package/esm/src/secrets/frame.js.map +1 -0
- package/esm/src/secrets/keyring.d.ts.map +1 -1
- package/esm/src/secrets/keyring.js +6 -6
- package/esm/src/secrets/keyring.js.map +1 -0
- package/esm/src/secrets/legacy.d.ts +0 -1
- package/esm/src/secrets/legacy.d.ts.map +1 -1
- package/esm/src/secrets/legacy.js +13 -10
- package/esm/src/secrets/legacy.js.map +1 -0
- package/esm/src/secrets/maintenance.d.ts +0 -1
- package/esm/src/secrets/maintenance.d.ts.map +1 -1
- package/esm/src/secrets/maintenance.js +9 -24
- package/esm/src/secrets/maintenance.js.map +1 -0
- package/esm/src/secrets/mod.d.ts +0 -1
- package/esm/src/secrets/mod.d.ts.map +1 -1
- package/esm/src/secrets/mod.js +1 -1
- package/esm/src/secrets/mod.js.map +1 -0
- package/esm/src/secrets/secrets.d.ts.map +1 -1
- package/esm/src/secrets/secrets.js +38 -30
- package/esm/src/secrets/secrets.js.map +1 -0
- package/package.json +111 -135
- package/skills/loom/SKILL.md +40 -5
- package/skills/loom/references/dependency-upgrades.md +4 -0
- package/skills/loom/references/esm-package.md +35 -0
- package/skills/loom/references/local-development.md +261 -29
- package/skills/loom/references/release-safety.md +10 -3
- package/skills/loom-auth/references/secrets-and-rotation.md +2 -1
- package/skills/loom-mail/SKILL.md +1 -0
- package/skills/loom-scaffold/references/greenfield-workflow.md +2 -1
- package/skills/upgrade-deps/SKILL.md +4 -2
- package/source/bin/loom.ts +50 -0
- package/source/mod.ts +10 -0
- package/source/src/apiKeys/authorize.ts +294 -0
- package/source/src/apiKeys/betterAuth.ts +253 -0
- package/source/src/apiKeys/country.ts +7 -0
- package/source/src/apiKeys/credentials.ts +171 -0
- package/source/src/apiKeys/fingerprint.ts +10 -0
- package/{script/src/apiKeys/lifecycle.d.ts → source/src/apiKeys/lifecycle.ts} +21 -23
- package/source/src/apiKeys/limits.ts +372 -0
- package/source/src/apiKeys/mod.ts +11 -0
- package/source/src/apiKeys/permissions.ts +153 -0
- package/source/src/apiKeys/policy.ts +189 -0
- package/source/src/apiKeys/retention.ts +136 -0
- package/source/src/apiKeys/types.ts +288 -0
- package/source/src/cli/atomicText.ts +38 -0
- package/source/src/cli/bunLocalDev.ts +646 -0
- package/source/src/cli/bunProject.ts +433 -0
- package/source/src/cli/cliBootstrap.ts +313 -0
- package/source/src/cli/externalSkills.ts +315 -0
- package/source/src/cli/filesR2Policy.ts +212 -0
- package/source/src/cli/generatedBuild.ts +380 -0
- package/source/src/cli/generatedCleanup.ts +87 -0
- package/source/src/cli/generatedDevLease.ts +52 -0
- package/source/src/cli/generatedInstall.ts +630 -0
- package/source/src/cli/generatedWorkflow.ts +135 -0
- package/{script/src/cli/legacyManagedOutputs.js → source/src/cli/legacyManagedOutputs.ts} +36 -30
- package/source/src/cli/localDb.ts +548 -0
- package/source/src/cli/localDevLock.ts +462 -0
- package/source/src/cli/localDevPackage.ts +754 -0
- package/source/src/cli/managedFiles.ts +688 -0
- package/source/src/cli/migrationEnv.ts +267 -0
- package/source/src/cli/mod.ts +26788 -0
- package/source/src/cli/packageTreeSignature.ts +65 -0
- package/source/src/cli/processIdentity.ts +38 -0
- package/source/src/cli/projectSkills.ts +1102 -0
- package/source/src/cli/projectTooling.ts +1140 -0
- package/source/src/cli/releaseConfig.ts +36 -0
- package/source/src/cli/releaseCredentials.ts +642 -0
- package/source/src/cli/releaseTrust.ts +194 -0
- package/source/src/cli/releaseTrustCommand.ts +210 -0
- package/source/src/cli/sourceConfig.ts +106 -0
- package/source/src/cli/sourceDev.ts +1279 -0
- package/source/src/cli/vercelBuildEnv.ts +714 -0
- package/source/src/cli/vercelEnvMask.ts +182 -0
- package/source/src/cli/vercelProjectRelease.ts +807 -0
- package/source/src/cli/vercelPulledEnv.ts +174 -0
- package/source/src/clientData/identity.ts +229 -0
- package/source/src/clientData/mod.ts +1 -0
- package/source/src/files/client.ts +75 -0
- package/source/src/files/errors.ts +69 -0
- package/source/src/files/hash.ts +109 -0
- package/source/src/files/memory.ts +158 -0
- package/source/src/files/metadata.ts +251 -0
- package/source/src/files/mod.ts +8 -0
- package/source/src/files/s3.ts +182 -0
- package/source/src/files/service.ts +210 -0
- package/source/src/files/types.ts +171 -0
- package/source/src/jobs/catalog.ts +303 -0
- package/source/src/jobs/controller.ts +156 -0
- package/source/src/jobs/direct.ts +177 -0
- package/source/src/jobs/events.ts +74 -0
- package/source/src/jobs/format.ts +233 -0
- package/source/src/jobs/http.ts +83 -0
- package/source/src/jobs/log.ts +10 -0
- package/source/src/jobs/mod.ts +10 -0
- package/source/src/jobs/run.ts +141 -0
- package/source/src/jobs/sanitize.ts +142 -0
- package/source/src/jobs/types.ts +43 -0
- package/source/src/mail/errors.ts +77 -0
- package/source/src/mail/memory.ts +451 -0
- package/source/src/mail/mod.ts +5 -0
- package/source/src/mail/postal.ts +363 -0
- package/source/src/mail/retry.ts +30 -0
- package/source/src/mail/sender.ts +57 -0
- package/source/src/mail/service.ts +252 -0
- package/source/src/mail/types.ts +229 -0
- package/source/src/mui/apiKeys.tsx +1044 -0
- package/source/src/mui/apiKeysView.ts +535 -0
- package/source/src/mui/confirm.tsx +138 -0
- package/source/src/mui/mail.tsx +279 -0
- package/source/src/mui/mailView.ts +50 -0
- package/source/src/mui/mod.ts +3 -0
- package/source/src/next/apiKeys/mod.ts +393 -0
- package/{script/src/next/auth/client.d.ts → source/src/next/auth/client.ts} +19 -5
- package/source/src/next/auth/config.ts +207 -0
- package/source/src/next/auth/localTestLogin.ts +412 -0
- package/source/src/next/auth/mod.ts +3 -0
- package/source/src/next/auth/server.ts +94 -0
- package/source/src/next/files/mod.ts +1 -0
- package/source/src/next/files/route.ts +621 -0
- package/source/src/next/jobs/list.tsx +90 -0
- package/source/src/next/jobs/mod.ts +5 -0
- package/source/src/next/jobs/paths.ts +70 -0
- package/source/src/next/jobs/route.ts +207 -0
- package/source/src/next/jobs/run.tsx +888 -0
- package/source/src/next/jobs/runRequest.ts +92 -0
- package/source/src/next/jobs/stream.ts +33 -0
- package/source/src/next/mail/mod.ts +1 -0
- package/source/src/next/mail/route.ts +75 -0
- package/source/src/next/pwa/mod.tsx +453 -0
- package/source/src/next/pwa/worker.ts +59 -0
- package/source/src/next/secrets/constants.ts +2 -0
- package/source/src/next/secrets/mod.ts +319 -0
- package/source/src/next/sourceDev.ts +50 -0
- package/source/src/secrets/encoding.ts +102 -0
- package/source/src/secrets/errors.ts +58 -0
- package/source/src/secrets/fingerprint.ts +132 -0
- package/source/src/secrets/frame.ts +119 -0
- package/source/src/secrets/keyring.ts +225 -0
- package/source/src/secrets/legacy.ts +244 -0
- package/source/src/secrets/maintenance.ts +517 -0
- package/source/src/secrets/mod.ts +38 -0
- package/source/src/secrets/secrets.ts +926 -0
- package/db/databaseTls.test.ts +0 -171
- package/db/databaseUrl.test.ts +0 -72
- package/db/neonEndpoint.test.ts +0 -51
- package/db/testing.test.ts +0 -28
- package/deno.json +0 -3
- package/esm/_dnt.polyfills.d.ts +0 -166
- package/esm/_dnt.polyfills.d.ts.map +0 -1
- package/esm/_dnt.polyfills.js +0 -177
- package/esm/_dnt.shims.d.ts +0 -2
- package/esm/_dnt.shims.d.ts.map +0 -1
- package/esm/_dnt.shims.js +0 -57
- package/esm/package.json +0 -3
- package/script/_dnt.polyfills.d.ts +0 -166
- package/script/_dnt.polyfills.d.ts.map +0 -1
- package/script/_dnt.polyfills.js +0 -180
- package/script/_dnt.shims.d.ts +0 -2
- package/script/_dnt.shims.d.ts.map +0 -1
- package/script/_dnt.shims.js +0 -60
- package/script/bin/loom.d.ts +0 -2
- package/script/bin/loom.d.ts.map +0 -1
- package/script/bin/loom.js +0 -17
- package/script/mod.d.ts +0 -12
- package/script/mod.d.ts.map +0 -1
- package/script/mod.js +0 -27
- package/script/package.json +0 -3
- package/script/src/apiKeys/authorize.d.ts +0 -4
- package/script/src/apiKeys/authorize.d.ts.map +0 -1
- package/script/src/apiKeys/authorize.js +0 -258
- package/script/src/apiKeys/betterAuth.d.ts +0 -123
- package/script/src/apiKeys/betterAuth.d.ts.map +0 -1
- package/script/src/apiKeys/betterAuth.js +0 -169
- package/script/src/apiKeys/country.d.ts +0 -3
- package/script/src/apiKeys/country.d.ts.map +0 -1
- package/script/src/apiKeys/country.js +0 -10
- package/script/src/apiKeys/credentials.d.ts +0 -39
- package/script/src/apiKeys/credentials.d.ts.map +0 -1
- package/script/src/apiKeys/credentials.js +0 -121
- package/script/src/apiKeys/fingerprint.d.ts +0 -3
- package/script/src/apiKeys/fingerprint.d.ts.map +0 -1
- package/script/src/apiKeys/fingerprint.js +0 -8
- package/script/src/apiKeys/lifecycle.d.ts.map +0 -1
- package/script/src/apiKeys/lifecycle.js +0 -7
- package/script/src/apiKeys/limits.d.ts +0 -132
- package/script/src/apiKeys/limits.d.ts.map +0 -1
- package/script/src/apiKeys/limits.js +0 -254
- package/script/src/apiKeys/mod.d.ts +0 -13
- package/script/src/apiKeys/mod.d.ts.map +0 -1
- package/script/src/apiKeys/mod.js +0 -28
- package/script/src/apiKeys/permissions.d.ts +0 -56
- package/script/src/apiKeys/permissions.d.ts.map +0 -1
- package/script/src/apiKeys/permissions.js +0 -136
- package/script/src/apiKeys/policy.d.ts +0 -61
- package/script/src/apiKeys/policy.d.ts.map +0 -1
- package/script/src/apiKeys/policy.js +0 -94
- package/script/src/apiKeys/retention.d.ts +0 -55
- package/script/src/apiKeys/retention.d.ts.map +0 -1
- package/script/src/apiKeys/retention.js +0 -70
- package/script/src/apiKeys/types.d.ts +0 -242
- package/script/src/apiKeys/types.d.ts.map +0 -1
- package/script/src/apiKeys/types.js +0 -2
- package/script/src/cli/externalSkills.d.ts +0 -39
- package/script/src/cli/externalSkills.d.ts.map +0 -1
- package/script/src/cli/externalSkills.js +0 -204
- package/script/src/cli/filesR2Policy.d.ts +0 -33
- package/script/src/cli/filesR2Policy.d.ts.map +0 -1
- package/script/src/cli/filesR2Policy.js +0 -135
- package/script/src/cli/legacyManagedOutputs.d.ts +0 -33
- package/script/src/cli/legacyManagedOutputs.d.ts.map +0 -1
- package/script/src/cli/localDb.d.ts +0 -28
- package/script/src/cli/localDb.d.ts.map +0 -1
- package/script/src/cli/localDb.js +0 -370
- package/script/src/cli/localDevLock.d.ts +0 -97
- package/script/src/cli/localDevLock.d.ts.map +0 -1
- package/script/src/cli/localDevLock.js +0 -320
- package/script/src/cli/localDevPackage.d.ts +0 -172
- package/script/src/cli/localDevPackage.d.ts.map +0 -1
- package/script/src/cli/localDevPackage.js +0 -635
- package/script/src/cli/managedFiles.d.ts +0 -131
- package/script/src/cli/managedFiles.d.ts.map +0 -1
- package/script/src/cli/managedFiles.js +0 -536
- package/script/src/cli/migrationEnv.d.ts +0 -63
- package/script/src/cli/migrationEnv.d.ts.map +0 -1
- package/script/src/cli/migrationEnv.js +0 -217
- package/script/src/cli/mod.d.ts +0 -581
- package/script/src/cli/mod.d.ts.map +0 -1
- package/script/src/cli/mod.js +0 -16850
- package/script/src/cli/projectSkills.d.ts +0 -109
- package/script/src/cli/projectSkills.d.ts.map +0 -1
- package/script/src/cli/projectSkills.js +0 -749
- package/script/src/cli/projectTooling.d.ts +0 -164
- package/script/src/cli/projectTooling.d.ts.map +0 -1
- package/script/src/cli/projectTooling.js +0 -847
- package/script/src/cli/releaseConfig.d.ts +0 -10
- package/script/src/cli/releaseConfig.d.ts.map +0 -1
- package/script/src/cli/releaseConfig.js +0 -26
- package/script/src/cli/releaseCredentials.d.ts +0 -32
- package/script/src/cli/releaseCredentials.d.ts.map +0 -1
- package/script/src/cli/releaseCredentials.js +0 -392
- package/script/src/cli/releaseTrust.d.ts +0 -39
- package/script/src/cli/releaseTrust.d.ts.map +0 -1
- package/script/src/cli/releaseTrust.js +0 -130
- package/script/src/cli/releaseTrustCommand.d.ts +0 -18
- package/script/src/cli/releaseTrustCommand.d.ts.map +0 -1
- package/script/src/cli/releaseTrustCommand.js +0 -145
- package/script/src/cli/vercelBuildEnv.d.ts +0 -62
- package/script/src/cli/vercelBuildEnv.d.ts.map +0 -1
- package/script/src/cli/vercelBuildEnv.js +0 -401
- package/script/src/cli/vercelProjectRelease.d.ts +0 -38
- package/script/src/cli/vercelProjectRelease.d.ts.map +0 -1
- package/script/src/cli/vercelProjectRelease.js +0 -607
- package/script/src/clientData/identity.d.ts +0 -89
- package/script/src/clientData/identity.d.ts.map +0 -1
- package/script/src/clientData/identity.js +0 -134
- package/script/src/clientData/mod.d.ts +0 -3
- package/script/src/clientData/mod.d.ts.map +0 -1
- package/script/src/clientData/mod.js +0 -18
- package/script/src/files/client.d.ts +0 -29
- package/script/src/files/client.d.ts.map +0 -1
- package/script/src/files/client.js +0 -45
- package/script/src/files/errors.d.ts +0 -37
- package/script/src/files/errors.d.ts.map +0 -1
- package/script/src/files/errors.js +0 -76
- package/script/src/files/hash.d.ts +0 -15
- package/script/src/files/hash.d.ts.map +0 -1
- package/script/src/files/hash.js +0 -89
- package/script/src/files/memory.d.ts +0 -29
- package/script/src/files/memory.d.ts.map +0 -1
- package/script/src/files/memory.js +0 -113
- package/script/src/files/metadata.d.ts +0 -10
- package/script/src/files/metadata.d.ts.map +0 -1
- package/script/src/files/metadata.js +0 -189
- package/script/src/files/mod.d.ts +0 -10
- package/script/src/files/mod.d.ts.map +0 -1
- package/script/src/files/mod.js +0 -25
- package/script/src/files/s3.d.ts +0 -29
- package/script/src/files/s3.d.ts.map +0 -1
- package/script/src/files/s3.js +0 -110
- package/script/src/files/service.d.ts +0 -27
- package/script/src/files/service.d.ts.map +0 -1
- package/script/src/files/service.js +0 -139
- package/script/src/files/types.d.ts +0 -134
- package/script/src/files/types.d.ts.map +0 -1
- package/script/src/files/types.js +0 -2
- package/script/src/jobs/catalog.d.ts +0 -32
- package/script/src/jobs/catalog.d.ts.map +0 -1
- package/script/src/jobs/catalog.js +0 -223
- package/script/src/jobs/controller.d.ts +0 -41
- package/script/src/jobs/controller.d.ts.map +0 -1
- package/script/src/jobs/controller.js +0 -151
- package/script/src/jobs/direct.d.ts +0 -36
- package/script/src/jobs/direct.d.ts.map +0 -1
- package/script/src/jobs/direct.js +0 -128
- package/script/src/jobs/events.d.ts +0 -23
- package/script/src/jobs/events.d.ts.map +0 -1
- package/script/src/jobs/events.js +0 -50
- package/script/src/jobs/format.d.ts +0 -16
- package/script/src/jobs/format.d.ts.map +0 -1
- package/script/src/jobs/format.js +0 -193
- package/script/src/jobs/http.d.ts +0 -22
- package/script/src/jobs/http.d.ts.map +0 -1
- package/script/src/jobs/http.js +0 -50
- package/script/src/jobs/log.d.ts +0 -2
- package/script/src/jobs/log.d.ts.map +0 -1
- package/script/src/jobs/log.js +0 -13
- package/script/src/jobs/mod.d.ts +0 -11
- package/script/src/jobs/mod.d.ts.map +0 -1
- package/script/src/jobs/mod.js +0 -26
- package/script/src/jobs/run.d.ts +0 -39
- package/script/src/jobs/run.d.ts.map +0 -1
- package/script/src/jobs/run.js +0 -86
- package/script/src/jobs/sanitize.d.ts +0 -30
- package/script/src/jobs/sanitize.d.ts.map +0 -1
- package/script/src/jobs/sanitize.js +0 -97
- package/script/src/jobs/types.d.ts +0 -31
- package/script/src/jobs/types.d.ts.map +0 -1
- package/script/src/jobs/types.js +0 -2
- package/script/src/mail/errors.d.ts +0 -33
- package/script/src/mail/errors.d.ts.map +0 -1
- package/script/src/mail/errors.js +0 -97
- package/script/src/mail/memory.d.ts +0 -30
- package/script/src/mail/memory.d.ts.map +0 -1
- package/script/src/mail/memory.js +0 -345
- package/script/src/mail/mod.d.ts +0 -7
- package/script/src/mail/mod.d.ts.map +0 -1
- package/script/src/mail/mod.js +0 -22
- package/script/src/mail/postal.d.ts +0 -57
- package/script/src/mail/postal.d.ts.map +0 -1
- package/script/src/mail/postal.js +0 -251
- package/script/src/mail/retry.d.ts +0 -9
- package/script/src/mail/retry.d.ts.map +0 -1
- package/script/src/mail/retry.js +0 -22
- package/script/src/mail/sender.d.ts +0 -5
- package/script/src/mail/sender.d.ts.map +0 -1
- package/script/src/mail/sender.js +0 -52
- package/script/src/mail/service.d.ts +0 -23
- package/script/src/mail/service.d.ts.map +0 -1
- package/script/src/mail/service.js +0 -191
- package/script/src/mail/types.d.ts +0 -176
- package/script/src/mail/types.d.ts.map +0 -1
- package/script/src/mail/types.js +0 -2
- package/script/src/mui/apiKeys.d.ts +0 -171
- package/script/src/mui/apiKeys.d.ts.map +0 -1
- package/script/src/mui/apiKeys.js +0 -470
- package/script/src/mui/apiKeysView.d.ts +0 -193
- package/script/src/mui/apiKeysView.d.ts.map +0 -1
- package/script/src/mui/apiKeysView.js +0 -331
- package/script/src/mui/confirm.d.ts +0 -12
- package/script/src/mui/confirm.d.ts.map +0 -1
- package/script/src/mui/confirm.js +0 -85
- package/script/src/mui/mail.d.ts +0 -29
- package/script/src/mui/mail.d.ts.map +0 -1
- package/script/src/mui/mail.js +0 -159
- package/script/src/mui/mailView.d.ts +0 -20
- package/script/src/mui/mailView.d.ts.map +0 -1
- package/script/src/mui/mailView.js +0 -32
- package/script/src/mui/mod.d.ts +0 -5
- package/script/src/mui/mod.d.ts.map +0 -1
- package/script/src/mui/mod.js +0 -20
- package/script/src/next/apiKeys/mod.d.ts +0 -71
- package/script/src/next/apiKeys/mod.d.ts.map +0 -1
- package/script/src/next/apiKeys/mod.js +0 -227
- package/script/src/next/auth/client.d.ts.map +0 -1
- package/script/src/next/auth/client.js +0 -39
- package/script/src/next/auth/config.d.ts +0 -62
- package/script/src/next/auth/config.d.ts.map +0 -1
- package/script/src/next/auth/config.js +0 -178
- package/script/src/next/auth/localTestLogin.d.ts +0 -75
- package/script/src/next/auth/localTestLogin.d.ts.map +0 -1
- package/script/src/next/auth/localTestLogin.js +0 -291
- package/script/src/next/auth/mod.d.ts +0 -4
- package/script/src/next/auth/mod.d.ts.map +0 -1
- package/script/src/next/auth/mod.js +0 -19
- package/script/src/next/auth/server.d.ts +0 -44
- package/script/src/next/auth/server.d.ts.map +0 -1
- package/script/src/next/auth/server.js +0 -39
- package/script/src/next/files/mod.d.ts +0 -3
- package/script/src/next/files/mod.d.ts.map +0 -1
- package/script/src/next/files/mod.js +0 -18
- package/script/src/next/files/route.d.ts +0 -99
- package/script/src/next/files/route.d.ts.map +0 -1
- package/script/src/next/files/route.js +0 -353
- package/script/src/next/jobs/list.d.ts +0 -25
- package/script/src/next/jobs/list.d.ts.map +0 -1
- package/script/src/next/jobs/list.js +0 -48
- package/script/src/next/jobs/mod.d.ts +0 -6
- package/script/src/next/jobs/mod.d.ts.map +0 -1
- package/script/src/next/jobs/mod.js +0 -21
- package/script/src/next/jobs/paths.d.ts +0 -14
- package/script/src/next/jobs/paths.d.ts.map +0 -1
- package/script/src/next/jobs/paths.js +0 -47
- package/script/src/next/jobs/route.d.ts +0 -48
- package/script/src/next/jobs/route.d.ts.map +0 -1
- package/script/src/next/jobs/route.js +0 -105
- package/script/src/next/jobs/run.d.ts +0 -58
- package/script/src/next/jobs/run.d.ts.map +0 -1
- package/script/src/next/jobs/run.js +0 -592
- package/script/src/next/jobs/runRequest.d.ts +0 -19
- package/script/src/next/jobs/runRequest.d.ts.map +0 -1
- package/script/src/next/jobs/runRequest.js +0 -81
- package/script/src/next/jobs/stream.d.ts +0 -3
- package/script/src/next/jobs/stream.d.ts.map +0 -1
- package/script/src/next/jobs/stream.js +0 -28
- package/script/src/next/mail/mod.d.ts +0 -3
- package/script/src/next/mail/mod.d.ts.map +0 -1
- package/script/src/next/mail/mod.js +0 -18
- package/script/src/next/mail/route.d.ts +0 -12
- package/script/src/next/mail/route.d.ts.map +0 -1
- package/script/src/next/mail/route.js +0 -46
- package/script/src/next/pwa/mod.d.ts +0 -112
- package/script/src/next/pwa/mod.d.ts.map +0 -1
- package/script/src/next/pwa/mod.js +0 -303
- package/script/src/next/pwa/worker.d.ts +0 -27
- package/script/src/next/pwa/worker.d.ts.map +0 -1
- package/script/src/next/pwa/worker.js +0 -33
- package/script/src/next/secrets/mod.d.ts +0 -108
- package/script/src/next/secrets/mod.d.ts.map +0 -1
- package/script/src/next/secrets/mod.js +0 -218
- package/script/src/secrets/encoding.d.ts +0 -32
- package/script/src/secrets/encoding.d.ts.map +0 -1
- package/script/src/secrets/encoding.js +0 -95
- package/script/src/secrets/errors.d.ts +0 -45
- package/script/src/secrets/errors.d.ts.map +0 -1
- package/script/src/secrets/errors.js +0 -45
- package/script/src/secrets/fingerprint.d.ts +0 -43
- package/script/src/secrets/fingerprint.d.ts.map +0 -1
- package/script/src/secrets/fingerprint.js +0 -92
- package/script/src/secrets/frame.d.ts +0 -34
- package/script/src/secrets/frame.d.ts.map +0 -1
- package/script/src/secrets/frame.js +0 -91
- package/script/src/secrets/keyring.d.ts +0 -62
- package/script/src/secrets/keyring.d.ts.map +0 -1
- package/script/src/secrets/keyring.js +0 -202
- package/script/src/secrets/legacy.d.ts +0 -60
- package/script/src/secrets/legacy.d.ts.map +0 -1
- package/script/src/secrets/legacy.js +0 -186
- package/script/src/secrets/maintenance.d.ts +0 -173
- package/script/src/secrets/maintenance.d.ts.map +0 -1
- package/script/src/secrets/maintenance.js +0 -323
- package/script/src/secrets/mod.d.ts +0 -6
- package/script/src/secrets/mod.d.ts.map +0 -1
- package/script/src/secrets/mod.js +0 -24
- package/script/src/secrets/secrets.d.ts +0 -192
- package/script/src/secrets/secrets.d.ts.map +0 -1
- package/script/src/secrets/secrets.js +0 -532
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSecretKeyFingerprint = isSecretKeyFingerprint;
|
|
4
|
-
exports.secretKeyFingerprint = secretKeyFingerprint;
|
|
5
|
-
exports.parseExpectedSecretKeys = parseExpectedSecretKeys;
|
|
6
|
-
const encoding_js_1 = require("./encoding.js");
|
|
7
|
-
const errors_js_1 = require("./errors.js");
|
|
8
|
-
const keyring_js_1 = require("./keyring.js");
|
|
9
|
-
const FINGERPRINT_BITS = 64;
|
|
10
|
-
const FINGERPRINT_PATTERN = /^[0-9a-f]{16}$/;
|
|
11
|
-
/** Whether a string has the shape of a key fingerprint. */
|
|
12
|
-
function isSecretKeyFingerprint(value) {
|
|
13
|
-
return typeof value === "string" && FINGERPRINT_PATTERN.test(value);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A short public identifier of a key: the first 8 bytes of an HKDF output that
|
|
17
|
-
* is used for nothing else.
|
|
18
|
-
*
|
|
19
|
-
* A write-only variable cannot be read back, so this is how an operator proves
|
|
20
|
-
* that the key in the deployment is the key in the password manager: compute
|
|
21
|
-
* it from the saved copy, and compare with what the running app reports. It is
|
|
22
|
-
* safe to commit and to log. It is not a key id and never appears in a sealed
|
|
23
|
-
* string.
|
|
24
|
-
*/
|
|
25
|
-
async function secretKeyFingerprint(key) {
|
|
26
|
-
if (!(key instanceof Uint8Array) || key.length !== keyring_js_1.SECRETS_KEY_BYTES) {
|
|
27
|
-
throw new errors_js_1.SecretsKeyError(`A key must be exactly ${keyring_js_1.SECRETS_KEY_BYTES} bytes to be fingerprinted.`);
|
|
28
|
-
}
|
|
29
|
-
const base = await globalThis.crypto.subtle.importKey("raw", new Uint8Array(key), "HKDF", false, ["deriveBits"]);
|
|
30
|
-
const bits = await globalThis.crypto.subtle.deriveBits({
|
|
31
|
-
name: "HKDF",
|
|
32
|
-
hash: "SHA-256",
|
|
33
|
-
salt: new Uint8Array(0),
|
|
34
|
-
info: (0, encoding_js_1.pae)(["loom-secrets", "ls1", "fingerprint"]),
|
|
35
|
-
}, base, FINGERPRINT_BITS);
|
|
36
|
-
return [...new Uint8Array(bits)]
|
|
37
|
-
.map((byte) => byte.toString(16).padStart(2, "0"))
|
|
38
|
-
.join("");
|
|
39
|
-
}
|
|
40
|
-
const KEY_STATES = [
|
|
41
|
-
"active",
|
|
42
|
-
"decrypt-only",
|
|
43
|
-
"retired",
|
|
44
|
-
];
|
|
45
|
-
/**
|
|
46
|
-
* Validates an expected-key list, for example one read from `loom.json`, and
|
|
47
|
-
* returns a copy. Throws a `TypeError` naming the entry that is wrong.
|
|
48
|
-
*
|
|
49
|
-
* The list must have exactly one `active` key. No version and no fingerprint
|
|
50
|
-
* may appear twice: one fingerprint under two versions means one key was
|
|
51
|
-
* entered twice.
|
|
52
|
-
*/
|
|
53
|
-
function parseExpectedSecretKeys(value) {
|
|
54
|
-
if (!Array.isArray(value)) {
|
|
55
|
-
throw new TypeError("The expected key list must be an array.");
|
|
56
|
-
}
|
|
57
|
-
const ids = new Set();
|
|
58
|
-
const fingerprints = new Set();
|
|
59
|
-
const keys = value.map((entry, index) => {
|
|
60
|
-
const candidate = entry;
|
|
61
|
-
const where = `Expected key ${index + 1}`;
|
|
62
|
-
if (candidate === null || typeof candidate !== "object") {
|
|
63
|
-
throw new TypeError(`${where} must be an object.`);
|
|
64
|
-
}
|
|
65
|
-
if (!(0, keyring_js_1.isSecretKeyId)(candidate.id)) {
|
|
66
|
-
throw new TypeError(`${where} needs a key version as its id.`);
|
|
67
|
-
}
|
|
68
|
-
if (!isSecretKeyFingerprint(candidate.fingerprint)) {
|
|
69
|
-
throw new TypeError(`${where} needs a fingerprint of 16 lowercase hex characters.`);
|
|
70
|
-
}
|
|
71
|
-
if (!KEY_STATES.includes(candidate.state)) {
|
|
72
|
-
throw new TypeError(`${where} needs a state of active, decrypt-only or retired.`);
|
|
73
|
-
}
|
|
74
|
-
if (ids.has(candidate.id)) {
|
|
75
|
-
throw new TypeError(`Key version ${candidate.id} is listed twice.`);
|
|
76
|
-
}
|
|
77
|
-
if (fingerprints.has(candidate.fingerprint)) {
|
|
78
|
-
throw new TypeError(`Key version ${candidate.id} has the same fingerprint as another version.`);
|
|
79
|
-
}
|
|
80
|
-
ids.add(candidate.id);
|
|
81
|
-
fingerprints.add(candidate.fingerprint);
|
|
82
|
-
return {
|
|
83
|
-
fingerprint: candidate.fingerprint,
|
|
84
|
-
id: candidate.id,
|
|
85
|
-
state: candidate.state,
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
if (keys.filter((key) => key.state === "active").length !== 1) {
|
|
89
|
-
throw new TypeError("Exactly one expected key must be active.");
|
|
90
|
-
}
|
|
91
|
-
return keys;
|
|
92
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/** What a sealed payload holds, recorded in the frame so `open` can check it. */
|
|
2
|
-
export type SecretPayloadKind = "text" | "bytes" | "json";
|
|
3
|
-
/** A parsed plaintext frame. */
|
|
4
|
-
export interface SecretFrame {
|
|
5
|
-
kind: SecretPayloadKind;
|
|
6
|
-
/** Seconds since the Unix epoch after which the value must not be used. */
|
|
7
|
-
expiresAt: number | undefined;
|
|
8
|
-
payload: Uint8Array<ArrayBuffer>;
|
|
9
|
-
}
|
|
10
|
-
/** Plaintext is padded to a multiple of this many bytes. */
|
|
11
|
-
export declare const FRAME_BLOCK_BYTES = 32;
|
|
12
|
-
/**
|
|
13
|
-
* Builds the plaintext that is encrypted:
|
|
14
|
-
*
|
|
15
|
-
* ```
|
|
16
|
-
* header ‖ [expiry] ‖ payload ‖ 0x80 ‖ 0x00… (to a multiple of 32 bytes)
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* The header byte holds the payload kind in its low two bits and sets 0x80
|
|
20
|
-
* when an 8-byte big-endian expiry follows. Padding hides the exact length of
|
|
21
|
-
* short values such as passwords; it is removed only after the ciphertext has
|
|
22
|
-
* authenticated, so it cannot act as a padding oracle.
|
|
23
|
-
*/
|
|
24
|
-
export declare function encodeFrame(frame: {
|
|
25
|
-
kind: SecretPayloadKind;
|
|
26
|
-
expiresAt?: number | undefined;
|
|
27
|
-
payload: Uint8Array;
|
|
28
|
-
}): Uint8Array<ArrayBuffer>;
|
|
29
|
-
/**
|
|
30
|
-
* Parses an authenticated frame, or returns `null` when it is not one that
|
|
31
|
-
* {@link encodeFrame} could have produced.
|
|
32
|
-
*/
|
|
33
|
-
export declare function decodeFrame(bytes: Uint8Array): SecretFrame | null;
|
|
34
|
-
//# sourceMappingURL=frame.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../../src/src/secrets/frame.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAE1D,gCAAgC;AAChC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,iBAAiB,CAAC;IACxB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CAClC;AAED,4DAA4D;AAC5D,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAapC;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,OAAO,EAAE,UAAU,CAAC;CACrB,GAAG,UAAU,CAAC,WAAW,CAAC,CAwB1B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,CA4CjE"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FRAME_BLOCK_BYTES = void 0;
|
|
4
|
-
exports.encodeFrame = encodeFrame;
|
|
5
|
-
exports.decodeFrame = decodeFrame;
|
|
6
|
-
/** Plaintext is padded to a multiple of this many bytes. */
|
|
7
|
-
exports.FRAME_BLOCK_BYTES = 32;
|
|
8
|
-
const KIND_CODES = {
|
|
9
|
-
text: 0,
|
|
10
|
-
bytes: 1,
|
|
11
|
-
json: 2,
|
|
12
|
-
};
|
|
13
|
-
const KINDS = ["text", "bytes", "json"];
|
|
14
|
-
const KIND_MASK = 0x03;
|
|
15
|
-
const EXPIRY_FLAG = 0x80;
|
|
16
|
-
const PADDING_MARKER = 0x80;
|
|
17
|
-
const EXPIRY_BYTES = 8;
|
|
18
|
-
/**
|
|
19
|
-
* Builds the plaintext that is encrypted:
|
|
20
|
-
*
|
|
21
|
-
* ```
|
|
22
|
-
* header ‖ [expiry] ‖ payload ‖ 0x80 ‖ 0x00… (to a multiple of 32 bytes)
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* The header byte holds the payload kind in its low two bits and sets 0x80
|
|
26
|
-
* when an 8-byte big-endian expiry follows. Padding hides the exact length of
|
|
27
|
-
* short values such as passwords; it is removed only after the ciphertext has
|
|
28
|
-
* authenticated, so it cannot act as a padding oracle.
|
|
29
|
-
*/
|
|
30
|
-
function encodeFrame(frame) {
|
|
31
|
-
const hasExpiry = frame.expiresAt !== undefined;
|
|
32
|
-
if (hasExpiry &&
|
|
33
|
-
(!Number.isSafeInteger(frame.expiresAt) || frame.expiresAt < 0)) {
|
|
34
|
-
throw new RangeError("Expiry must be a non-negative whole second.");
|
|
35
|
-
}
|
|
36
|
-
const headerBytes = 1 + (hasExpiry ? EXPIRY_BYTES : 0);
|
|
37
|
-
const length = Math.ceil((headerBytes + frame.payload.length + 1) / exports.FRAME_BLOCK_BYTES) * exports.FRAME_BLOCK_BYTES;
|
|
38
|
-
const output = new Uint8Array(length);
|
|
39
|
-
output[0] = KIND_CODES[frame.kind] | (hasExpiry ? EXPIRY_FLAG : 0);
|
|
40
|
-
if (hasExpiry) {
|
|
41
|
-
new DataView(output.buffer).setBigUint64(1, BigInt(frame.expiresAt), false);
|
|
42
|
-
}
|
|
43
|
-
output.set(frame.payload, headerBytes);
|
|
44
|
-
output[headerBytes + frame.payload.length] = PADDING_MARKER;
|
|
45
|
-
return output;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Parses an authenticated frame, or returns `null` when it is not one that
|
|
49
|
-
* {@link encodeFrame} could have produced.
|
|
50
|
-
*/
|
|
51
|
-
function decodeFrame(bytes) {
|
|
52
|
-
if (bytes.length === 0 || bytes.length % exports.FRAME_BLOCK_BYTES !== 0) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
let markerIndex = bytes.length - 1;
|
|
56
|
-
while (markerIndex >= 0 && bytes[markerIndex] === 0) {
|
|
57
|
-
markerIndex -= 1;
|
|
58
|
-
}
|
|
59
|
-
if (markerIndex < 0 ||
|
|
60
|
-
bytes[markerIndex] !== PADDING_MARKER ||
|
|
61
|
-
bytes.length - markerIndex > exports.FRAME_BLOCK_BYTES) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
const header = bytes[0];
|
|
65
|
-
if ((header & ~(KIND_MASK | EXPIRY_FLAG)) !== 0) {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
const kind = KINDS[header & KIND_MASK];
|
|
69
|
-
if (kind === undefined) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
const hasExpiry = (header & EXPIRY_FLAG) !== 0;
|
|
73
|
-
const headerBytes = 1 + (hasExpiry ? EXPIRY_BYTES : 0);
|
|
74
|
-
if (markerIndex < headerBytes) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
let expiresAt;
|
|
78
|
-
if (hasExpiry) {
|
|
79
|
-
const seconds = new DataView(bytes.buffer, bytes.byteOffset, bytes.length)
|
|
80
|
-
.getBigUint64(1, false);
|
|
81
|
-
if (seconds > BigInt(Number.MAX_SAFE_INTEGER)) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
expiresAt = Number(seconds);
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
kind,
|
|
88
|
-
expiresAt,
|
|
89
|
-
payload: bytes.slice(headerBytes, markerIndex),
|
|
90
|
-
};
|
|
91
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/** Every key is exactly this many random bytes. */
|
|
2
|
-
export declare const SECRETS_KEY_BYTES = 32;
|
|
3
|
-
export declare const DEFAULT_SECRETS_KEY_ENV_PREFIX = "LOOM_SECRETS_KEY_";
|
|
4
|
-
export declare const DEFAULT_SECRETS_ACTIVE_KEY_ENV = "LOOM_SECRETS_ACTIVE_KEY";
|
|
5
|
-
type SecretsEnv = Record<string, string | undefined>;
|
|
6
|
-
/**
|
|
7
|
-
* Where keys come from. Asynchronous so that a provider can later unwrap a key
|
|
8
|
-
* through a KMS without changing any stored ciphertext.
|
|
9
|
-
*/
|
|
10
|
-
export interface SecretKeyring {
|
|
11
|
-
/** The key version that encrypts. Throws {@link SecretsKeyError}. */
|
|
12
|
-
activeKeyId(): Promise<number>;
|
|
13
|
-
/**
|
|
14
|
-
* The raw key for a version, or `null` when that version is not configured.
|
|
15
|
-
* Throws {@link SecretsKeyError} when it is configured but unusable.
|
|
16
|
-
*/
|
|
17
|
-
key(id: number): Promise<Uint8Array | null>;
|
|
18
|
-
}
|
|
19
|
-
/** Options for {@link envKeyring}. */
|
|
20
|
-
export interface EnvKeyringOptions {
|
|
21
|
-
/** Defaults to `process.env`, read at call time and never at import. */
|
|
22
|
-
env?: SecretsEnv;
|
|
23
|
-
/** Variable name prefix; the key version is appended. */
|
|
24
|
-
keyPrefix?: string;
|
|
25
|
-
/** Variable that names the key version that encrypts. */
|
|
26
|
-
activeKeyName?: string;
|
|
27
|
-
}
|
|
28
|
-
/** Whether a number can be a key version: an integer from 1 to 999999999. */
|
|
29
|
-
export declare function isSecretKeyId(id: unknown): id is number;
|
|
30
|
-
/** Parses the decimal key version used in variable names and sealed strings. */
|
|
31
|
-
export declare function parseSecretKeyId(text: string): number | null;
|
|
32
|
-
/**
|
|
33
|
-
* Trims a configured key value and rejects what is certainly not a key: an
|
|
34
|
-
* empty value, or a placeholder a platform or build put in its place. Shared
|
|
35
|
-
* with the legacy reader so both name these cases the same way.
|
|
36
|
-
*/
|
|
37
|
-
export declare function trimKeyValue(value: string, name: string): string;
|
|
38
|
-
/**
|
|
39
|
-
* Decodes one configured key, accepting standard base64 or base64url.
|
|
40
|
-
*
|
|
41
|
-
* Surrounding whitespace is trimmed: a pasted trailing newline is the common
|
|
42
|
-
* mistake, and a write-only variable cannot be inspected to find it. Errors
|
|
43
|
-
* name the variable and the problem, never the value.
|
|
44
|
-
*/
|
|
45
|
-
export declare function decodeSecretKey(value: string, name: string): Uint8Array;
|
|
46
|
-
/**
|
|
47
|
-
* Reads keys from environment variables: one variable per key version
|
|
48
|
-
* (`LOOM_SECRETS_KEY_<n>`) and a required pointer
|
|
49
|
-
* (`LOOM_SECRETS_ACTIVE_KEY`) naming the version that encrypts.
|
|
50
|
-
*
|
|
51
|
-
* A version is always read by name. Nothing is enumerated and nothing is read
|
|
52
|
-
* until a key is needed, so a build that never seals or opens needs no key,
|
|
53
|
-
* and one unusable variable does not affect the others.
|
|
54
|
-
*/
|
|
55
|
-
export declare function envKeyring(options?: EnvKeyringOptions): SecretKeyring;
|
|
56
|
-
/**
|
|
57
|
-
* A fixed set of keys, for tests and for callers that load keys themselves.
|
|
58
|
-
* `activeKeyId` may be omitted only when exactly one key is given.
|
|
59
|
-
*/
|
|
60
|
-
export declare function staticKeyring(keys: Readonly<Record<number, Uint8Array>>, activeKeyId?: number): SecretKeyring;
|
|
61
|
-
export {};
|
|
62
|
-
//# sourceMappingURL=keyring.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.d.ts","sourceRoot":"","sources":["../../../src/src/secrets/keyring.ts"],"names":[],"mappings":"AAIA,mDAAmD;AACnD,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,8BAA8B,sBAAsB,CAAC;AAClE,eAAO,MAAM,8BAA8B,4BAA4B,CAAC;AAexE,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/B;;;OAGG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CAC7C;AAED,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,MAAM,CAGvD;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAiBhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CA4BvE;AAMD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,aAAa,CAkDzE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,EAC1C,WAAW,CAAC,EAAE,MAAM,GACnB,aAAa,CA8Bf"}
|
|
@@ -1,202 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.DEFAULT_SECRETS_ACTIVE_KEY_ENV = exports.DEFAULT_SECRETS_KEY_ENV_PREFIX = exports.SECRETS_KEY_BYTES = void 0;
|
|
37
|
-
exports.isSecretKeyId = isSecretKeyId;
|
|
38
|
-
exports.parseSecretKeyId = parseSecretKeyId;
|
|
39
|
-
exports.trimKeyValue = trimKeyValue;
|
|
40
|
-
exports.decodeSecretKey = decodeSecretKey;
|
|
41
|
-
exports.envKeyring = envKeyring;
|
|
42
|
-
exports.staticKeyring = staticKeyring;
|
|
43
|
-
const dntShim = __importStar(require("../../_dnt.shims.js"));
|
|
44
|
-
const encoding_js_1 = require("./encoding.js");
|
|
45
|
-
const errors_js_1 = require("./errors.js");
|
|
46
|
-
/** Every key is exactly this many random bytes. */
|
|
47
|
-
exports.SECRETS_KEY_BYTES = 32;
|
|
48
|
-
exports.DEFAULT_SECRETS_KEY_ENV_PREFIX = "LOOM_SECRETS_KEY_";
|
|
49
|
-
exports.DEFAULT_SECRETS_ACTIVE_KEY_ENV = "LOOM_SECRETS_ACTIVE_KEY";
|
|
50
|
-
const KEY_ID_PATTERN = /^[1-9][0-9]{0,8}$/;
|
|
51
|
-
const ASCII_WHITESPACE_ENDS = /^[ \t\n\v\f\r]+|[ \t\n\v\f\r]+$/g;
|
|
52
|
-
// What platforms substitute for a value they will not reveal. Matched exactly:
|
|
53
|
-
// anything else that is not a key already fails the base64 check below.
|
|
54
|
-
const REDACTION_PLACEHOLDERS = new Set([
|
|
55
|
-
"[redacted]",
|
|
56
|
-
"[sensitive]",
|
|
57
|
-
"vercel sensitive value",
|
|
58
|
-
]);
|
|
59
|
-
// Written by `loom` release tooling in place of an unreadable Secret during a
|
|
60
|
-
// local production build (see src/cli/vercelBuildEnv.ts).
|
|
61
|
-
const BUILD_PLACEHOLDER_PREFIX = "loom-build-only-";
|
|
62
|
-
/** Whether a number can be a key version: an integer from 1 to 999999999. */
|
|
63
|
-
function isSecretKeyId(id) {
|
|
64
|
-
return typeof id === "number" && Number.isInteger(id) &&
|
|
65
|
-
KEY_ID_PATTERN.test(String(id));
|
|
66
|
-
}
|
|
67
|
-
/** Parses the decimal key version used in variable names and sealed strings. */
|
|
68
|
-
function parseSecretKeyId(text) {
|
|
69
|
-
return KEY_ID_PATTERN.test(text) ? Number(text) : null;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Trims a configured key value and rejects what is certainly not a key: an
|
|
73
|
-
* empty value, or a placeholder a platform or build put in its place. Shared
|
|
74
|
-
* with the legacy reader so both name these cases the same way.
|
|
75
|
-
*/
|
|
76
|
-
function trimKeyValue(value, name) {
|
|
77
|
-
const trimmed = value.replace(ASCII_WHITESPACE_ENDS, "");
|
|
78
|
-
if (trimmed === "") {
|
|
79
|
-
throw new errors_js_1.SecretsKeyError(`${name} is empty.`);
|
|
80
|
-
}
|
|
81
|
-
const lowered = trimmed.toLowerCase();
|
|
82
|
-
if (REDACTION_PLACEHOLDERS.has(lowered)) {
|
|
83
|
-
throw new errors_js_1.SecretsKeyError(`${name} is a redaction placeholder; the real value is not available to this process.`);
|
|
84
|
-
}
|
|
85
|
-
if (lowered.startsWith(BUILD_PLACEHOLDER_PREFIX)) {
|
|
86
|
-
throw new errors_js_1.SecretsKeyError(`${name} is a build-only placeholder; secrets cannot be used during this build.`);
|
|
87
|
-
}
|
|
88
|
-
return trimmed;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Decodes one configured key, accepting standard base64 or base64url.
|
|
92
|
-
*
|
|
93
|
-
* Surrounding whitespace is trimmed: a pasted trailing newline is the common
|
|
94
|
-
* mistake, and a write-only variable cannot be inspected to find it. Errors
|
|
95
|
-
* name the variable and the problem, never the value.
|
|
96
|
-
*/
|
|
97
|
-
function decodeSecretKey(value, name) {
|
|
98
|
-
const trimmed = trimKeyValue(value, name);
|
|
99
|
-
const invalid = new errors_js_1.SecretsKeyError(`${name} must be base64 or base64url of ${exports.SECRETS_KEY_BYTES} random bytes.`);
|
|
100
|
-
const unpadded = trimmed.replace(/=+$/, "");
|
|
101
|
-
const padding = trimmed.length - unpadded.length;
|
|
102
|
-
const usesStandard = /[+/]/.test(unpadded);
|
|
103
|
-
if (usesStandard && /[-_]/.test(unpadded)) {
|
|
104
|
-
throw invalid;
|
|
105
|
-
}
|
|
106
|
-
// Padding is optional, but when present it must be the right amount.
|
|
107
|
-
if (padding !== 0 && padding !== (4 - (unpadded.length % 4)) % 4) {
|
|
108
|
-
throw invalid;
|
|
109
|
-
}
|
|
110
|
-
const bytes = (0, encoding_js_1.fromBase64Url)(unpadded.replaceAll("+", "-").replaceAll("/", "_"));
|
|
111
|
-
if (!bytes) {
|
|
112
|
-
throw invalid;
|
|
113
|
-
}
|
|
114
|
-
if (bytes.length !== exports.SECRETS_KEY_BYTES) {
|
|
115
|
-
throw new errors_js_1.SecretsKeyError(`${name} must decode to exactly ${exports.SECRETS_KEY_BYTES} bytes; received ${bytes.length}.`);
|
|
116
|
-
}
|
|
117
|
-
return bytes;
|
|
118
|
-
}
|
|
119
|
-
function processEnv() {
|
|
120
|
-
return dntShim.dntGlobalThis.process?.env ?? {};
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Reads keys from environment variables: one variable per key version
|
|
124
|
-
* (`LOOM_SECRETS_KEY_<n>`) and a required pointer
|
|
125
|
-
* (`LOOM_SECRETS_ACTIVE_KEY`) naming the version that encrypts.
|
|
126
|
-
*
|
|
127
|
-
* A version is always read by name. Nothing is enumerated and nothing is read
|
|
128
|
-
* until a key is needed, so a build that never seals or opens needs no key,
|
|
129
|
-
* and one unusable variable does not affect the others.
|
|
130
|
-
*/
|
|
131
|
-
function envKeyring(options = {}) {
|
|
132
|
-
const keyPrefix = options.keyPrefix ?? exports.DEFAULT_SECRETS_KEY_ENV_PREFIX;
|
|
133
|
-
const activeKeyName = options.activeKeyName ??
|
|
134
|
-
exports.DEFAULT_SECRETS_ACTIVE_KEY_ENV;
|
|
135
|
-
const env = () => options.env ?? processEnv();
|
|
136
|
-
// Reading the environment can itself throw, for example under Deno without
|
|
137
|
-
// permission for that variable. Either way the caller gets a rejection.
|
|
138
|
-
function read(name) {
|
|
139
|
-
try {
|
|
140
|
-
return env()[name];
|
|
141
|
-
}
|
|
142
|
-
catch {
|
|
143
|
-
throw new errors_js_1.SecretsKeyError(`${name} could not be read from the environment.`);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return {
|
|
147
|
-
activeKeyId() {
|
|
148
|
-
try {
|
|
149
|
-
const raw = read(activeKeyName);
|
|
150
|
-
const id = raw === undefined
|
|
151
|
-
? null
|
|
152
|
-
: parseSecretKeyId(raw.replace(ASCII_WHITESPACE_ENDS, ""));
|
|
153
|
-
if (id === null) {
|
|
154
|
-
throw new errors_js_1.SecretsKeyError(`${activeKeyName} must name the key version that encrypts, for example 1.`);
|
|
155
|
-
}
|
|
156
|
-
return Promise.resolve(id);
|
|
157
|
-
}
|
|
158
|
-
catch (error) {
|
|
159
|
-
return Promise.reject(error);
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
key(id) {
|
|
163
|
-
if (!isSecretKeyId(id)) {
|
|
164
|
-
return Promise.resolve(null);
|
|
165
|
-
}
|
|
166
|
-
const name = `${keyPrefix}${id}`;
|
|
167
|
-
try {
|
|
168
|
-
const raw = read(name);
|
|
169
|
-
return Promise.resolve(raw === undefined ? null : decodeSecretKey(raw, name));
|
|
170
|
-
}
|
|
171
|
-
catch (error) {
|
|
172
|
-
return Promise.reject(error);
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* A fixed set of keys, for tests and for callers that load keys themselves.
|
|
179
|
-
* `activeKeyId` may be omitted only when exactly one key is given.
|
|
180
|
-
*/
|
|
181
|
-
function staticKeyring(keys, activeKeyId) {
|
|
182
|
-
const ids = Object.keys(keys).map(Number);
|
|
183
|
-
const active = activeKeyId ?? (ids.length === 1 ? ids[0] : undefined);
|
|
184
|
-
return {
|
|
185
|
-
activeKeyId() {
|
|
186
|
-
if (active === undefined || !isSecretKeyId(active) || !keys[active]) {
|
|
187
|
-
return Promise.reject(new errors_js_1.SecretsKeyError("staticKeyring needs an active key version that is one of its keys."));
|
|
188
|
-
}
|
|
189
|
-
return Promise.resolve(active);
|
|
190
|
-
},
|
|
191
|
-
key(id) {
|
|
192
|
-
const key = isSecretKeyId(id) ? keys[id] : undefined;
|
|
193
|
-
if (!key) {
|
|
194
|
-
return Promise.resolve(null);
|
|
195
|
-
}
|
|
196
|
-
if (key.length !== exports.SECRETS_KEY_BYTES) {
|
|
197
|
-
return Promise.reject(new errors_js_1.SecretsKeyError(`Key version ${id} must be exactly ${exports.SECRETS_KEY_BYTES} bytes; received ${key.length}.`));
|
|
198
|
-
}
|
|
199
|
-
return Promise.resolve(new Uint8Array(key));
|
|
200
|
-
},
|
|
201
|
-
};
|
|
202
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import "../../_dnt.polyfills.js";
|
|
2
|
-
import { type SecretFailureReason } from "./errors.js";
|
|
3
|
-
export { type SecretFailureReason, SecretsKeyError, SecretUnreadableError, } from "./errors.js";
|
|
4
|
-
type LegacyEnv = Record<string, string | undefined>;
|
|
5
|
-
/**
|
|
6
|
-
* A value in the format porty3 wrote before Loom's sealed strings: AES-GCM
|
|
7
|
-
* ciphertext and IV as standard base64, with no associated data.
|
|
8
|
-
*/
|
|
9
|
-
export interface LegacySecretParts {
|
|
10
|
-
/** Base64 ciphertext with the 16-byte authentication tag appended. */
|
|
11
|
-
value: string;
|
|
12
|
-
/** Base64 initialisation vector. Existing rows use 16 bytes. */
|
|
13
|
-
iv: string;
|
|
14
|
-
/** Which `CRYPTO_KEY_<n>` encrypted it. Rows that predate the field are 0. */
|
|
15
|
-
keyVersion?: number;
|
|
16
|
-
}
|
|
17
|
-
/** The reasons a legacy value can fail for; it has no expiry or fingerprint. */
|
|
18
|
-
export type LegacyFailureReason = Extract<SecretFailureReason, "malformed" | "unknown-key" | "key-unavailable" | "authentication">;
|
|
19
|
-
/** Reported to `onFailure` for every legacy value that could not be opened. */
|
|
20
|
-
export interface LegacyFailureEvent {
|
|
21
|
-
/** `null` when the parts themselves were malformed. */
|
|
22
|
-
keyVersion: number | null;
|
|
23
|
-
reason: LegacyFailureReason;
|
|
24
|
-
}
|
|
25
|
-
/** Options for {@link createLegacyPartsReader}. */
|
|
26
|
-
export interface LegacyPartsReaderOptions {
|
|
27
|
-
/** Defaults to `process.env`, read when a key is first needed. */
|
|
28
|
-
env?: LegacyEnv;
|
|
29
|
-
/** Variable name prefix; the key version is appended. */
|
|
30
|
-
keyPrefix?: string;
|
|
31
|
-
/** Receives no plaintext or ciphertext. Whatever it throws is ignored. */
|
|
32
|
-
onFailure?: (event: LegacyFailureEvent) => unknown;
|
|
33
|
-
}
|
|
34
|
-
/** Read-only access to values in the legacy format. */
|
|
35
|
-
export interface LegacyPartsReader {
|
|
36
|
-
/** Throws {@link SecretUnreadableError} on any failure. */
|
|
37
|
-
open(parts: LegacySecretParts): Promise<string>;
|
|
38
|
-
/** Like `open`, but `null` when the value cannot be read. */
|
|
39
|
-
tryOpen(parts: LegacySecretParts): Promise<string | null>;
|
|
40
|
-
/**
|
|
41
|
-
* Checks that a key version is configured and usable, without opening
|
|
42
|
-
* anything. Throws {@link SecretsKeyError} naming the variable and the
|
|
43
|
-
* problem. `open` reports the same problem only as `key-unavailable`, so
|
|
44
|
-
* this is how an operator finds out why. Defaults to version 0.
|
|
45
|
-
*/
|
|
46
|
-
assertKey(keyVersion?: number): Promise<void>;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Opens values in porty3's original format, so that rows written before the
|
|
50
|
-
* move to sealed strings stay readable for as long as they exist.
|
|
51
|
-
*
|
|
52
|
-
* There is deliberately no way to write this format here. It has no key
|
|
53
|
-
* version of its own, no associated data and therefore no binding: a value
|
|
54
|
-
* opens wherever it is placed. New data belongs in a sealed string.
|
|
55
|
-
*
|
|
56
|
-
* Each key is read by name and decoded the first time it is needed, so an
|
|
57
|
-
* unusable `CRYPTO_KEY_1` does not stop version 0 from working.
|
|
58
|
-
*/
|
|
59
|
-
export declare function createLegacyPartsReader(options?: LegacyPartsReaderOptions): LegacyPartsReader;
|
|
60
|
-
//# sourceMappingURL=legacy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../../../src/src/secrets/legacy.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,KAAK,mBAAmB,EACxB,eAAe,EACf,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAarB,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,gFAAgF;AAChF,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,mBAAmB,EACnB,WAAW,GAAG,aAAa,GAAG,iBAAiB,GAAG,gBAAgB,CACnE,CAAC;AAEF,+EAA+E;AAC/E,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED,mDAAmD;AACnD,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC;CACpD;AAED,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,6DAA6D;IAC7D,OAAO,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1D;;;;;OAKG;IACH,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAsCD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,wBAA6B,GACrC,iBAAiB,CAkHnB"}
|