Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
unused folder remove
Maidul Islam6ca7a990f3d6
diff --git a/migration/.eslintrc.js b/migration/.eslintrc.jsdeleted file mode 100644index cfc6baf3ac..0000000000--- a/migration/.eslintrc.js+++ /dev/null@@ -1,8 +0,0 @@-module.exports = {- "parserOptions": {- "ecmaVersion": 2017- },- "env": {- "es6": true- }- }\ No newline at end of filediff --git a/migration/README.md b/migration/README.mddeleted file mode 100644index 5d3984b23b..0000000000--- a/migration/README.md+++ /dev/null@@ -1,3 +0,0 @@-As Infisical's codebase matures, there are structural things that we need to change.--This folder houses various migration scripts that can be used to upgrade self-hosted installations of Infisical to be compatible with newer versions.\ No newline at end of filediff --git a/migration/models/bot.js b/migration/models/bot.jsdeleted file mode 100644index 85c93014c4..0000000000--- a/migration/models/bot.js+++ /dev/null@@ -1,61 +0,0 @@-var mongoose = require('mongoose');--var botSchema = new mongoose.Schema(- {- name: {- type: String,- required: true- },- workspace: {- type: mongoose.Schema.Types.ObjectId,- ref: 'Workspace',- required: true- },- isActive: {- type: Boolean,- required: true,- default: false- },- publicKey: {- type: String,- required: true- },- encryptedPrivateKey: {- type: String,- required: true,- select: false- },- iv: {- type: String,- required: true,- select: false- },- tag: {- type: String,- required: true,- select: false- },- algorithm: { // the encryption algorithm used- type: String,- enum: ['aes-256-gcm'],- required: true,- select: false- },- keyEncoding: {- type: String,- enum: [- 'utf8',- 'base64'- ],- required: true,- select: false- }- },- {- timestamps: true- }-);--var Bot = mongoose.model('Bot', botSchema);--module.exports = Bot;diff --git a/migration/models/secretBlindIndexData.js b/migration/models/secretBlindIndexData.jsdeleted file mode 100644index bcfa923949..0000000000--- a/migration/models/secretBlindIndexData.js+++ /dev/null@@ -1,43 +0,0 @@-var mongoose = require('mongoose');--var secretBlindIndexDataSchema = new mongoose.Schema(- {- workspace: {- type: mongoose.Schema.Types.ObjectId,- ref: 'Workspace',- required: true- },- encryptedSaltCiphertext:{- type: String,- required: true- },- saltIV: {- type: String,- required: true- },- saltTag: {- type: String,- required: true- },- algorithm: {- type: String,- enum: ['aes-256-gcm'],- required: true,- select: false- },- keyEncoding: {- type: String,- enum: [- 'utf8',- 'base64'- ],- required: true,- select: false- }-- }-);--var SecretBlindIndexData = mongoose.model('SecretBlindIndexData', secretBlindIndexDataSchema);--module.exports = SecretBlindIndexData;\ No newline at end of filediff --git a/migration/models/user.js b/migration/models/user.jsdeleted file mode 100644index 24e2c6554d..0000000000--- a/migration/models/user.js+++ /dev/null@@ -1,83 +0,0 @@-var mongoose = require('mongoose');--var userSchema = new mongoose.Schema(- {- email: {- type: String,- required: true- },- firstName: {- type: String- },- lastName: {- type: String- },- encryptionVersion: {- type: Number,- select: false,- default: 1 // to resolve backward-compatibility issues- },- protectedKey: { // introduced as part of encryption version 2- type: String,- select: false- },- protectedKeyIV: { // introduced as part of encryption version 2- type: String,- select: false- },- protectedKeyTag: { // introduced as part of encryption version 2- type: String,- select: false- },- publicKey: {- type: String,- select: false- },- encryptedPrivateKey: {- type: String,- select: false- },- iv: { // iv of [encryptedPrivateKey]- type: String,- select: false- },- tag: { // tag of [encryptedPrivateKey]- type: String,- select: false- },- salt: {- type: String,- select: false- },- verifier: {- type: String,- select: false- },- refreshVersion: {- type: Number,- default: 0,- select: false- },- isMfaEnabled: {- type: Boolean,- default: false- },- mfaMethods: [{- type: String- }],- devices: {- type: [{- ip: String,- userAgent: String- }],- default: []- }- },- {- timestamps: true- }-);--var User = mongoose.model('User', userSchema);--module.exports = User;diff --git a/migration/package-lock.json b/migration/package-lock.jsondeleted file mode 100644index cf1084060e..0000000000--- a/migration/package-lock.json+++ /dev/null@@ -1,444 +0,0 @@-{- "name": "migration",- "version": "1.0.0",- "lockfileVersion": 2,- "requires": true,- "packages": {- "": {- "name": "migration",- "version": "1.0.0",- "license": "ISC",- "dependencies": {- "dotenv": "^16.0.3",- "ip": "^2.0.1",- "mongoose": "^7.2.1"- }- },- "node_modules/@types/node": {- "version": "20.2.5",- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz",- "integrity": "sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ=="- },- "node_modules/@types/webidl-conversions": {- "version": "7.0.0",- "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz",- "integrity": "sha512-xTE1E+YF4aWPJJeUzaZI5DRntlkY3+BCVJi0axFptnjGmAoWxkyREIh/XMrfxVLejwQxMCfDXdICo0VLxThrog=="- },- "node_modules/@types/whatwg-url": {- "version": "8.2.2",- "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz",- "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==",- "dependencies": {- "@types/node": "*",- "@types/webidl-conversions": "*"- }- },- "node_modules/bson": {- "version": "5.3.0",- "resolved": "https://registry.npmjs.org/bson/-/bson-5.3.0.tgz",- "integrity": "sha512-ukmCZMneMlaC5ebPHXIkP8YJzNl5DC41N5MAIvKDqLggdao342t4McltoJBQfQya/nHBWAcSsYRqlXPoQkTJag==",- "engines": {- "node": ">=14.20.1"- }- },- "node_modules/debug": {- "version": "4.3.4",- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",- "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",- "dependencies": {- "ms": "2.1.2"- },- "engines": {- "node": ">=6.0"- },- "peerDependenciesMeta": {- "supports-color": {- "optional": true- }- }- },- "node_modules/debug/node_modules/ms": {- "version": "2.1.2",- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="- },- "node_modules/dotenv": {- "version": "16.0.3",- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",- "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",- "engines": {- "node": ">=12"- }- },- "node_modules/ip": {- "version": "2.0.1",- "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz",- "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ=="- },- "node_modules/kareem": {- "version": "2.5.1",- "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz",- "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==",- "engines": {- "node": ">=12.0.0"- }- },- "node_modules/memory-pager": {- "version": "1.5.0",- "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",- "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",- "optional": true- },- "node_modules/mongodb": {- "version": "5.5.0",- "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.5.0.tgz",- "integrity": "sha512-XgrkUgAAdfnZKQfk5AsYL8j7O99WHd4YXPxYxnh8dZxD+ekYWFRA3JktUsBnfg+455Smf75/+asoU/YLwNGoQQ==",- "dependencies": {- "bson": "^5.3.0",- "mongodb-connection-string-url": "^2.6.0",- "socks": "^2.7.1"- },- "engines": {- "node": ">=14.20.1"- },- "optionalDependencies": {- "saslprep": "^1.0.3"- },- "peerDependencies": {- "@aws-sdk/credential-providers": "^3.201.0",- "mongodb-client-encryption": ">=2.3.0 <3",- "snappy": "^7.2.2"- },- "peerDependenciesMeta": {- "@aws-sdk/credential-providers": {- "optional": true- },- "mongodb-client-encryption": {- "optional": true- },- "snappy": {- "optional": true- }- }- },- "node_modules/mongodb-connection-string-url": {- "version": "2.6.0",- "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz",- "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==",- "dependencies": {- "@types/whatwg-url": "^8.2.1",- "whatwg-url": "^11.0.0"- }- },- "node_modules/mongoose": {- "version": "7.2.1",- "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-7.2.1.tgz",- "integrity": "sha512-c2OOl+ch9NlmPeJw7UjSb2jHNjoOw1XXHyzwygIf4z1GmaBx1OYb8OYqHkYPivvEmfY/vUWZFCgePsDqZgFn2w==",- "dependencies": {- "bson": "^5.3.0",- "kareem": "2.5.1",- "mongodb": "5.5.0",- "mpath": "0.9.0",- "mquery": "5.0.0",- "ms": "2.1.3",- "sift": "16.0.1"- },- "engines": {- "node": ">=14.20.1"- },- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/mongoose"- }- },- "node_modules/mpath": {- "version": "0.9.0",- "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz",- "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==",- "engines": {- "node": ">=4.0.0"- }- },- "node_modules/mquery": {- "version": "5.0.0",- "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz",- "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==",- "dependencies": {- "debug": "4.x"- },- "engines": {- "node": ">=14.0.0"- }- },- "node_modules/ms": {- "version": "2.1.3",- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="- },- "node_modules/punycode": {- "version": "2.3.0",- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",- "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",- "engines": {- "node": ">=6"- }- },- "node_modules/saslprep": {- "version": "1.0.3",- "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz",- "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==",- "optional": true,- "dependencies": {- "sparse-bitfield": "^3.0.3"- },- "engines": {- "node": ">=6"- }- },- "node_modules/sift": {- "version": "16.0.1",- "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz",- "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ=="- },- "node_modules/smart-buffer": {- "version": "4.2.0",- "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",- "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",- "engines": {- "node": ">= 6.0.0",- "npm": ">= 3.0.0"- }- },- "node_modules/socks": {- "version": "2.7.1",- "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz",- "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==",- "dependencies": {- "ip": "^2.0.0",- "smart-buffer": "^4.2.0"- },- "engines": {- "node": ">= 10.13.0",- "npm": ">= 3.0.0"- }- },- "node_modules/sparse-bitfield": {- "version": "3.0.3",- "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",- "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==",- "optional": true,- "dependencies": {- "memory-pager": "^1.0.2"- }- },- "node_modules/tr46": {- "version": "3.0.0",- "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz",- "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==",- "dependencies": {- "punycode": "^2.1.1"- },- "engines": {- "node": ">=12"- }- },- "node_modules/webidl-conversions": {- "version": "7.0.0",- "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",- "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",- "engines": {- "node": ">=12"- }- },- "node_modules/whatwg-url": {- "version": "11.0.0",- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz",- "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==",- "dependencies": {- "tr46": "^3.0.0",- "webidl-conversions": "^7.0.0"- },- "engines": {- "node": ">=12"- }- }- },- "dependencies": {- "@types/node": {- "version": "20.2.5",- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz",- "integrity": "sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ=="- },- "@types/webidl-conversions": {- "version": "7.0.0",- "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz",- "integrity": "sha512-xTE1E+YF4aWPJJeUzaZI5DRntlkY3+BCVJi0axFptnjGmAoWxkyREIh/XMrfxVLejwQxMCfDXdICo0VLxThrog=="- },- "@types/whatwg-url": {- "version": "8.2.2",- "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz",- "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==",- "requires": {- "@types/node": "*",- "@types/webidl-conversions": "*"- }- },- "bson": {- "version": "5.3.0",- "resolved": "https://registry.npmjs.org/bson/-/bson-5.3.0.tgz",- "integrity": "sha512-ukmCZMneMlaC5ebPHXIkP8YJzNl5DC41N5MAIvKDqLggdao342t4McltoJBQfQya/nHBWAcSsYRqlXPoQkTJag=="- },- "debug": {- "version": "4.3.4",- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",- "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",- "requires": {- "ms": "2.1.2"- },- "dependencies": {- "ms": {- "version": "2.1.2",- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="- }- }- },- "dotenv": {- "version": "16.0.3",- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",- "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="- },- "ip": {- "version": "2.0.1",- "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz",- "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ=="- },- "kareem": {- "version": "2.5.1",- "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz",- "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA=="- },- "memory-pager": {- "version": "1.5.0",- "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",- "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",- "optional": true- },- "mongodb": {- "version": "5.5.0",- "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.5.0.tgz",- "integrity": "sha512-XgrkUgAAdfnZKQfk5AsYL8j7O99WHd4YXPxYxnh8dZxD+ekYWFRA3JktUsBnfg+455Smf75/+asoU/YLwNGoQQ==",- "requires": {- "bson": "^5.3.0",- "mongodb-connection-string-url": "^2.6.0",- "saslprep": "^1.0.3",- "socks": "^2.7.1"- }- },- "mongodb-connection-string-url": {- "version": "2.6.0",- "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz",- "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==",- "requires": {- "@types/whatwg-url": "^8.2.1",- "whatwg-url": "^11.0.0"- }- },- "mongoose": {- "version": "7.2.1",- "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-7.2.1.tgz",- "integrity": "sha512-c2OOl+ch9NlmPeJw7UjSb2jHNjoOw1XXHyzwygIf4z1GmaBx1OYb8OYqHkYPivvEmfY/vUWZFCgePsDqZgFn2w==",- "requires": {- "bson": "^5.3.0",- "kareem": "2.5.1",- "mongodb": "5.5.0",- "mpath": "0.9.0",- "mquery": "5.0.0",- "ms": "2.1.3",- "sift": "16.0.1"- }- },- "mpath": {- "version": "0.9.0",- "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz",- "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew=="- },- "mquery": {- "version": "5.0.0",- "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz",- "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==",- "requires": {- "debug": "4.x"- }- },- "ms": {- "version": "2.1.3",- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="- },- "punycode": {- "version": "2.3.0",- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",- "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA=="- },- "saslprep": {- "version": "1.0.3",- "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz",- "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==",- "optional": true,- "requires": {- "sparse-bitfield": "^3.0.3"- }- },- "sift": {- "version": "16.0.1",- "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz",- "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ=="- },- "smart-buffer": {- "version": "4.2.0",- "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",- "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg=="- },- "socks": {- "version": "2.7.1",- "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz",- "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==",- "requires": {- "ip": "^2.0.0",- "smart-buffer": "^4.2.0"- }- },- "sparse-bitfield": {- "version": "3.0.3",- "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",- "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==",- "optional": true,- "requires": {- "memory-pager": "^1.0.2"- }- },- "tr46": {- "version": "3.0.0",- "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz",- "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==",- "requires": {- "punycode": "^2.1.1"- }- },- "webidl-conversions": {- "version": "7.0.0",- "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",- "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g=="- },- "whatwg-url": {- "version": "11.0.0",- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz",- "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==",- "requires": {- "tr46": "^3.0.0",- "webidl-conversions": "^7.0.0"- }- }- }-}diff --git a/migration/package.json b/migration/package.jsondeleted file mode 100644index 9f431ca3a6..0000000000--- a/migration/package.json+++ /dev/null@@ -1,16 +0,0 @@-{- "name": "migration",- "version": "1.0.0",- "description": "As Infisical's codebase matures, there are structural things that we need to change.",- "main": "index.js",- "scripts": {- "test": "echo \"Error: no test specified\" && exit 1"- },- "author": "",- "license": "ISC",- "dependencies": {- "dotenv": "^16.0.3",- "ip": "^2.0.1",- "mongoose": "^7.2.1"- }-}diff --git a/migration/scripts/reencrypt_under_256_key.js b/migration/scripts/reencrypt_under_256_key.jsdeleted file mode 100644index 5f36bd2c70..0000000000--- a/migration/scripts/reencrypt_under_256_key.js+++ /dev/null@@ -1,177 +0,0 @@-require('dotenv').config();-const crypto = require('crypto');-const mongoose = require('mongoose');-const Bot = require('../models/bot');-const SecretBlindIndexData = require('../models/secretBlindIndexData');--const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // 16-byte hex encryption key to migrate from-const ROOT_ENCRYPTION_KEY = process.env.ROOT_ENCRYPTION_KEY; // 32-byte base64 encryption key to migrate to--const ALGORITHM_AES_256_GCM = 'aes-256-gcm';-const ENCODING_SCHEME_UTF8 = 'utf8';-const ENCODING_SCHEME_BASE64 = 'base64';--const decryptSymmetric = ({- ciphertext,- iv,- tag,- key-}) => {- const decipher = crypto.createDecipheriv(- 'aes-256-gcm',- key,- Buffer.from(iv, ENCODING_SCHEME_BASE64)- );-- decipher.setAuthTag(Buffer.from(tag, ENCODING_SCHEME_BASE64));-- let cleartext = decipher.update(ciphertext, ENCODING_SCHEME_BASE64, ENCODING_SCHEME_UTF8);- cleartext += decipher.final('utf8');-- return cleartext;-}--const encryptSymmetric = (- plaintext,- key-) => {- const iv = crypto.randomBytes(12);-- const secretKey = crypto.createSecretKey(key, ENCODING_SCHEME_BASE64);- const cipher = crypto.createCipheriv(ALGORITHM_AES_256_GCM, secretKey, iv);-- let ciphertext = cipher.update(plaintext, ENCODING_SCHEME_UTF8, ENCODING_SCHEME_BASE64);- ciphertext += cipher.final(ENCODING_SCHEME_BASE64);-- return {- ciphertext,- iv: iv.toString(ENCODING_SCHEME_BASE64),- tag: cipher.getAuthTag().toString(ENCODING_SCHEME_BASE64)- };-};--/**- * Validate that encryption key [key] is encoded in [encoding] and [bytes] bytes- * @param {String} key - encryption key to validate- * @param {String} encoding - encoding like hex or base64- * @param {Number} bytes - number of bytes- */-const validateEncryptionKey = (encryptionKey, encoding, bytes) => {- const keyBuffer = Buffer.from(encryptionKey, encoding);- const decoded = keyBuffer.toString(encoding);-- if (decoded !== encryptionKey) throw Error({- message: `Failed to validate that encryption key is encoded in ${encoding}`- });-- if (keyBuffer.length !== bytes) throw Error({- message: `Failed to validate that encryption key is ${bytes} bytes`- });-}--const main = async () => {-- // validate that ENCRYPTION_KEY is a 16-byte hex string- validateEncryptionKey(ENCRYPTION_KEY, 'hex', 16);-- // validate that ROOT_ENCRYPTION_KEY is a 32-byte base64 string- validateEncryptionKey(ROOT_ENCRYPTION_KEY, 'base64', 32);-- mongoose.connect(process.env.MONGO_URI)- .then(async () => {- console.log('Connected!');-- if (ENCRYPTION_KEY && ROOT_ENCRYPTION_KEY) {-- // re-encrypt bot private keys- const bots = await Bot.find({- algorithm: ALGORITHM_AES_256_GCM,- keyEncoding: ENCODING_SCHEME_UTF8- }).select('+encryptedPrivateKey iv tag algorithm keyEncoding workspace');-- if (bots.length > 0) {- const operationsBot = await Promise.all(- bots.map(async (bot) => {-- const privateKey = decryptSymmetric({- ciphertext: bot.encryptedPrivateKey,- iv: bot.iv,- tag: bot.tag,- key: ENCRYPTION_KEY- });-- const {- ciphertext: encryptedPrivateKey,- iv,- tag- } = encryptSymmetric(privateKey, ROOT_ENCRYPTION_KEY);-- return ({- updateOne: {- filter: {- _id: bot._id- },- update: {- encryptedPrivateKey,- iv,- tag,- algorithm: ALGORITHM_AES_256_GCM,- keyEncoding: ENCODING_SCHEME_BASE64- }- }- })- })- );-- const botBulkWriteResult = await Bot.bulkWrite(operationsBot);- console.log('botBulkWriteResult: ', botBulkWriteResult);- }-- // re-encrypt secret blind index data salts- const secretBlindIndexData = await SecretBlindIndexData.find({- algorithm: ALGORITHM_AES_256_GCM,- keyEncoding: ENCODING_SCHEME_UTF8- }).select('+encryptedSaltCiphertext +saltIV +saltTag +algorithm +keyEncoding');-- if (secretBlindIndexData.length > 0) {- const operationsSecretBlindIndexData = await Promise.all(- secretBlindIndexData.map(async (secretBlindIndexDatum) => {-- const salt = decryptSymmetric({- ciphertext: secretBlindIndexDatum.encryptedSaltCiphertext,- iv: secretBlindIndexDatum.saltIV,- tag: secretBlindIndexDatum.saltTag,- key: ENCRYPTION_KEY- });-- const {- ciphertext: encryptedSaltCiphertext,- iv: saltIV,- tag: saltTag- } = encryptSymmetric(salt, ROOT_ENCRYPTION_KEY);-- return ({- updateOne: {- filter: {- _id: secretBlindIndexDatum._id- },- update: {- encryptedSaltCiphertext,- saltIV,- saltTag,- algorithm: ALGORITHM_AES_256_GCM,- keyEncoding: ENCODING_SCHEME_BASE64- }- }- })- })- );-- const secretBlindIndexDataBulkWriteResult = await SecretBlindIndexData.bulkWrite(operationsSecretBlindIndexData);- console.log('secretBlindIndexDataBulkWriteResult: ', secretBlindIndexDataBulkWriteResult);- }- }- });-}--main();\ No newline at end of file