@awcp/transport-sshfs 0.0.7 → 0.0.9
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/dist/delegator/credential-manager.d.ts +0 -26
- package/dist/delegator/credential-manager.d.ts.map +1 -1
- package/dist/delegator/credential-manager.js +8 -46
- package/dist/delegator/credential-manager.js.map +1 -1
- package/dist/executor/sshfs-client.d.ts +1 -26
- package/dist/executor/sshfs-client.d.ts.map +1 -1
- package/dist/executor/sshfs-client.js +6 -50
- package/dist/executor/sshfs-client.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -14
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { SshCredential } from '@awcp/core';
|
|
2
2
|
import type { CredentialManagerConfig, GeneratedCredential } from '../types.js';
|
|
3
3
|
/**
|
|
4
|
-
* SSH Credential Manager
|
|
5
|
-
*
|
|
6
4
|
* Manages temporary SSH certificates for AWCP delegations.
|
|
7
5
|
* Uses SSH certificates with built-in expiry for automatic TTL enforcement.
|
|
8
6
|
*/
|
|
@@ -10,9 +8,6 @@ export declare class CredentialManager {
|
|
|
10
8
|
private config;
|
|
11
9
|
private activeCredentials;
|
|
12
10
|
constructor(config: CredentialManagerConfig);
|
|
13
|
-
/**
|
|
14
|
-
* Generate a temporary SSH key pair and sign certificate with TTL
|
|
15
|
-
*/
|
|
16
11
|
generateCredential(delegationId: string, ttlSeconds: number): Promise<{
|
|
17
12
|
credential: SshCredential;
|
|
18
13
|
endpoint: {
|
|
@@ -21,33 +16,12 @@ export declare class CredentialManager {
|
|
|
21
16
|
user: string;
|
|
22
17
|
};
|
|
23
18
|
}>;
|
|
24
|
-
/**
|
|
25
|
-
* Ensure CA key exists, auto-generate if not present
|
|
26
|
-
*/
|
|
27
19
|
private ensureCaKey;
|
|
28
|
-
/**
|
|
29
|
-
* Revoke a credential (delete key files, certificate expires automatically)
|
|
30
|
-
*/
|
|
31
20
|
revokeCredential(delegationId: string): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Get credential info for a delegation
|
|
34
|
-
*/
|
|
35
21
|
getCredential(delegationId: string): GeneratedCredential | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Revoke all credentials
|
|
38
|
-
*/
|
|
39
22
|
revokeAll(): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Clean up stale key files from key directory (call on startup)
|
|
42
|
-
*/
|
|
43
23
|
cleanupStaleKeyFiles(): Promise<number>;
|
|
44
|
-
/**
|
|
45
|
-
* Sign public key with CA to create certificate with TTL
|
|
46
|
-
*/
|
|
47
24
|
private signCertificate;
|
|
48
|
-
/**
|
|
49
|
-
* Execute ssh-keygen to generate a key pair
|
|
50
|
-
*/
|
|
51
25
|
private execSshKeygen;
|
|
52
26
|
}
|
|
53
27
|
//# sourceMappingURL=credential-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-manager.d.ts","sourceRoot":"","sources":["../../src/delegator/credential-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIhF
|
|
1
|
+
{"version":3,"file":"credential-manager.d.ts","sourceRoot":"","sources":["../../src/delegator/credential-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIhF;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,iBAAiB,CAA0C;gBAEvD,MAAM,EAAE,uBAAuB;IAIrC,kBAAkB,CACtB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;QACT,UAAU,EAAE,aAAa,CAAC;QAC1B,QAAQ,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KACxD,CAAC;YAoCY,WAAW;IA0BnB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW3D,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS;IAI9D,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAM1B,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC;IA2B7C,OAAO,CAAC,eAAe;IAgCvB,OAAO,CAAC,aAAa;CAyBtB"}
|
|
@@ -4,8 +4,6 @@ import { spawn } from 'node:child_process';
|
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
5
|
const DEFAULT_KEY_DIR = join(homedir(), '.awcp', 'keys');
|
|
6
6
|
/**
|
|
7
|
-
* SSH Credential Manager
|
|
8
|
-
*
|
|
9
7
|
* Manages temporary SSH certificates for AWCP delegations.
|
|
10
8
|
* Uses SSH certificates with built-in expiry for automatic TTL enforcement.
|
|
11
9
|
*/
|
|
@@ -15,22 +13,15 @@ export class CredentialManager {
|
|
|
15
13
|
constructor(config) {
|
|
16
14
|
this.config = config;
|
|
17
15
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Generate a temporary SSH key pair and sign certificate with TTL
|
|
20
|
-
*/
|
|
21
16
|
async generateCredential(delegationId, ttlSeconds) {
|
|
22
|
-
// Ensure CA key exists (auto-generate if needed)
|
|
23
17
|
await this.ensureCaKey();
|
|
24
18
|
const keyDir = this.config.keyDir ?? DEFAULT_KEY_DIR;
|
|
25
19
|
await mkdir(keyDir, { recursive: true, mode: 0o700 });
|
|
26
20
|
const privateKeyPath = join(keyDir, delegationId);
|
|
27
21
|
const publicKeyPath = join(keyDir, `${delegationId}.pub`);
|
|
28
22
|
const certPath = join(keyDir, `${delegationId}-cert.pub`);
|
|
29
|
-
// Generate key pair
|
|
30
23
|
await this.execSshKeygen(privateKeyPath, `awcp-${delegationId}`);
|
|
31
|
-
// Sign certificate with CA (includes TTL)
|
|
32
24
|
await this.signCertificate(publicKeyPath, ttlSeconds, delegationId);
|
|
33
|
-
// Read the private key and certificate
|
|
34
25
|
const privateKey = await readFile(privateKeyPath, 'utf-8');
|
|
35
26
|
const certificate = await readFile(certPath, 'utf-8');
|
|
36
27
|
const credentialInfo = {
|
|
@@ -42,10 +33,7 @@ export class CredentialManager {
|
|
|
42
33
|
};
|
|
43
34
|
this.activeCredentials.set(delegationId, credentialInfo);
|
|
44
35
|
return {
|
|
45
|
-
credential: {
|
|
46
|
-
privateKey,
|
|
47
|
-
certificate,
|
|
48
|
-
},
|
|
36
|
+
credential: { privateKey, certificate },
|
|
49
37
|
endpoint: {
|
|
50
38
|
host: this.config.sshHost ?? 'localhost',
|
|
51
39
|
port: this.config.sshPort ?? 22,
|
|
@@ -53,24 +41,21 @@ export class CredentialManager {
|
|
|
53
41
|
},
|
|
54
42
|
};
|
|
55
43
|
}
|
|
56
|
-
/**
|
|
57
|
-
* Ensure CA key exists, auto-generate if not present
|
|
58
|
-
*/
|
|
59
44
|
async ensureCaKey() {
|
|
60
45
|
try {
|
|
61
46
|
await access(this.config.caKeyPath, constants.R_OK);
|
|
62
|
-
return;
|
|
47
|
+
return;
|
|
63
48
|
}
|
|
64
49
|
catch {
|
|
65
50
|
// CA key doesn't exist, generate it
|
|
66
51
|
}
|
|
67
|
-
console.log(`[
|
|
52
|
+
console.log(`[AWCP:Credentials] CA key not found at ${this.config.caKeyPath}, generating...`);
|
|
68
53
|
const caDir = join(this.config.caKeyPath, '..');
|
|
69
54
|
await mkdir(caDir, { recursive: true, mode: 0o700 });
|
|
70
55
|
await this.execSshKeygen(this.config.caKeyPath, 'awcp-ca');
|
|
71
|
-
console.log(`[
|
|
56
|
+
console.log(`[AWCP:Credentials] CA key pair generated at ${this.config.caKeyPath}`);
|
|
72
57
|
console.log('');
|
|
73
|
-
console.log('
|
|
58
|
+
console.log(' To enable SSH certificate authentication, add to /etc/ssh/sshd_config:');
|
|
74
59
|
console.log(` TrustedUserCAKeys ${this.config.caKeyPath}.pub`);
|
|
75
60
|
console.log('');
|
|
76
61
|
console.log(' Then restart sshd:');
|
|
@@ -78,65 +63,45 @@ export class CredentialManager {
|
|
|
78
63
|
console.log(' Linux: sudo systemctl restart sshd');
|
|
79
64
|
console.log('');
|
|
80
65
|
}
|
|
81
|
-
/**
|
|
82
|
-
* Revoke a credential (delete key files, certificate expires automatically)
|
|
83
|
-
*/
|
|
84
66
|
async revokeCredential(delegationId) {
|
|
85
67
|
const credential = this.activeCredentials.get(delegationId);
|
|
86
|
-
if (!credential)
|
|
68
|
+
if (!credential)
|
|
87
69
|
return;
|
|
88
|
-
}
|
|
89
|
-
// Delete key and certificate files
|
|
90
70
|
await unlink(credential.privateKeyPath).catch(() => { });
|
|
91
71
|
await unlink(credential.publicKeyPath).catch(() => { });
|
|
92
72
|
await unlink(credential.certPath).catch(() => { });
|
|
93
73
|
this.activeCredentials.delete(delegationId);
|
|
94
74
|
}
|
|
95
|
-
/**
|
|
96
|
-
* Get credential info for a delegation
|
|
97
|
-
*/
|
|
98
75
|
getCredential(delegationId) {
|
|
99
76
|
return this.activeCredentials.get(delegationId);
|
|
100
77
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Revoke all credentials
|
|
103
|
-
*/
|
|
104
78
|
async revokeAll() {
|
|
105
79
|
for (const delegationId of this.activeCredentials.keys()) {
|
|
106
80
|
await this.revokeCredential(delegationId);
|
|
107
81
|
}
|
|
108
82
|
}
|
|
109
|
-
/**
|
|
110
|
-
* Clean up stale key files from key directory (call on startup)
|
|
111
|
-
*/
|
|
112
83
|
async cleanupStaleKeyFiles() {
|
|
113
84
|
const keyDir = this.config.keyDir ?? DEFAULT_KEY_DIR;
|
|
114
85
|
try {
|
|
115
86
|
const files = await readdir(keyDir);
|
|
116
87
|
let removedCount = 0;
|
|
117
88
|
for (const file of files) {
|
|
118
|
-
// Extract delegation ID from filename
|
|
119
89
|
const delegationId = file.replace(/(-cert)?\.pub$/, '');
|
|
120
90
|
if (this.activeCredentials.has(delegationId)) {
|
|
121
91
|
continue;
|
|
122
92
|
}
|
|
123
|
-
// Remove stale key files
|
|
124
93
|
await unlink(join(keyDir, file)).catch(() => { });
|
|
125
94
|
removedCount++;
|
|
126
95
|
}
|
|
127
96
|
if (removedCount > 0) {
|
|
128
|
-
console.log(`[
|
|
97
|
+
console.log(`[AWCP:Credentials] Cleaned up ${removedCount} stale key files`);
|
|
129
98
|
}
|
|
130
99
|
return removedCount;
|
|
131
100
|
}
|
|
132
101
|
catch {
|
|
133
|
-
// Directory doesn't exist, nothing to clean
|
|
134
102
|
return 0;
|
|
135
103
|
}
|
|
136
104
|
}
|
|
137
|
-
/**
|
|
138
|
-
* Sign public key with CA to create certificate with TTL
|
|
139
|
-
*/
|
|
140
105
|
signCertificate(publicKeyPath, ttlSeconds, delegationId) {
|
|
141
106
|
return new Promise((resolve, reject) => {
|
|
142
107
|
const proc = spawn('ssh-keygen', [
|
|
@@ -162,15 +127,12 @@ export class CredentialManager {
|
|
|
162
127
|
proc.on('error', reject);
|
|
163
128
|
});
|
|
164
129
|
}
|
|
165
|
-
/**
|
|
166
|
-
* Execute ssh-keygen to generate a key pair
|
|
167
|
-
*/
|
|
168
130
|
execSshKeygen(keyPath, comment) {
|
|
169
131
|
return new Promise((resolve, reject) => {
|
|
170
132
|
const proc = spawn('ssh-keygen', [
|
|
171
133
|
'-t', 'ed25519',
|
|
172
134
|
'-f', keyPath,
|
|
173
|
-
'-N', '',
|
|
135
|
+
'-N', '',
|
|
174
136
|
'-C', comment,
|
|
175
137
|
]);
|
|
176
138
|
let stderr = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-manager.js","sourceRoot":"","sources":["../../src/delegator/credential-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIlC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAEzD
|
|
1
|
+
{"version":3,"file":"credential-manager.js","sourceRoot":"","sources":["../../src/delegator/credential-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIlC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAA0B;IAChC,iBAAiB,GAAG,IAAI,GAAG,EAA+B,CAAC;IAEnE,YAAY,MAA+B;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,kBAAkB,CACtB,YAAoB,EACpB,UAAkB;QAKlB,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,eAAe,CAAC;QACrD,MAAM,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,E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,GAAG,KAAK,CAAC,YAAY,EAAE;gBAC/B,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,OAAO;aACd,CAAC,CAAC;YAEH,IAAI,MAAM,GAAG,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBAC9B,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC5B,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBACxB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;oBACf,OAAO,EAAE,CAAC;gBACZ,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,KAAK,CAAC,sBAAsB,MAAM,EAAE,CAAC,CAAC,CAAC;gBACpD,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -8,50 +8,25 @@ export declare function buildSshfsArgs(params: MountParams, keyPath: string, cer
|
|
|
8
8
|
/**
|
|
9
9
|
* SSHFS Mount Client
|
|
10
10
|
*
|
|
11
|
-
* Handles mounting remote filesystems via SSHFS on the
|
|
11
|
+
* Handles mounting remote filesystems via SSHFS on the executor side.
|
|
12
12
|
*/
|
|
13
13
|
export declare class SshfsMountClient {
|
|
14
14
|
private config;
|
|
15
15
|
private activeMounts;
|
|
16
16
|
constructor(config?: SshfsMountConfig);
|
|
17
|
-
/**
|
|
18
|
-
* Get active mounts (for testing)
|
|
19
|
-
*/
|
|
20
17
|
getActiveMounts(): Map<string, ActiveMount>;
|
|
21
|
-
/**
|
|
22
|
-
* Check if sshfs is available
|
|
23
|
-
*/
|
|
24
18
|
checkDependency(): Promise<{
|
|
25
19
|
available: boolean;
|
|
26
20
|
version?: string;
|
|
27
21
|
error?: string;
|
|
28
22
|
}>;
|
|
29
|
-
/**
|
|
30
|
-
* Write credential files to disk
|
|
31
|
-
*/
|
|
32
23
|
writeCredentialFiles(tempKeyDir: string, credential: SshCredential): Promise<{
|
|
33
24
|
keyPath: string;
|
|
34
25
|
certPath: string;
|
|
35
26
|
}>;
|
|
36
|
-
/**
|
|
37
|
-
* Clean up credential files
|
|
38
|
-
*/
|
|
39
27
|
cleanupCredentialFiles(keyPath: string, certPath: string): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Mount a remote filesystem
|
|
42
|
-
*/
|
|
43
28
|
mount(params: MountParams): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Unmount a filesystem
|
|
46
|
-
*/
|
|
47
29
|
unmount(mountPoint: string): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Check if a mount point is currently mounted
|
|
50
|
-
*/
|
|
51
|
-
isMounted(mountPoint: string): Promise<boolean>;
|
|
52
|
-
/**
|
|
53
|
-
* Unmount all active mounts
|
|
54
|
-
*/
|
|
55
30
|
unmountAll(): Promise<void>;
|
|
56
31
|
private execMount;
|
|
57
32
|
private execCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sshfs-client.d.ts","sourceRoot":"","sources":["../../src/executor/sshfs-client.ts"],"names":[],"mappings":"AAGA,OAAO,EAA4C,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE9E,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAG5D;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,MAAM,EAAE,CA4BV;AAED;;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AAC,IAAI,CAAC;IA+BzC,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B1C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAMjC,OAAO,CAAC,SAAS;IAqDjB,OAAO,CAAC,WAAW;CAepB"}
|
|
@@ -35,7 +35,7 @@ export function buildSshfsArgs(params, keyPath, certPath, defaultOptions) {
|
|
|
35
35
|
/**
|
|
36
36
|
* SSHFS Mount Client
|
|
37
37
|
*
|
|
38
|
-
* Handles mounting remote filesystems via SSHFS on the
|
|
38
|
+
* Handles mounting remote filesystems via SSHFS on the executor side.
|
|
39
39
|
*/
|
|
40
40
|
export class SshfsMountClient {
|
|
41
41
|
config;
|
|
@@ -43,15 +43,9 @@ export class SshfsMountClient {
|
|
|
43
43
|
constructor(config) {
|
|
44
44
|
this.config = config ?? {};
|
|
45
45
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Get active mounts (for testing)
|
|
48
|
-
*/
|
|
49
46
|
getActiveMounts() {
|
|
50
47
|
return this.activeMounts;
|
|
51
48
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Check if sshfs is available
|
|
54
|
-
*/
|
|
55
49
|
async checkDependency() {
|
|
56
50
|
return new Promise((resolve) => {
|
|
57
51
|
const proc = spawn('sshfs', ['--version']);
|
|
@@ -85,9 +79,6 @@ export class SshfsMountClient {
|
|
|
85
79
|
});
|
|
86
80
|
});
|
|
87
81
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Write credential files to disk
|
|
90
|
-
*/
|
|
91
82
|
async writeCredentialFiles(tempKeyDir, credential) {
|
|
92
83
|
await mkdir(tempKeyDir, { recursive: true });
|
|
93
84
|
const keyPath = join(tempKeyDir, `mount-${Date.now()}`);
|
|
@@ -96,18 +87,11 @@ export class SshfsMountClient {
|
|
|
96
87
|
await writeFile(certPath, credential.certificate, { mode: 0o644 });
|
|
97
88
|
return { keyPath, certPath };
|
|
98
89
|
}
|
|
99
|
-
/**
|
|
100
|
-
* Clean up credential files
|
|
101
|
-
*/
|
|
102
90
|
async cleanupCredentialFiles(keyPath, certPath) {
|
|
103
91
|
await unlink(keyPath).catch(() => { });
|
|
104
92
|
await unlink(certPath).catch(() => { });
|
|
105
93
|
}
|
|
106
|
-
/**
|
|
107
|
-
* Mount a remote filesystem
|
|
108
|
-
*/
|
|
109
94
|
async mount(params) {
|
|
110
|
-
// Check dependency
|
|
111
95
|
const depCheck = await this.checkDependency();
|
|
112
96
|
if (!depCheck.available) {
|
|
113
97
|
throw new DependencyMissingError('sshfs', 'Install sshfs: brew install macfuse && brew install sshfs (macOS) or apt install sshfs (Linux)');
|
|
@@ -116,10 +100,8 @@ export class SshfsMountClient {
|
|
|
116
100
|
const { keyPath, certPath } = await this.writeCredentialFiles(tempKeyDir, params.credential);
|
|
117
101
|
try {
|
|
118
102
|
const args = buildSshfsArgs(params, keyPath, certPath, this.config.defaultOptions);
|
|
119
|
-
console.log(`[SSHFS] Mounting: sshfs ${args.join(' ')}`);
|
|
120
|
-
// Execute mount (SSHFS will daemonize and exit immediately on success)
|
|
103
|
+
console.log(`[AWCP:SSHFS] Mounting: sshfs ${args.join(' ')}`);
|
|
121
104
|
await this.execMount(args, params.mountPoint);
|
|
122
|
-
// Track active mount
|
|
123
105
|
this.activeMounts.set(params.mountPoint, {
|
|
124
106
|
mountPoint: params.mountPoint,
|
|
125
107
|
keyPath,
|
|
@@ -127,21 +109,16 @@ export class SshfsMountClient {
|
|
|
127
109
|
});
|
|
128
110
|
}
|
|
129
111
|
catch (error) {
|
|
130
|
-
// Cleanup key and cert on failure
|
|
131
112
|
await this.cleanupCredentialFiles(keyPath, certPath);
|
|
132
113
|
throw error;
|
|
133
114
|
}
|
|
134
115
|
}
|
|
135
|
-
/**
|
|
136
|
-
* Unmount a filesystem
|
|
137
|
-
*/
|
|
138
116
|
async unmount(mountPoint) {
|
|
139
117
|
const activeMount = this.activeMounts.get(mountPoint);
|
|
140
|
-
// Try different unmount methods
|
|
141
118
|
const unmountCommands = [
|
|
142
119
|
['umount', mountPoint],
|
|
143
120
|
['fusermount', '-u', mountPoint],
|
|
144
|
-
['diskutil', 'unmount', mountPoint],
|
|
121
|
+
['diskutil', 'unmount', mountPoint],
|
|
145
122
|
];
|
|
146
123
|
let success = false;
|
|
147
124
|
for (const cmd of unmountCommands) {
|
|
@@ -155,30 +132,13 @@ export class SshfsMountClient {
|
|
|
155
132
|
}
|
|
156
133
|
}
|
|
157
134
|
if (!success) {
|
|
158
|
-
console.warn(`Failed to unmount ${mountPoint}, may need manual cleanup`);
|
|
135
|
+
console.warn(`[AWCP:SSHFS] Failed to unmount ${mountPoint}, may need manual cleanup`);
|
|
159
136
|
}
|
|
160
|
-
// Cleanup key and certificate files
|
|
161
137
|
if (activeMount) {
|
|
162
138
|
await this.cleanupCredentialFiles(activeMount.keyPath, activeMount.certPath);
|
|
163
139
|
this.activeMounts.delete(mountPoint);
|
|
164
140
|
}
|
|
165
141
|
}
|
|
166
|
-
/**
|
|
167
|
-
* Check if a mount point is currently mounted
|
|
168
|
-
*/
|
|
169
|
-
async isMounted(mountPoint) {
|
|
170
|
-
try {
|
|
171
|
-
// Check if the mount point exists and is tracked
|
|
172
|
-
await stat(mountPoint);
|
|
173
|
-
return this.activeMounts.has(mountPoint);
|
|
174
|
-
}
|
|
175
|
-
catch {
|
|
176
|
-
return false;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Unmount all active mounts
|
|
181
|
-
*/
|
|
182
142
|
async unmountAll() {
|
|
183
143
|
for (const mountPoint of this.activeMounts.keys()) {
|
|
184
144
|
await this.unmount(mountPoint);
|
|
@@ -187,7 +147,6 @@ export class SshfsMountClient {
|
|
|
187
147
|
execMount(args, mountPoint) {
|
|
188
148
|
const timeout = this.config.mountTimeout ?? DEFAULT_MOUNT_TIMEOUT;
|
|
189
149
|
return new Promise((resolve, reject) => {
|
|
190
|
-
// SSHFS without -f will daemonize and exit immediately with code 0 on success
|
|
191
150
|
const proc = spawn('sshfs', args, {
|
|
192
151
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
193
152
|
});
|
|
@@ -197,12 +156,11 @@ export class SshfsMountClient {
|
|
|
197
156
|
});
|
|
198
157
|
const timer = setTimeout(async () => {
|
|
199
158
|
proc.kill();
|
|
200
|
-
// Clean up possible zombie mount
|
|
201
159
|
try {
|
|
202
160
|
await this.unmount(mountPoint);
|
|
203
161
|
}
|
|
204
162
|
catch {
|
|
205
|
-
//
|
|
163
|
+
// Mount may not exist
|
|
206
164
|
}
|
|
207
165
|
reject(new SetupFailedError(`Mount timeout after ${timeout}ms`));
|
|
208
166
|
}, timeout);
|
|
@@ -212,13 +170,11 @@ export class SshfsMountClient {
|
|
|
212
170
|
reject(new SetupFailedError(stderr || `sshfs exited with code ${code}`));
|
|
213
171
|
return;
|
|
214
172
|
}
|
|
215
|
-
//
|
|
216
|
-
// Now verify the mount is actually there
|
|
173
|
+
// Verify mount is actually there
|
|
217
174
|
try {
|
|
218
175
|
const mountStat = await stat(mountPoint);
|
|
219
176
|
const parentStat = await stat(join(mountPoint, '..'));
|
|
220
177
|
if (mountStat.dev !== parentStat.dev) {
|
|
221
|
-
// Different device = mounted successfully
|
|
222
178
|
resolve();
|
|
223
179
|
}
|
|
224
180
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sshfs-client.js","sourceRoot":"","sources":["../../src/executor/sshfs-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAsB,MAAM,YAAY,CAAC;AAG1F,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAC5D,MAAM,qBAA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AC;gBACpB,MAAM,CAAC,IAAI,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,WAAW,CAAC,GAAW,EAAE,IAAc;QAC7C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAE9B,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBACxB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;oBACf,OAAO,EAAE,CAAC;gBACZ,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,GAAG,qBAAqB,IAAI,EAAE,CAAC,CAAC,CAAC;gBACvD,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,5 @@
|
|
|
4
4
|
* SSHFS Transport implementation for AWCP data plane
|
|
5
5
|
*/
|
|
6
6
|
export { SshfsTransport } from './sshfs-transport.js';
|
|
7
|
-
export type { SshfsTransportConfig
|
|
8
|
-
export { CredentialManager } from './delegator/index.js';
|
|
9
|
-
export { SshfsMountClient, DEFAULT_TEMP_KEY_DIR, buildSshfsArgs } from './executor/index.js';
|
|
7
|
+
export type { SshfsTransportConfig } from './types.js';
|
|
10
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SSHFS Transport implementation for AWCP data plane
|
|
5
5
|
*/
|
|
6
|
-
// Main transport adapter
|
|
7
6
|
export { SshfsTransport } from './sshfs-transport.js';
|
|
8
|
-
// Lower-level components (for advanced use cases)
|
|
9
|
-
export { CredentialManager } from './delegator/index.js';
|
|
10
|
-
export { SshfsMountClient, DEFAULT_TEMP_KEY_DIR, buildSshfsArgs } from './executor/index.js';
|
|
11
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awcp/transport-sshfs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "AWCP SSHFS Transport - SSH/SFTP based data plane implementation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
-
"bin": {
|
|
9
|
-
"awcp-sshfs": "./bin/awcp-sshfs.js"
|
|
10
|
-
},
|
|
11
8
|
"exports": {
|
|
12
9
|
".": {
|
|
13
10
|
"types": "./dist/index.d.ts",
|
|
14
11
|
"import": "./dist/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./host": {
|
|
17
|
-
"types": "./dist/host/index.d.ts",
|
|
18
|
-
"import": "./dist/host/index.js"
|
|
19
|
-
},
|
|
20
|
-
"./remote": {
|
|
21
|
-
"types": "./dist/remote/index.d.ts",
|
|
22
|
-
"import": "./dist/remote/index.js"
|
|
23
12
|
}
|
|
24
13
|
},
|
|
25
14
|
"files": [
|
|
26
15
|
"dist",
|
|
27
|
-
"bin",
|
|
28
16
|
"README.md"
|
|
29
17
|
],
|
|
30
18
|
"scripts": {
|
|
@@ -34,7 +22,7 @@
|
|
|
34
22
|
"test:watch": "vitest"
|
|
35
23
|
},
|
|
36
24
|
"dependencies": {
|
|
37
|
-
"@awcp/core": "^0.0.
|
|
25
|
+
"@awcp/core": "^0.0.9"
|
|
38
26
|
},
|
|
39
27
|
"keywords": [
|
|
40
28
|
"awcp",
|