envware 1.2.9 → 1.3.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/README.md +20 -34
- package/dist/app.module.js +8 -4
- package/dist/app.module.js.map +1 -1
- package/dist/commands/approve.command.d.ts +11 -0
- package/dist/commands/approve.command.js +78 -0
- package/dist/commands/approve.command.js.map +1 -0
- package/dist/commands/request.command.d.ts +16 -0
- package/dist/commands/request.command.js +86 -0
- package/dist/commands/request.command.js.map +1 -0
- package/dist/commands/{accept.command.d.ts → sync-access.command.d.ts} +1 -1
- package/dist/commands/sync-access.command.js +61 -0
- package/dist/commands/sync-access.command.js.map +1 -0
- package/dist/commands/{share.command.d.ts → team-invite.command.d.ts} +5 -3
- package/dist/commands/team-invite.command.js +123 -0
- package/dist/commands/team-invite.command.js.map +1 -0
- package/dist/services/api.service.js +3 -0
- package/dist/services/api.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/commands/accept.command.js +0 -75
- package/dist/commands/accept.command.js.map +0 -1
- package/dist/commands/share.command.js +0 -108
- package/dist/commands/share.command.js.map +0 -1
package/README.md
CHANGED
|
@@ -10,32 +10,25 @@ Stop sharing `.env` files via Slack, DMs, or insecure notes. Envware ensures you
|
|
|
10
10
|
|
|
11
11
|
- **🔒 End-to-End Encryption (E2EE):** Secrets are encrypted locally on your machine using AES-256-GCM before being uploaded. We never see your data.
|
|
12
12
|
- **🔑 SSH Key Auth:** Authorization is tied to your existing SSH keys. No complex setup, just verify once.
|
|
13
|
+
- **🏢 Multi-tenant Teams:** Organize projects by teams. Granular access control for members.
|
|
13
14
|
- **📱 Multi-device Sync:** Seamlessly pull your project environments on any authorized machine (laptop, server, workstation).
|
|
14
|
-
- **👥 Collaboration:**
|
|
15
|
+
- **👥 Secure Collaboration:** Request access to projects or invite users to teams without sharing plain-text codes.
|
|
15
16
|
- **📦 Backup & Restore:** Keep local encrypted backups of all your project configurations.
|
|
16
17
|
|
|
17
18
|
## Quick Start
|
|
18
19
|
|
|
19
20
|
### 1. Installation
|
|
20
|
-
|
|
21
|
+
Run directly with npx:
|
|
21
22
|
```bash
|
|
22
23
|
npx envware login
|
|
23
24
|
```
|
|
24
25
|
|
|
25
|
-
### 2.
|
|
26
|
-
```bash
|
|
27
|
-
npx envware signup # If you don't have an account
|
|
28
|
-
npx envware login # If you already have one
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### 3. Create or Select a Project
|
|
26
|
+
### 2. Create or Select a Project
|
|
32
27
|
```bash
|
|
33
28
|
npx envware project create my-awesome-api
|
|
34
|
-
# OR
|
|
35
|
-
npx envware project select
|
|
36
29
|
```
|
|
37
30
|
|
|
38
|
-
###
|
|
31
|
+
### 3. Push and Pull Secrets
|
|
39
32
|
```bash
|
|
40
33
|
# Upload your local .env (encrypted locally first!)
|
|
41
34
|
npx envware push
|
|
@@ -44,31 +37,24 @@ npx envware push
|
|
|
44
37
|
npx envware pull
|
|
45
38
|
```
|
|
46
39
|
|
|
47
|
-
## Commands
|
|
48
|
-
|
|
49
|
-
- `signup`: Create a new envware account.
|
|
50
|
-
- `login`: Log in to your envware account.
|
|
51
|
-
- `project`: Manage your projects (create, list, select, remove).
|
|
52
|
-
- `push`: Upload local .env to a project (E2EE).
|
|
53
|
-
- `pull`: Download project .env (E2EE).
|
|
54
|
-
- `envs`: List all environments in the project (.env, .env.production, etc.).
|
|
55
|
-
- `secrets`: List all secret keys in an environment.
|
|
56
|
-
- `share`: Share project access with another user.
|
|
57
|
-
- `accept`: Accept a project invitation code.
|
|
58
|
-
- `backup`: Create an encrypted local JSON backup of all owned projects.
|
|
59
|
-
- `restore`: Restore secrets from a local backup file.
|
|
60
|
-
- `keys`: Manage your authorized devices and SSH keys.
|
|
61
|
-
- `nuke`: Permanently delete your account and all data.
|
|
62
|
-
- `status`: Check your plan and usage.
|
|
63
|
-
- `upgrade`: Upgrade to Premium for higher limits.
|
|
40
|
+
## Core Commands
|
|
64
41
|
|
|
65
|
-
|
|
42
|
+
- `signup`: Create a new account (automatically creates your Personal Team).
|
|
43
|
+
- `project`: Manage projects (create, list, select). Projects now use `team-slug/project-slug`.
|
|
44
|
+
- `push` / `pull`: E2EE sync of your environment variables.
|
|
45
|
+
- `request <team/project>`: Request access to a project by sending your public key.
|
|
46
|
+
- `approve`: Approve pending access requests (Owner/Admin only).
|
|
47
|
+
- `sync-access`: Sync all your approved project accesses across devices.
|
|
48
|
+
- `team-invite <team> <email> [--all]`: Invite a user to a team. Use `--all` for instant project access.
|
|
49
|
+
- `keys`: Manage your authorized SSH keys and devices.
|
|
50
|
+
- `status`: Check your plan, team, and usage.
|
|
66
51
|
|
|
67
|
-
|
|
68
|
-
1. **User Key:** Derived from your SSH public key.
|
|
69
|
-
2. **Project Key:** A unique key generated for each project, encrypted with your User Key.
|
|
52
|
+
## Security
|
|
70
53
|
|
|
71
|
-
|
|
54
|
+
Envware uses a decentralized trust model:
|
|
55
|
+
1. **No Intermediate Codes:** The legacy `share` system (invite codes) was removed.
|
|
56
|
+
2. **Key Exchange:** Access is granted by encrypting a Project Key directly for a user's verified public key.
|
|
57
|
+
3. **Decentralized:** All encryption/decryption happens inside the CLI. The server only stores encrypted "blobs".
|
|
72
58
|
|
|
73
59
|
---
|
|
74
60
|
|
package/dist/app.module.js
CHANGED
|
@@ -13,8 +13,10 @@ const login_command_1 = require("./commands/login.command");
|
|
|
13
13
|
const project_command_1 = require("./commands/project.command");
|
|
14
14
|
const push_command_1 = require("./commands/push.command");
|
|
15
15
|
const pull_command_1 = require("./commands/pull.command");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const request_command_1 = require("./commands/request.command");
|
|
17
|
+
const approve_command_1 = require("./commands/approve.command");
|
|
18
|
+
const sync_access_command_1 = require("./commands/sync-access.command");
|
|
19
|
+
const team_invite_command_1 = require("./commands/team-invite.command");
|
|
18
20
|
const verify_command_1 = require("./commands/verify.command");
|
|
19
21
|
const envs_command_1 = require("./commands/envs.command");
|
|
20
22
|
const secrets_command_1 = require("./commands/secrets.command");
|
|
@@ -38,8 +40,10 @@ exports.AppModule = AppModule = __decorate([
|
|
|
38
40
|
project_command_1.ProjectCommand,
|
|
39
41
|
push_command_1.PushCommand,
|
|
40
42
|
pull_command_1.PullCommand,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
request_command_1.RequestCommand,
|
|
44
|
+
approve_command_1.ApproveCommand,
|
|
45
|
+
sync_access_command_1.SyncAccessCommand,
|
|
46
|
+
team_invite_command_1.TeamInviteCommand,
|
|
43
47
|
verify_command_1.VerifyCommand,
|
|
44
48
|
envs_command_1.EnvsCommand,
|
|
45
49
|
secrets_command_1.SecretsCommand,
|
package/dist/app.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,8DAA0D;AAC1D,4DAAwD;AACxD,gEAA4D;AAC5D,0DAAsD;AACtD,0DAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,8DAA0D;AAC1D,4DAAwD;AACxD,gEAA4D;AAC5D,0DAAsD;AACtD,0DAAsD;AACtD,gEAA4D;AAC5D,gEAA4D;AAC5D,wEAAmE;AACnE,wEAAmE;AACnE,8DAA0D;AAC1D,0DAAsD;AACtD,gEAA4D;AAC5D,gEAA4D;AAC5D,8DAA0D;AAC1D,8DAA0D;AAC1D,gEAA4D;AAC5D,0DAAsD;AACtD,0DAAsD;AACtD,wDAAoD;AACpD,8DAA0D;AAC1D,sEAAkE;AA2B3D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAzBrB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,8BAAa;YACb,4BAAY;YACZ,gCAAc;YACd,0BAAW;YACX,0BAAW;YACX,gCAAc;YACd,gCAAc;YACd,uCAAiB;YACjB,uCAAiB;YACjB,8BAAa;YACb,0BAAW;YACX,gCAAc;YACd,gCAAc;YACd,8BAAa;YACb,8BAAa;YACb,gCAAc;YACd,0BAAW;YACX,0BAAW;YACX,wBAAU;YACV,8BAAa;YACb,sCAAiB;SAClB;KACF,CAAC;GACW,SAAS,CAAG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommandRunner } from 'nest-commander';
|
|
2
|
+
import { ApiService } from '../services/api.service';
|
|
3
|
+
import { ConfigService } from '../services/config.service';
|
|
4
|
+
import { EncryptionService } from '../services/encryption.service';
|
|
5
|
+
export declare class ApproveCommand extends CommandRunner {
|
|
6
|
+
private apiService;
|
|
7
|
+
private configService;
|
|
8
|
+
private encryptionService;
|
|
9
|
+
constructor(apiService: ApiService, configService: ConfigService, encryptionService: EncryptionService);
|
|
10
|
+
run(passedParams: string[]): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ApproveCommand = void 0;
|
|
16
|
+
const nest_commander_1 = require("nest-commander");
|
|
17
|
+
const api_service_1 = require("../services/api.service");
|
|
18
|
+
const config_service_1 = require("../services/config.service");
|
|
19
|
+
const encryption_service_1 = require("../services/encryption.service");
|
|
20
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
21
|
+
let ApproveCommand = class ApproveCommand extends nest_commander_1.CommandRunner {
|
|
22
|
+
apiService;
|
|
23
|
+
configService;
|
|
24
|
+
encryptionService;
|
|
25
|
+
constructor(apiService, configService, encryptionService) {
|
|
26
|
+
super();
|
|
27
|
+
this.apiService = apiService;
|
|
28
|
+
this.configService = configService;
|
|
29
|
+
this.encryptionService = encryptionService;
|
|
30
|
+
}
|
|
31
|
+
async run(passedParams) {
|
|
32
|
+
const [requestId] = passedParams;
|
|
33
|
+
try {
|
|
34
|
+
if (!requestId) {
|
|
35
|
+
const { data: requests } = await this.apiService.instance.get('/projects/requests/pending');
|
|
36
|
+
if (requests.length === 0) {
|
|
37
|
+
console.log(chalk_1.default.yellow('No pending access requests found. 🌸'));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
console.log(chalk_1.default.cyan('Pending Access Requests:'));
|
|
41
|
+
requests.forEach(req => {
|
|
42
|
+
console.log(chalk_1.default.white(`- [${req.id}] ${chalk_1.default.bold(req.user.email)} requests ${req.role} on ${req.projectId}`));
|
|
43
|
+
});
|
|
44
|
+
console.log(chalk_1.default.blue('\nRun "approve <id>" to grant access.'));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const { data: request } = await this.apiService.instance.get(`/projects/requests/${requestId}`);
|
|
48
|
+
const { data: pullData } = await this.apiService.instance.get('/secrets', {
|
|
49
|
+
params: { projectId: request.projectId },
|
|
50
|
+
});
|
|
51
|
+
if (!pullData.encryptedProjectKey) {
|
|
52
|
+
throw new Error('Project does not have an E2EE key. Push secrets first.');
|
|
53
|
+
}
|
|
54
|
+
const projectKey = this.encryptionService.decryptProjectKey(pullData.encryptedProjectKey);
|
|
55
|
+
console.log(chalk_1.default.blue(`Encrypting for user: ${request.user.email}...`));
|
|
56
|
+
const encryptedForRecipient = this.encryptionService.encryptProjectKey(projectKey, request.publicKey);
|
|
57
|
+
await this.apiService.instance.post(`/projects/requests/${requestId}/approve`, {
|
|
58
|
+
encryptedProjectKey: encryptedForRecipient,
|
|
59
|
+
});
|
|
60
|
+
console.log(chalk_1.default.green(`✔ Approved ${request.user.email} for project ${request.projectId}! 🌸🚀`));
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
64
|
+
console.log(chalk_1.default.red('Approval failed: ' + errorMessage));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.ApproveCommand = ApproveCommand;
|
|
69
|
+
exports.ApproveCommand = ApproveCommand = __decorate([
|
|
70
|
+
(0, nest_commander_1.Command)({
|
|
71
|
+
name: 'approve',
|
|
72
|
+
description: 'Approve pending access requests for your projects',
|
|
73
|
+
}),
|
|
74
|
+
__metadata("design:paramtypes", [api_service_1.ApiService,
|
|
75
|
+
config_service_1.ConfigService,
|
|
76
|
+
encryption_service_1.EncryptionService])
|
|
77
|
+
], ApproveCommand);
|
|
78
|
+
//# sourceMappingURL=approve.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approve.command.js","sourceRoot":"","sources":["../../src/commands/approve.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAwD;AACxD,yDAAqD;AACrD,+DAA2D;AAC3D,uEAAmE;AACnE,kDAA0B;AAqBnB,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,8BAAa;IAErC;IACA;IACA;IAHV,YACU,UAAsB,EACtB,aAA4B,EAC5B,iBAAoC;QAE5C,KAAK,EAAE,C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AAC;qCAGsB,wBAAU;QACP,8BAAa;QACT,sCAAiB;GAJnC,cAAc,CA+D1B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CommandRunner } from 'nest-commander';
|
|
2
|
+
import { ApiService } from '../services/api.service';
|
|
3
|
+
import { ConfigService } from '../services/config.service';
|
|
4
|
+
import { EncryptionService } from '../services/encryption.service';
|
|
5
|
+
interface RequestOptions {
|
|
6
|
+
role: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class RequestCommand extends CommandRunner {
|
|
9
|
+
private apiService;
|
|
10
|
+
private configService;
|
|
11
|
+
private encryptionService;
|
|
12
|
+
constructor(apiService: ApiService, configService: ConfigService, encryptionService: EncryptionService);
|
|
13
|
+
run(passedParams: string[], options?: RequestOptions): Promise<void>;
|
|
14
|
+
parseRole(val: string): string;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RequestCommand = void 0;
|
|
16
|
+
const nest_commander_1 = require("nest-commander");
|
|
17
|
+
const api_service_1 = require("../services/api.service");
|
|
18
|
+
const config_service_1 = require("../services/config.service");
|
|
19
|
+
const encryption_service_1 = require("../services/encryption.service");
|
|
20
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
21
|
+
let RequestCommand = class RequestCommand extends nest_commander_1.CommandRunner {
|
|
22
|
+
apiService;
|
|
23
|
+
configService;
|
|
24
|
+
encryptionService;
|
|
25
|
+
constructor(apiService, configService, encryptionService) {
|
|
26
|
+
super();
|
|
27
|
+
this.apiService = apiService;
|
|
28
|
+
this.configService = configService;
|
|
29
|
+
this.encryptionService = encryptionService;
|
|
30
|
+
}
|
|
31
|
+
async run(passedParams, options) {
|
|
32
|
+
const [projectId] = passedParams;
|
|
33
|
+
const role = options?.role || 'DEVELOPER';
|
|
34
|
+
if (!projectId) {
|
|
35
|
+
console.log(chalk_1.default.red('Usage: request <team-slug/project-slug | project-id> [--role ADMINISTRATOR|DEVELOPER]'));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const publicKey = this.encryptionService.getPublicKey();
|
|
40
|
+
if (!publicKey) {
|
|
41
|
+
console.log(chalk_1.default.red('No verified SSH key found. Run "keys --add" first.'));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
await this.apiService.instance.post('/projects/request', {
|
|
45
|
+
projectId,
|
|
46
|
+
publicKey,
|
|
47
|
+
role,
|
|
48
|
+
});
|
|
49
|
+
console.log(chalk_1.default.green(`✔ Request sent to project ${projectId}! 🌸`));
|
|
50
|
+
console.log(chalk_1.default.blue('The owner will need to approve it to share the E2EE key.'));
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
54
|
+
console.log(chalk_1.default.red('Request failed: ' + errorMessage));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
parseRole(val) {
|
|
58
|
+
const upper = val.toUpperCase();
|
|
59
|
+
if (upper === 'ADMIN')
|
|
60
|
+
return 'ADMINISTRATOR';
|
|
61
|
+
if (upper === 'DEV')
|
|
62
|
+
return 'DEVELOPER';
|
|
63
|
+
return upper;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.RequestCommand = RequestCommand;
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, nest_commander_1.Option)({
|
|
69
|
+
flags: '-r, --role [role]',
|
|
70
|
+
description: 'The role requested (ADMINISTRATOR or DEVELOPER)',
|
|
71
|
+
defaultValue: 'DEVELOPER',
|
|
72
|
+
}),
|
|
73
|
+
__metadata("design:type", Function),
|
|
74
|
+
__metadata("design:paramtypes", [String]),
|
|
75
|
+
__metadata("design:returntype", String)
|
|
76
|
+
], RequestCommand.prototype, "parseRole", null);
|
|
77
|
+
exports.RequestCommand = RequestCommand = __decorate([
|
|
78
|
+
(0, nest_commander_1.Command)({
|
|
79
|
+
name: 'request',
|
|
80
|
+
description: 'Request access to a project by providing your public key (E2EE)',
|
|
81
|
+
}),
|
|
82
|
+
__metadata("design:paramtypes", [api_service_1.ApiService,
|
|
83
|
+
config_service_1.ConfigService,
|
|
84
|
+
encryption_service_1.EncryptionService])
|
|
85
|
+
], RequestCommand);
|
|
86
|
+
//# sourceMappingURL=request.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.command.js","sourceRoot":"","sources":["../../src/commands/request.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgE;AAChE,yDAAqD;AACrD,+DAA2D;AAC3D,uEAAmE;AACnE,kDAA0B;AAUnB,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,8BAAa;IAErC;IACA;IACA;IAHV,YACU,UAAsB,EACtB,aAA4B,EAC5B,iBAAoC;QAE5C,KAAK,EAAE,CAAC;QAJA,eAAU,GAAV,UAAU,CAAY;QACtB,kBAAa,GAAb,aAAa,CAAe;QAC5B,sB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O;YAAE,OAAO,eAAe,CAAC;QAC9C,IAAI,KAAK,KAAK,KAAK;YAAE,OAAO,WAAW,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AArDY,wCAAc;AA+CzB;IALC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,iDAAiD;QAC9D,YAAY,EAAE,WAAW;KAC1B,CAAC;;;;+CAMD;yBApDU,cAAc;IAJ1B,IAAA,wBAAO,EAAC;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,iEAAiE;KAC/E,CAAC;qCAGsB,wBAAU;QACP,8BAAa;QACT,sCAAiB;GAJnC,cAAc,CAqD1B"}
|
|
@@ -2,7 +2,7 @@ import { CommandRunner } from 'nest-commander';
|
|
|
2
2
|
import { ApiService } from '../services/api.service';
|
|
3
3
|
import { ConfigService } from '../services/config.service';
|
|
4
4
|
import { EncryptionService } from '../services/encryption.service';
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class SyncAccessCommand extends CommandRunner {
|
|
6
6
|
private apiService;
|
|
7
7
|
private encryptionService;
|
|
8
8
|
private configService;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SyncAccessCommand = void 0;
|
|
16
|
+
const nest_commander_1 = require("nest-commander");
|
|
17
|
+
const api_service_1 = require("../services/api.service");
|
|
18
|
+
const config_service_1 = require("../services/config.service");
|
|
19
|
+
const encryption_service_1 = require("../services/encryption.service");
|
|
20
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
21
|
+
let SyncAccessCommand = class SyncAccessCommand extends nest_commander_1.CommandRunner {
|
|
22
|
+
apiService;
|
|
23
|
+
encryptionService;
|
|
24
|
+
configService;
|
|
25
|
+
constructor(apiService, encryptionService, configService) {
|
|
26
|
+
super();
|
|
27
|
+
this.apiService = apiService;
|
|
28
|
+
this.encryptionService = encryptionService;
|
|
29
|
+
this.configService = configService;
|
|
30
|
+
}
|
|
31
|
+
async run(passedParams) {
|
|
32
|
+
try {
|
|
33
|
+
console.log(chalk_1.default.blue('Checking for approved access requests...'));
|
|
34
|
+
const { data: approvedRequests } = await this.apiService.instance.get('/projects/requests/approved');
|
|
35
|
+
if (approvedRequests.length === 0) {
|
|
36
|
+
console.log(chalk_1.default.yellow('No new approved requests found. 🌸'));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
for (const req of approvedRequests) {
|
|
40
|
+
console.log(chalk_1.default.cyan(`Syncing access for project: ${req.projectId}`));
|
|
41
|
+
this.configService.setLocalProject(req.projectId);
|
|
42
|
+
console.log(chalk_1.default.green(`✔ Access synced! Current project set to ${req.projectId} 🚀`));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
const message = error.response?.data?.message || error.message;
|
|
47
|
+
console.log(chalk_1.default.red(`Failed to sync access: ${message}`));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.SyncAccessCommand = SyncAccessCommand;
|
|
52
|
+
exports.SyncAccessCommand = SyncAccessCommand = __decorate([
|
|
53
|
+
(0, nest_commander_1.Command)({
|
|
54
|
+
name: 'sync-access',
|
|
55
|
+
description: 'Sync and finalize approved project access requests',
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:paramtypes", [api_service_1.ApiService,
|
|
58
|
+
encryption_service_1.EncryptionService,
|
|
59
|
+
config_service_1.ConfigService])
|
|
60
|
+
], SyncAccessCommand);
|
|
61
|
+
//# sourceMappingURL=sync-access.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-access.command.js","sourceRoot":"","sources":["../../src/commands/sync-access.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAwD;AACxD,yDAAqD;AACrD,+DAA2D;AAC3D,uEAAmE;AACnE,kDAA0B;AAYnB,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,8BAAa;IAExC;IACA;IACA;IAHV,YACU,UAAsB,EACtB,iBAAoC,EACpC,aAA4B;QAEpC,KAAK,EAAE,CAAC;QAJA,eAAU,GAAV,UAAU,CAAY;QACtB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,kBAAa,GAAb,aAAa,CAAe;IAGtC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,YAAsB;QAC9B,IAAI,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC,CAAC;YAEpE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAC9B,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAA4B,6BAA6B,CAAC,CAAC;YAE/F,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAClC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC,CAAC;gBAChE,OAAO;YACT,CAAC;YAED,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;gBACnC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,+BAA+B,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;gBAMxE,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBAClD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,2CAA2C,GAAG,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC;YAC1F,CAAC;QAEH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC;YAC/D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;CACF,CAAA;AArCY,8CAAiB;4BAAjB,iBAAiB;IAJ7B,IAAA,wBAAO,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,oDAAoD;KAClE,CAAC;qCAGsB,wBAAU;QACH,sCAAiB;QACrB,8BAAa;GAJ3B,iBAAiB,CAqC7B"}
|
|
@@ -2,15 +2,17 @@ import { CommandRunner } from 'nest-commander';
|
|
|
2
2
|
import { ApiService } from '../services/api.service';
|
|
3
3
|
import { ConfigService } from '../services/config.service';
|
|
4
4
|
import { EncryptionService } from '../services/encryption.service';
|
|
5
|
-
interface
|
|
5
|
+
interface TeamInviteOptions {
|
|
6
6
|
role: string;
|
|
7
|
+
all: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare class
|
|
9
|
+
export declare class TeamInviteCommand extends CommandRunner {
|
|
9
10
|
private apiService;
|
|
10
11
|
private encryptionService;
|
|
11
12
|
private configService;
|
|
12
13
|
constructor(apiService: ApiService, encryptionService: EncryptionService, configService: ConfigService);
|
|
13
|
-
run(passedParams: string[], options?:
|
|
14
|
+
run(passedParams: string[], options?: TeamInviteOptions): Promise<void>;
|
|
14
15
|
parseRole(val: string): string;
|
|
16
|
+
parseAll(val: boolean): boolean;
|
|
15
17
|
}
|
|
16
18
|
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.TeamInviteCommand = void 0;
|
|
16
|
+
const nest_commander_1 = require("nest-commander");
|
|
17
|
+
const api_service_1 = require("../services/api.service");
|
|
18
|
+
const config_service_1 = require("../services/config.service");
|
|
19
|
+
const encryption_service_1 = require("../services/encryption.service");
|
|
20
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
21
|
+
let TeamInviteCommand = class TeamInviteCommand extends nest_commander_1.CommandRunner {
|
|
22
|
+
apiService;
|
|
23
|
+
encryptionService;
|
|
24
|
+
configService;
|
|
25
|
+
constructor(apiService, encryptionService, configService) {
|
|
26
|
+
super();
|
|
27
|
+
this.apiService = apiService;
|
|
28
|
+
this.encryptionService = encryptionService;
|
|
29
|
+
this.configService = configService;
|
|
30
|
+
}
|
|
31
|
+
async run(passedParams, options) {
|
|
32
|
+
const [teamId, email] = passedParams;
|
|
33
|
+
const role = options?.role || 'MEMBER';
|
|
34
|
+
const grantAll = options?.all || false;
|
|
35
|
+
if (!teamId || !email) {
|
|
36
|
+
console.log(chalk_1.default.red('Usage: team-invite <teamId|slug> <email> [--role ADMIN|MEMBER] [--all]'));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
console.log(chalk_1.default.blue(`Inviting ${email} to team ${teamId}...`));
|
|
41
|
+
const { data: member } = await this.apiService.instance.post(`/teams/${teamId}/members`, {
|
|
42
|
+
email,
|
|
43
|
+
role,
|
|
44
|
+
});
|
|
45
|
+
console.log(chalk_1.default.green(`✔ User ${email} added to team as ${role}!`));
|
|
46
|
+
if (grantAll) {
|
|
47
|
+
console.log(chalk_1.default.magenta(`\nGranting access to ALL projects in team ${teamId}... 🚀`));
|
|
48
|
+
const { data: userData } = await this.apiService.instance.get(`/users/${email}/public-key`);
|
|
49
|
+
const recipientPublicKey = userData.publicKey;
|
|
50
|
+
if (!recipientPublicKey) {
|
|
51
|
+
console.log(chalk_1.default.yellow(`User ${email} has no public key registered yet. They will need to 'request' access later.`));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const { data: projects } = await this.apiService.instance.get(`/teams/${teamId}/projects`);
|
|
55
|
+
for (const project of projects) {
|
|
56
|
+
try {
|
|
57
|
+
console.log(chalk_1.default.blue(`Encrypting key for project: ${project.name}...`));
|
|
58
|
+
const { data: pullData } = await this.apiService.instance.get(`/secrets`, {
|
|
59
|
+
params: { projectId: project.id },
|
|
60
|
+
});
|
|
61
|
+
if (!pullData.encryptedProjectKey) {
|
|
62
|
+
console.log(chalk_1.default.gray(` Skipping ${project.name}: No E2EE key found.`));
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const projectKey = this.encryptionService.decryptProjectKey(pullData.encryptedProjectKey);
|
|
66
|
+
const encryptedForRecipient = this.encryptionService.encryptProjectKey(projectKey, recipientPublicKey);
|
|
67
|
+
await this.apiService.instance.post(`/projects/keys`, {
|
|
68
|
+
projectId: project.id,
|
|
69
|
+
userId: member.userId,
|
|
70
|
+
encryptedProjectKey: encryptedForRecipient,
|
|
71
|
+
});
|
|
72
|
+
console.log(chalk_1.default.green(` ✔ Access granted to ${project.name}`));
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
console.log(chalk_1.default.red(` ✘ Failed for ${project.name}: ${err.message}`));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
console.log(chalk_1.default.bold.green('\nAll project accesses processed! 🌸'));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
83
|
+
console.log(chalk_1.default.red('Invite failed: ' + errorMessage));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
parseRole(val) {
|
|
87
|
+
return val.toUpperCase();
|
|
88
|
+
}
|
|
89
|
+
parseAll(val) {
|
|
90
|
+
return val;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.TeamInviteCommand = TeamInviteCommand;
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, nest_commander_1.Option)({
|
|
96
|
+
flags: '-r, --role [role]',
|
|
97
|
+
description: 'The role for the new member (ADMIN or MEMBER)',
|
|
98
|
+
defaultValue: 'MEMBER',
|
|
99
|
+
}),
|
|
100
|
+
__metadata("design:type", Function),
|
|
101
|
+
__metadata("design:paramtypes", [String]),
|
|
102
|
+
__metadata("design:returntype", String)
|
|
103
|
+
], TeamInviteCommand.prototype, "parseRole", null);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, nest_commander_1.Option)({
|
|
106
|
+
flags: '-a, --all',
|
|
107
|
+
description: 'Grant access to all existing projects in the team',
|
|
108
|
+
defaultValue: false,
|
|
109
|
+
}),
|
|
110
|
+
__metadata("design:type", Function),
|
|
111
|
+
__metadata("design:paramtypes", [Boolean]),
|
|
112
|
+
__metadata("design:returntype", Boolean)
|
|
113
|
+
], TeamInviteCommand.prototype, "parseAll", null);
|
|
114
|
+
exports.TeamInviteCommand = TeamInviteCommand = __decorate([
|
|
115
|
+
(0, nest_commander_1.Command)({
|
|
116
|
+
name: 'team-invite',
|
|
117
|
+
description: 'Invite a user to a team and optionally grant access to all projects',
|
|
118
|
+
}),
|
|
119
|
+
__metadata("design:paramtypes", [api_service_1.ApiService,
|
|
120
|
+
encryption_service_1.EncryptionService,
|
|
121
|
+
config_service_1.ConfigService])
|
|
122
|
+
], TeamInviteCommand);
|
|
123
|
+
//# sourceMappingURL=team-invite.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-invite.command.js","sourceRoot":"","sources":["../../src/commands/team-invite.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgE;AAChE,yDAAqD;AACrD,+DAA2D;AAC3D,uEAAmE;AACnE,kDAA0B;AAwBnB,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,8BAAa;IAExC;IACA;IACA;IAHV,YACU,UAAsB,EACtB,iBAAoC,EACpC,aAA4B;QAEpC,KAAK,EAAE,CAAC;QAJA,eAAU,GAAV,UAAU,CAAY;QACtB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,kBAAa,GAAb,aAAa,CAAe;IAGtC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,YAAsB,EAAE,OAA2B;QAC3D,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,YAAY,CAAC;QACrC,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,QAAQ,CAAC;QACvC,MAAM,QAAQ,GAAG,OAAO,EAAE,GAAG,IAAI,KAAK,CAAC;QAEvC,IAAI,CAAC,MAAM,IA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