@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,186 +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.SecretUnreadableError = exports.SecretsKeyError = void 0;
|
|
37
|
-
exports.createLegacyPartsReader = createLegacyPartsReader;
|
|
38
|
-
require("../../_dnt.polyfills.js");
|
|
39
|
-
const dntShim = __importStar(require("../../_dnt.shims.js"));
|
|
40
|
-
const errors_js_1 = require("./errors.js");
|
|
41
|
-
const keyring_js_1 = require("./keyring.js");
|
|
42
|
-
var errors_js_2 = require("./errors.js");
|
|
43
|
-
Object.defineProperty(exports, "SecretsKeyError", { enumerable: true, get: function () { return errors_js_2.SecretsKeyError; } });
|
|
44
|
-
Object.defineProperty(exports, "SecretUnreadableError", { enumerable: true, get: function () { return errors_js_2.SecretUnreadableError; } });
|
|
45
|
-
const DEFAULT_LEGACY_KEY_ENV_PREFIX = "CRYPTO_KEY_";
|
|
46
|
-
const LEGACY_KEY_BYTES = new Set([16, 24, 32]);
|
|
47
|
-
const CANONICAL_BASE64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
48
|
-
const TAG_BYTES = 16;
|
|
49
|
-
// Decoded exactly as the code that wrote these values has always read them:
|
|
50
|
-
// a leading byte-order mark is dropped and an invalid byte becomes U+FFFD.
|
|
51
|
-
// Strictness would add nothing, because the bytes are already authenticated,
|
|
52
|
-
// and it could reject a row that reads today.
|
|
53
|
-
const decoder = new TextDecoder();
|
|
54
|
-
function fromBase64(text) {
|
|
55
|
-
if (typeof text !== "string") {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
let binary;
|
|
59
|
-
try {
|
|
60
|
-
// `atob` is as forgiving as the reader these rows were written for.
|
|
61
|
-
binary = atob(text);
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
const bytes = new Uint8Array(binary.length);
|
|
67
|
-
for (let index = 0; index < binary.length; index += 1) {
|
|
68
|
-
bytes[index] = binary.charCodeAt(index);
|
|
69
|
-
}
|
|
70
|
-
return bytes;
|
|
71
|
-
}
|
|
72
|
-
function decodeLegacyKey(value, name) {
|
|
73
|
-
const trimmed = (0, keyring_js_1.trimKeyValue)(value, name);
|
|
74
|
-
const bytes = CANONICAL_BASE64.test(trimmed) ? fromBase64(trimmed) : null;
|
|
75
|
-
if (bytes === null) {
|
|
76
|
-
throw new errors_js_1.SecretsKeyError(`${name} must be canonical base64.`);
|
|
77
|
-
}
|
|
78
|
-
if (!LEGACY_KEY_BYTES.has(bytes.length)) {
|
|
79
|
-
throw new errors_js_1.SecretsKeyError(`${name} must decode to a 16-, 24- or 32-byte AES key; received ${bytes.length} bytes.`);
|
|
80
|
-
}
|
|
81
|
-
return bytes;
|
|
82
|
-
}
|
|
83
|
-
function processEnv() {
|
|
84
|
-
return dntShim.dntGlobalThis.process?.env ?? {};
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Opens values in porty3's original format, so that rows written before the
|
|
88
|
-
* move to sealed strings stay readable for as long as they exist.
|
|
89
|
-
*
|
|
90
|
-
* There is deliberately no way to write this format here. It has no key
|
|
91
|
-
* version of its own, no associated data and therefore no binding: a value
|
|
92
|
-
* opens wherever it is placed. New data belongs in a sealed string.
|
|
93
|
-
*
|
|
94
|
-
* Each key is read by name and decoded the first time it is needed, so an
|
|
95
|
-
* unusable `CRYPTO_KEY_1` does not stop version 0 from working.
|
|
96
|
-
*/
|
|
97
|
-
function createLegacyPartsReader(options = {}) {
|
|
98
|
-
const keyPrefix = options.keyPrefix ?? DEFAULT_LEGACY_KEY_ENV_PREFIX;
|
|
99
|
-
const subtle = globalThis.crypto.subtle;
|
|
100
|
-
const keys = new Map();
|
|
101
|
-
function key(version) {
|
|
102
|
-
let pending = keys.get(version);
|
|
103
|
-
if (!pending) {
|
|
104
|
-
pending = (async () => {
|
|
105
|
-
const name = `${keyPrefix}${version}`;
|
|
106
|
-
let raw;
|
|
107
|
-
try {
|
|
108
|
-
raw = (options.env ?? processEnv())[name];
|
|
109
|
-
}
|
|
110
|
-
catch {
|
|
111
|
-
throw new errors_js_1.SecretsKeyError(`${name} could not be read from the environment.`);
|
|
112
|
-
}
|
|
113
|
-
return raw === undefined ? null : await subtle.importKey("raw", decodeLegacyKey(raw, name), "AES-GCM", false, ["decrypt"]);
|
|
114
|
-
})();
|
|
115
|
-
keys.set(version, pending);
|
|
116
|
-
pending.then((imported) => imported === null && keys.delete(version), () => keys.delete(version));
|
|
117
|
-
}
|
|
118
|
-
return pending;
|
|
119
|
-
}
|
|
120
|
-
function fail(keyVersion, reason) {
|
|
121
|
-
try {
|
|
122
|
-
Promise.resolve(options.onFailure?.({ keyVersion, reason }))
|
|
123
|
-
.catch(() => { });
|
|
124
|
-
}
|
|
125
|
-
catch {
|
|
126
|
-
// A logging hook must not change the outcome.
|
|
127
|
-
}
|
|
128
|
-
throw new errors_js_1.SecretUnreadableError(reason);
|
|
129
|
-
}
|
|
130
|
-
const reader = {
|
|
131
|
-
async open(parts) {
|
|
132
|
-
// Copied out before the first await, so the caller's object cannot
|
|
133
|
-
// change underneath the read.
|
|
134
|
-
const keyVersion = parts?.keyVersion ?? 0;
|
|
135
|
-
const ciphertext = fromBase64(parts?.value);
|
|
136
|
-
const iv = fromBase64(parts?.iv);
|
|
137
|
-
if (!Number.isSafeInteger(keyVersion) || keyVersion < 0 ||
|
|
138
|
-
ciphertext === null || ciphertext.length < TAG_BYTES ||
|
|
139
|
-
iv === null || iv.length === 0) {
|
|
140
|
-
return fail(null, "malformed");
|
|
141
|
-
}
|
|
142
|
-
let imported;
|
|
143
|
-
try {
|
|
144
|
-
imported = await key(keyVersion);
|
|
145
|
-
}
|
|
146
|
-
catch {
|
|
147
|
-
return fail(keyVersion, "key-unavailable");
|
|
148
|
-
}
|
|
149
|
-
if (imported === null) {
|
|
150
|
-
return fail(keyVersion, "unknown-key");
|
|
151
|
-
}
|
|
152
|
-
let plaintext;
|
|
153
|
-
try {
|
|
154
|
-
plaintext = await subtle.decrypt({ name: "AES-GCM", iv }, imported, ciphertext);
|
|
155
|
-
}
|
|
156
|
-
catch (error) {
|
|
157
|
-
// Web Crypto reports a failed tag as OperationError. Anything else is
|
|
158
|
-
// a parameter the runtime will not take, such as an IV length.
|
|
159
|
-
return fail(keyVersion, error?.name === "OperationError"
|
|
160
|
-
? "authentication"
|
|
161
|
-
: "malformed");
|
|
162
|
-
}
|
|
163
|
-
return decoder.decode(plaintext);
|
|
164
|
-
},
|
|
165
|
-
async tryOpen(parts) {
|
|
166
|
-
try {
|
|
167
|
-
return await reader.open(parts);
|
|
168
|
-
}
|
|
169
|
-
catch (error) {
|
|
170
|
-
if (error instanceof errors_js_1.SecretUnreadableError) {
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
throw error;
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
async assertKey(keyVersion = 0) {
|
|
177
|
-
if (!Number.isSafeInteger(keyVersion) || keyVersion < 0) {
|
|
178
|
-
throw new TypeError("A legacy key version is a non-negative integer.");
|
|
179
|
-
}
|
|
180
|
-
if (await key(keyVersion) === null) {
|
|
181
|
-
throw new errors_js_1.SecretsKeyError(`${keyPrefix}${keyVersion} is not configured.`);
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
return reader;
|
|
186
|
-
}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import "../../_dnt.polyfills.js";
|
|
2
|
-
import type { SecretFailureReason } from "./errors.js";
|
|
3
|
-
import type { SecretBinding, SecretPurpose } from "./secrets.js";
|
|
4
|
-
/** One stored sealed string, as a location reads it. */
|
|
5
|
-
export interface SecretLocationRow {
|
|
6
|
-
/** Stable row identifier. Reported on failure; never a secret. */
|
|
7
|
-
id: string;
|
|
8
|
-
sealed: string;
|
|
9
|
-
/**
|
|
10
|
-
* The binding the app's own reader would supply for this row. Build it with
|
|
11
|
-
* the same function the reader uses: a second derivation can disagree with
|
|
12
|
-
* the first, and then a clean result here says nothing about the app.
|
|
13
|
-
*/
|
|
14
|
-
binding: SecretBinding;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* A place where an app stores sealed strings. Loom cannot find ciphertext by
|
|
18
|
-
* itself, so every column that holds it is declared, and what is not declared
|
|
19
|
-
* is not reported, verified or resealed.
|
|
20
|
-
*/
|
|
21
|
-
export interface SecretLocation<Db> {
|
|
22
|
-
/** For reports, for example `temple_forums.api_key_encrypted`. */
|
|
23
|
-
name: string;
|
|
24
|
-
purpose: SecretPurpose;
|
|
25
|
-
/** What the rows hold. Defaults to `text`. */
|
|
26
|
-
kind?: "text" | "json" | "bytes" | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* The next rows after `cursor` (`null` for the first page), at most `limit`
|
|
29
|
-
* of them, in any order that is stable between calls and in which every row
|
|
30
|
-
* comes after the previous page's last row. Rows that hold no sealed string
|
|
31
|
-
* are left out. Each row needs a non-empty string `id`.
|
|
32
|
-
*/
|
|
33
|
-
read(db: Db, cursor: string | null, limit: number): Promise<SecretLocationRow[]>;
|
|
34
|
-
/**
|
|
35
|
-
* Replaces `expected` with `next` only if the row still holds `expected`,
|
|
36
|
-
* as one `UPDATE … WHERE` statement, and reports whether it did. It must
|
|
37
|
-
* never insert: a row deleted in the meantime stays deleted.
|
|
38
|
-
*/
|
|
39
|
-
write(db: Db, id: string, expected: string, next: string): Promise<boolean>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Why a row was not handled. `invalid-binding` means the location produced a
|
|
43
|
-
* binding that is not an object of strings, usually from a nullable column.
|
|
44
|
-
*/
|
|
45
|
-
export type SecretRowFailureReason = SecretFailureReason | "invalid-binding";
|
|
46
|
-
/** A row that could not be handled, identified without revealing anything. */
|
|
47
|
-
export interface SecretLocationFailure {
|
|
48
|
-
id: string;
|
|
49
|
-
reason: SecretRowFailureReason;
|
|
50
|
-
}
|
|
51
|
-
/** How far an operation got in one location. */
|
|
52
|
-
export interface SecretLocationProgress {
|
|
53
|
-
name: string;
|
|
54
|
-
/** Rows looked at in this run. */
|
|
55
|
-
rows: number;
|
|
56
|
-
/** Whether the location was read to its end. */
|
|
57
|
-
done: boolean;
|
|
58
|
-
/** Where to continue when not `done`. */
|
|
59
|
-
cursor: string | null;
|
|
60
|
-
}
|
|
61
|
-
/** Options shared by the maintenance operations. */
|
|
62
|
-
export interface SecretMaintenanceOptions {
|
|
63
|
-
/** Rows read per page. Defaults to 100. */
|
|
64
|
-
batchSize?: number | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Stop after this many rows per location, for runtimes with a time limit.
|
|
67
|
-
* Pass the results back as `previous` to continue.
|
|
68
|
-
*/
|
|
69
|
-
maxRows?: number | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* Results of an earlier, unfinished run of the same operation. Locations
|
|
72
|
-
* that were `done` are skipped; the others continue from their cursor.
|
|
73
|
-
*/
|
|
74
|
-
previous?: readonly SecretLocationProgress[] | undefined;
|
|
75
|
-
/** Failures listed per location; the count is always complete. Default 1000. */
|
|
76
|
-
maxFailures?: number | undefined;
|
|
77
|
-
}
|
|
78
|
-
interface FailureList {
|
|
79
|
-
/** The first `maxFailures` rows that failed. */
|
|
80
|
-
failures: SecretLocationFailure[];
|
|
81
|
-
/** How many rows failed, including any not listed. */
|
|
82
|
-
failureCount: number;
|
|
83
|
-
}
|
|
84
|
-
/** Counts per key version for one location. Nothing is decrypted. */
|
|
85
|
-
export interface SecretLocationReport extends SecretLocationProgress, FailureList {
|
|
86
|
-
/** Rows per key version, keyed by the version number. */
|
|
87
|
-
byKeyId: Record<string, number>;
|
|
88
|
-
}
|
|
89
|
-
/** Outcome of opening every row of one location. */
|
|
90
|
-
export interface SecretLocationVerification extends SecretLocationProgress, FailureList {
|
|
91
|
-
opened: number;
|
|
92
|
-
}
|
|
93
|
-
/** Outcome of resealing one location. */
|
|
94
|
-
export interface SecretLocationReseal extends SecretLocationProgress, FailureList {
|
|
95
|
-
/** Whether this was a rehearsal that wrote nothing. */
|
|
96
|
-
dryRun: boolean;
|
|
97
|
-
/** Already under the active key. These rows are not opened. */
|
|
98
|
-
current: number;
|
|
99
|
-
/** Moved to the active key, or would be in a dry run. */
|
|
100
|
-
resealed: number;
|
|
101
|
-
/**
|
|
102
|
-
* Changed or deleted by someone else between the read and the write, and
|
|
103
|
-
* left alone. They are still under their old key unless that write moved
|
|
104
|
-
* them: run again.
|
|
105
|
-
*/
|
|
106
|
-
changed: number;
|
|
107
|
-
/** The first `maxFailures` of those rows. */
|
|
108
|
-
changedIds: string[];
|
|
109
|
-
}
|
|
110
|
-
/** Options for {@link resealSecretLocations}. */
|
|
111
|
-
export interface ResealSecretLocationsOptions extends SecretMaintenanceOptions {
|
|
112
|
-
/** Defaults to `true`: nothing is written unless this is `false`. */
|
|
113
|
-
dryRun?: boolean | undefined;
|
|
114
|
-
/**
|
|
115
|
-
* Write even though no expected-key list was applied, so nothing shows that
|
|
116
|
-
* the active key is the one the operator saved. For development databases.
|
|
117
|
-
*/
|
|
118
|
-
allowUnverifiedKeys?: boolean | undefined;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* A maintenance run stopped on something other than an unreadable row, such
|
|
122
|
-
* as a lost database connection. Rows already handled stay handled; running
|
|
123
|
-
* again is safe. The original error is `cause`.
|
|
124
|
-
*/
|
|
125
|
-
export declare class SecretMaintenanceError extends Error {
|
|
126
|
-
/** The location being processed. */
|
|
127
|
-
readonly location: string;
|
|
128
|
-
/** The row being processed, when one was. */
|
|
129
|
-
readonly rowId: string | null;
|
|
130
|
-
/** Results for the locations finished before this one. */
|
|
131
|
-
readonly results: readonly SecretLocationProgress[];
|
|
132
|
-
constructor(location: string, rowId: string | null, results: readonly SecretLocationProgress[], cause: unknown);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Declares an app's secret locations, rejecting duplicate names so that a
|
|
136
|
-
* report line or a saved cursor always means one place.
|
|
137
|
-
*/
|
|
138
|
-
export declare function defineSecretLocations<Db>(locations: readonly SecretLocation<Db>[]): readonly SecretLocation<Db>[];
|
|
139
|
-
/**
|
|
140
|
-
* Counts rows per key version by parsing each string. It decrypts nothing, so
|
|
141
|
-
* it needs no key and can run anywhere the database can be read. A clean
|
|
142
|
-
* report says where rows stand, not that they open: use
|
|
143
|
-
* {@link verifySecretLocations} for that.
|
|
144
|
-
*/
|
|
145
|
-
export declare function reportSecretLocations<Db>(db: Db, locations: readonly SecretLocation<Db>[], options?: SecretMaintenanceOptions): Promise<SecretLocationReport[]>;
|
|
146
|
-
/**
|
|
147
|
-
* Opens every declared row with no fallback of any kind, and reports each row
|
|
148
|
-
* that does not open by id and reason. Run it inside the deployed app: that is
|
|
149
|
-
* the only place the keys exist. It never outputs a value.
|
|
150
|
-
*
|
|
151
|
-
* A value whose lifetime has passed is reported as `expired` on every run. It
|
|
152
|
-
* can never be resealed, so the app must delete such rows before the key they
|
|
153
|
-
* are under can be retired.
|
|
154
|
-
*/
|
|
155
|
-
export declare function verifySecretLocations<Db>(db: Db, locations: readonly SecretLocation<Db>[], options?: SecretMaintenanceOptions): Promise<SecretLocationVerification[]>;
|
|
156
|
-
/**
|
|
157
|
-
* Moves rows that are under an older key to the active key.
|
|
158
|
-
*
|
|
159
|
-
* Before anything else it runs `assertReady()` for the keys each location's
|
|
160
|
-
* purpose will actually use. A real run also requires that an expected-key
|
|
161
|
-
* list was applied, so rows are never moved onto a key that has not been shown
|
|
162
|
-
* to match its recorded fingerprint: moving every row onto a mistyped
|
|
163
|
-
* write-only key, and later retiring the old one, would lose them all.
|
|
164
|
-
*
|
|
165
|
-
* For each row it reseals, opens the new string and compares it with the old
|
|
166
|
-
* plaintext, and only then swaps it in with the location's compare-and-swap. A
|
|
167
|
-
* row someone else changed in the meantime is counted and left alone. It is
|
|
168
|
-
* safe to run again, and to stop and continue by passing the results back as
|
|
169
|
-
* `previous`.
|
|
170
|
-
*/
|
|
171
|
-
export declare function resealSecretLocations<Db>(db: Db, locations: readonly SecretLocation<Db>[], options?: ResealSecretLocationsOptions): Promise<SecretLocationReseal[]>;
|
|
172
|
-
export {};
|
|
173
|
-
//# sourceMappingURL=maintenance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"maintenance.d.ts","sourceRoot":"","sources":["../../../src/src/secrets/maintenance.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SecretMaintenanceError = void 0;
|
|
4
|
-
exports.defineSecretLocations = defineSecretLocations;
|
|
5
|
-
exports.reportSecretLocations = reportSecretLocations;
|
|
6
|
-
exports.verifySecretLocations = verifySecretLocations;
|
|
7
|
-
exports.resealSecretLocations = resealSecretLocations;
|
|
8
|
-
require("../../_dnt.polyfills.js");
|
|
9
|
-
/**
|
|
10
|
-
* A maintenance run stopped on something other than an unreadable row, such
|
|
11
|
-
* as a lost database connection. Rows already handled stay handled; running
|
|
12
|
-
* again is safe. The original error is `cause`.
|
|
13
|
-
*/
|
|
14
|
-
class SecretMaintenanceError extends Error {
|
|
15
|
-
constructor(location, rowId, results, cause) {
|
|
16
|
-
// The cause's own message is left out: a driver may quote parameters.
|
|
17
|
-
super(`Secret maintenance stopped in "${location}"${rowId === null ? "" : ` at row ${rowId}`}.`, { cause });
|
|
18
|
-
/** The location being processed. */
|
|
19
|
-
Object.defineProperty(this, "location", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
configurable: true,
|
|
22
|
-
writable: true,
|
|
23
|
-
value: void 0
|
|
24
|
-
});
|
|
25
|
-
/** The row being processed, when one was. */
|
|
26
|
-
Object.defineProperty(this, "rowId", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
configurable: true,
|
|
29
|
-
writable: true,
|
|
30
|
-
value: void 0
|
|
31
|
-
});
|
|
32
|
-
/** Results for the locations finished before this one. */
|
|
33
|
-
Object.defineProperty(this, "results", {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
configurable: true,
|
|
36
|
-
writable: true,
|
|
37
|
-
value: void 0
|
|
38
|
-
});
|
|
39
|
-
this.name = "SecretMaintenanceError";
|
|
40
|
-
this.location = location;
|
|
41
|
-
this.rowId = rowId;
|
|
42
|
-
this.results = results;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.SecretMaintenanceError = SecretMaintenanceError;
|
|
46
|
-
const DEFAULT_BATCH_SIZE = 100;
|
|
47
|
-
const DEFAULT_MAX_FAILURES = 1000;
|
|
48
|
-
const KINDS = ["text", "json", "bytes"];
|
|
49
|
-
/**
|
|
50
|
-
* Declares an app's secret locations, rejecting duplicate names so that a
|
|
51
|
-
* report line or a saved cursor always means one place.
|
|
52
|
-
*/
|
|
53
|
-
function defineSecretLocations(locations) {
|
|
54
|
-
const names = new Set();
|
|
55
|
-
for (const location of locations) {
|
|
56
|
-
if (typeof location.name !== "string" || location.name === "") {
|
|
57
|
-
throw new TypeError("A secret location needs a name.");
|
|
58
|
-
}
|
|
59
|
-
if (names.has(location.name)) {
|
|
60
|
-
throw new TypeError(`Secret location "${location.name}" is declared twice.`);
|
|
61
|
-
}
|
|
62
|
-
if (location.kind !== undefined && !KINDS.includes(location.kind)) {
|
|
63
|
-
throw new TypeError(`Secret location "${location.name}" has an unknown kind.`);
|
|
64
|
-
}
|
|
65
|
-
names.add(location.name);
|
|
66
|
-
}
|
|
67
|
-
return [...locations];
|
|
68
|
-
}
|
|
69
|
-
function positiveInteger(value, fallback, what) {
|
|
70
|
-
const resolved = value ?? fallback;
|
|
71
|
-
if (!Number.isSafeInteger(resolved) || resolved <= 0) {
|
|
72
|
-
throw new RangeError(`${what} must be a positive integer.`);
|
|
73
|
-
}
|
|
74
|
-
return resolved;
|
|
75
|
-
}
|
|
76
|
-
/** Collects failures up to a limit while counting all of them. */
|
|
77
|
-
function failureList(max) {
|
|
78
|
-
const list = [];
|
|
79
|
-
return {
|
|
80
|
-
failures: list,
|
|
81
|
-
failureCount: 0,
|
|
82
|
-
add(id, reason) {
|
|
83
|
-
this.failureCount += 1;
|
|
84
|
-
if (list.length < max) {
|
|
85
|
-
list.push({ id, reason });
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Turns an error from sealing or opening one row into a row failure. Anything
|
|
92
|
-
* else is not about that row's secret and is rethrown to stop the run.
|
|
93
|
-
*/
|
|
94
|
-
function rowFailureReason(error) {
|
|
95
|
-
const candidate = error;
|
|
96
|
-
// Matched by shape, not `instanceof`: the app and this module may have
|
|
97
|
-
// loaded different copies of the error class (ESM and CommonJS builds).
|
|
98
|
-
if (candidate?.name === "SecretUnreadableError" &&
|
|
99
|
-
typeof candidate.reason === "string") {
|
|
100
|
-
return candidate.reason;
|
|
101
|
-
}
|
|
102
|
-
if (error instanceof TypeError) {
|
|
103
|
-
return "invalid-binding";
|
|
104
|
-
}
|
|
105
|
-
throw error;
|
|
106
|
-
}
|
|
107
|
-
/** Runs one operation over every location, with paging and error context. */
|
|
108
|
-
async function eachLocation(db, declared, options, start) {
|
|
109
|
-
const locations = defineSecretLocations(declared);
|
|
110
|
-
const batchSize = positiveInteger(options.batchSize, DEFAULT_BATCH_SIZE, "batchSize");
|
|
111
|
-
const maxRows = options.maxRows === undefined
|
|
112
|
-
? Infinity
|
|
113
|
-
: positiveInteger(options.maxRows, 1, "maxRows");
|
|
114
|
-
const maxFailures = positiveInteger(options.maxFailures, DEFAULT_MAX_FAILURES, "maxFailures");
|
|
115
|
-
const results = [];
|
|
116
|
-
for (const location of locations) {
|
|
117
|
-
const operation = start(location, maxFailures);
|
|
118
|
-
const earlier = options.previous?.find((progress) => progress.name === location.name);
|
|
119
|
-
if (earlier?.done) {
|
|
120
|
-
results.push(operation.finish({
|
|
121
|
-
name: location.name,
|
|
122
|
-
rows: 0,
|
|
123
|
-
done: true,
|
|
124
|
-
cursor: null,
|
|
125
|
-
}));
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
let cursor = earlier?.cursor ?? null;
|
|
129
|
-
let rows = 0;
|
|
130
|
-
let done = false;
|
|
131
|
-
let rowId = null;
|
|
132
|
-
let previousPage = new Set();
|
|
133
|
-
try {
|
|
134
|
-
while (rows < maxRows) {
|
|
135
|
-
rowId = null;
|
|
136
|
-
const page = await location.read(db, cursor, Math.min(batchSize, maxRows - rows));
|
|
137
|
-
if (page.length === 0) {
|
|
138
|
-
done = true;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
const thisPage = new Set();
|
|
142
|
-
for (const row of page) {
|
|
143
|
-
if (typeof row?.id !== "string" || row.id === "") {
|
|
144
|
-
throw new TypeError("A row was returned without a string id.");
|
|
145
|
-
}
|
|
146
|
-
// A read that ignores its cursor would otherwise never finish. No
|
|
147
|
-
// order is imposed on ids: a database may sort them differently
|
|
148
|
-
// from JavaScript, and only lack of progress is an error.
|
|
149
|
-
if (previousPage.has(row.id) || thisPage.has(row.id)) {
|
|
150
|
-
throw new Error("The same row was returned twice.");
|
|
151
|
-
}
|
|
152
|
-
thisPage.add(row.id);
|
|
153
|
-
rowId = row.id;
|
|
154
|
-
await operation.visit(row);
|
|
155
|
-
cursor = row.id;
|
|
156
|
-
rows += 1;
|
|
157
|
-
}
|
|
158
|
-
previousPage = thisPage;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
catch (error) {
|
|
162
|
-
throw new SecretMaintenanceError(location.name, rowId, results, error);
|
|
163
|
-
}
|
|
164
|
-
results.push(operation.finish({
|
|
165
|
-
name: location.name,
|
|
166
|
-
rows,
|
|
167
|
-
done,
|
|
168
|
-
cursor: done ? null : cursor,
|
|
169
|
-
}));
|
|
170
|
-
}
|
|
171
|
-
return results;
|
|
172
|
-
}
|
|
173
|
-
/** Opens a row strictly and returns a comparable form of its plaintext. */
|
|
174
|
-
async function openComparable(location, sealed, binding) {
|
|
175
|
-
const { purpose } = location;
|
|
176
|
-
switch (location.kind ?? "text") {
|
|
177
|
-
case "json":
|
|
178
|
-
return JSON.stringify(await purpose.openJson(sealed, binding));
|
|
179
|
-
case "bytes":
|
|
180
|
-
return (await purpose.openBytes(sealed, binding)).join(",");
|
|
181
|
-
default:
|
|
182
|
-
return await purpose.open(sealed, binding);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Counts rows per key version by parsing each string. It decrypts nothing, so
|
|
187
|
-
* it needs no key and can run anywhere the database can be read. A clean
|
|
188
|
-
* report says where rows stand, not that they open: use
|
|
189
|
-
* {@link verifySecretLocations} for that.
|
|
190
|
-
*/
|
|
191
|
-
function reportSecretLocations(db, locations, options = {}) {
|
|
192
|
-
return eachLocation(db, locations, options, (location, maxFailures) => {
|
|
193
|
-
const byKeyId = {};
|
|
194
|
-
const malformed = failureList(maxFailures);
|
|
195
|
-
return {
|
|
196
|
-
visit(row) {
|
|
197
|
-
const keyId = location.purpose.keyId(row.sealed);
|
|
198
|
-
if (keyId === null) {
|
|
199
|
-
malformed.add(row.id, "malformed");
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
byKeyId[keyId] = (byKeyId[keyId] ?? 0) + 1;
|
|
203
|
-
}
|
|
204
|
-
return Promise.resolve();
|
|
205
|
-
},
|
|
206
|
-
finish: (progress) => ({
|
|
207
|
-
...progress,
|
|
208
|
-
byKeyId,
|
|
209
|
-
failures: malformed.failures,
|
|
210
|
-
failureCount: malformed.failureCount,
|
|
211
|
-
}),
|
|
212
|
-
};
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Opens every declared row with no fallback of any kind, and reports each row
|
|
217
|
-
* that does not open by id and reason. Run it inside the deployed app: that is
|
|
218
|
-
* the only place the keys exist. It never outputs a value.
|
|
219
|
-
*
|
|
220
|
-
* A value whose lifetime has passed is reported as `expired` on every run. It
|
|
221
|
-
* can never be resealed, so the app must delete such rows before the key they
|
|
222
|
-
* are under can be retired.
|
|
223
|
-
*/
|
|
224
|
-
function verifySecretLocations(db, locations, options = {}) {
|
|
225
|
-
return eachLocation(db, locations, options, (location, maxFailures) => {
|
|
226
|
-
let opened = 0;
|
|
227
|
-
const failed = failureList(maxFailures);
|
|
228
|
-
return {
|
|
229
|
-
async visit(row) {
|
|
230
|
-
try {
|
|
231
|
-
await openComparable(location, row.sealed, row.binding);
|
|
232
|
-
opened += 1;
|
|
233
|
-
}
|
|
234
|
-
catch (error) {
|
|
235
|
-
failed.add(row.id, rowFailureReason(error));
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
finish: (progress) => ({
|
|
239
|
-
...progress,
|
|
240
|
-
opened,
|
|
241
|
-
failures: failed.failures,
|
|
242
|
-
failureCount: failed.failureCount,
|
|
243
|
-
}),
|
|
244
|
-
};
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Moves rows that are under an older key to the active key.
|
|
249
|
-
*
|
|
250
|
-
* Before anything else it runs `assertReady()` for the keys each location's
|
|
251
|
-
* purpose will actually use. A real run also requires that an expected-key
|
|
252
|
-
* list was applied, so rows are never moved onto a key that has not been shown
|
|
253
|
-
* to match its recorded fingerprint: moving every row onto a mistyped
|
|
254
|
-
* write-only key, and later retiring the old one, would lose them all.
|
|
255
|
-
*
|
|
256
|
-
* For each row it reseals, opens the new string and compares it with the old
|
|
257
|
-
* plaintext, and only then swaps it in with the location's compare-and-swap. A
|
|
258
|
-
* row someone else changed in the meantime is counted and left alone. It is
|
|
259
|
-
* safe to run again, and to stop and continue by passing the results back as
|
|
260
|
-
* `previous`.
|
|
261
|
-
*/
|
|
262
|
-
async function resealSecretLocations(db, locations, options = {}) {
|
|
263
|
-
const dryRun = options.dryRun !== false;
|
|
264
|
-
for (const location of defineSecretLocations(locations)) {
|
|
265
|
-
const readiness = await location.purpose.assertReady();
|
|
266
|
-
if (!dryRun && !readiness.verified && !options.allowUnverifiedKeys) {
|
|
267
|
-
throw new Error(`Secret location "${location.name}" has no expected-key list, so its active key is unverified. Refusing to reseal.`);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return eachLocation(db, locations, options, (location, maxFailures) => {
|
|
271
|
-
const counts = { current: 0, resealed: 0, changed: 0 };
|
|
272
|
-
const changedIds = [];
|
|
273
|
-
const failed = failureList(maxFailures);
|
|
274
|
-
return {
|
|
275
|
-
async visit(row) {
|
|
276
|
-
let next;
|
|
277
|
-
try {
|
|
278
|
-
if (location.purpose.keyId(row.sealed) === null) {
|
|
279
|
-
failed.add(row.id, "malformed");
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
if (!await location.purpose.needsReseal(row.sealed)) {
|
|
283
|
-
counts.current += 1;
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
next = await location.purpose.reseal(row.sealed, row.binding);
|
|
287
|
-
const [before, after] = await Promise.all([
|
|
288
|
-
openComparable(location, row.sealed, row.binding),
|
|
289
|
-
openComparable(location, next, row.binding),
|
|
290
|
-
]);
|
|
291
|
-
if (before !== after) {
|
|
292
|
-
// Unreachable unless the purpose or the runtime is broken; a row
|
|
293
|
-
// must never be replaced by something that reads differently.
|
|
294
|
-
failed.add(row.id, "malformed");
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
catch (error) {
|
|
299
|
-
failed.add(row.id, rowFailureReason(error));
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
// Outside the try: a failed write is not an unreadable row.
|
|
303
|
-
if (dryRun || await location.write(db, row.id, row.sealed, next)) {
|
|
304
|
-
counts.resealed += 1;
|
|
305
|
-
}
|
|
306
|
-
else {
|
|
307
|
-
counts.changed += 1;
|
|
308
|
-
if (changedIds.length < maxFailures) {
|
|
309
|
-
changedIds.push(row.id);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
finish: (progress) => ({
|
|
314
|
-
...progress,
|
|
315
|
-
dryRun,
|
|
316
|
-
...counts,
|
|
317
|
-
changedIds,
|
|
318
|
-
failures: failed.failures,
|
|
319
|
-
failureCount: failed.failureCount,
|
|
320
|
-
}),
|
|
321
|
-
};
|
|
322
|
-
});
|
|
323
|
-
}
|