@awcp/transport-sshfs 0.0.0-dev-202601301521 → 0.0.1
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 +52 -15
- package/dist/delegator/credential-manager.d.ts.map +1 -1
- package/dist/delegator/credential-manager.js +106 -82
- package/dist/delegator/credential-manager.js.map +1 -1
- package/dist/delegator/index.d.ts +1 -1
- package/dist/delegator/index.d.ts.map +1 -1
- package/dist/delegator/index.js.map +1 -1
- package/dist/executor/index.d.ts +1 -1
- package/dist/executor/index.d.ts.map +1 -1
- package/dist/executor/index.js +1 -1
- package/dist/executor/index.js.map +1 -1
- package/dist/executor/sshfs-client.d.ts +23 -20
- package/dist/executor/sshfs-client.d.ts.map +1 -1
- package/dist/executor/sshfs-client.js +32 -60
- package/dist/executor/sshfs-client.js.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -6
- package/dist/cli/setup.d.ts +0 -13
- package/dist/cli/setup.d.ts.map +0 -1
- package/dist/cli/setup.js +0 -286
- package/dist/cli/setup.js.map +0 -1
- package/dist/sshfs-transport.d.ts +0 -24
- package/dist/sshfs-transport.d.ts.map +0 -1
- package/dist/sshfs-transport.js +0 -93
- package/dist/sshfs-transport.js.map +0 -1
- package/dist/types.d.ts +0 -114
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -5
- package/dist/types.js.map +0 -1
|
@@ -1,20 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* SSH Credential Manager configuration
|
|
3
|
+
*/
|
|
4
|
+
export interface CredentialManagerConfig {
|
|
5
|
+
/** Directory to store temporary keys (default: ~/.awcp/keys) */
|
|
6
|
+
keyDir?: string;
|
|
7
|
+
/** SSH server port (default: 22) */
|
|
8
|
+
sshPort?: number;
|
|
9
|
+
/** SSH server host (default: localhost) */
|
|
10
|
+
sshHost?: string;
|
|
11
|
+
/** SSH user for connections */
|
|
12
|
+
sshUser?: string;
|
|
13
|
+
/** Path to authorized_keys file (default: ~/.ssh/authorized_keys) */
|
|
14
|
+
authorizedKeysPath?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Generated credential
|
|
18
|
+
*/
|
|
19
|
+
export interface GeneratedCredential {
|
|
20
|
+
/** The private key content */
|
|
21
|
+
privateKey: string;
|
|
22
|
+
/** The public key content */
|
|
23
|
+
publicKey: string;
|
|
24
|
+
/** Path to the private key file */
|
|
25
|
+
privateKeyPath: string;
|
|
26
|
+
/** Path to the public key file */
|
|
27
|
+
publicKeyPath: string;
|
|
28
|
+
/** Delegation ID for tracking */
|
|
29
|
+
delegationId: string;
|
|
30
|
+
}
|
|
3
31
|
/**
|
|
4
32
|
* SSH Credential Manager
|
|
5
33
|
*
|
|
6
|
-
* Manages temporary SSH
|
|
7
|
-
*
|
|
34
|
+
* Manages temporary SSH keys for AWCP delegations.
|
|
35
|
+
*
|
|
36
|
+
* TODO [Security]: Consider SSH certificates with built-in expiry for production.
|
|
8
37
|
*/
|
|
9
38
|
export declare class CredentialManager {
|
|
10
39
|
private config;
|
|
11
40
|
private activeCredentials;
|
|
12
|
-
constructor(config
|
|
41
|
+
constructor(config?: CredentialManagerConfig);
|
|
13
42
|
/**
|
|
14
|
-
*
|
|
43
|
+
* Get the path to authorized_keys file
|
|
15
44
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
45
|
+
private getAuthorizedKeysPath;
|
|
46
|
+
/**
|
|
47
|
+
* Generate a temporary SSH key pair for a delegation
|
|
48
|
+
*/
|
|
49
|
+
generateCredential(delegationId: string, _ttlSeconds: number): Promise<{
|
|
50
|
+
credential: string;
|
|
18
51
|
endpoint: {
|
|
19
52
|
host: string;
|
|
20
53
|
port: number;
|
|
@@ -22,11 +55,7 @@ export declare class CredentialManager {
|
|
|
22
55
|
};
|
|
23
56
|
}>;
|
|
24
57
|
/**
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
private ensureCaKey;
|
|
28
|
-
/**
|
|
29
|
-
* Revoke a credential (delete key files, certificate expires automatically)
|
|
58
|
+
* Revoke a credential
|
|
30
59
|
*/
|
|
31
60
|
revokeCredential(delegationId: string): Promise<void>;
|
|
32
61
|
/**
|
|
@@ -37,14 +66,22 @@ export declare class CredentialManager {
|
|
|
37
66
|
* Revoke all credentials
|
|
38
67
|
*/
|
|
39
68
|
revokeAll(): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Clean up stale AWCP keys from authorized_keys (call on startup)
|
|
71
|
+
*/
|
|
72
|
+
cleanupStaleKeys(): Promise<number>;
|
|
40
73
|
/**
|
|
41
74
|
* Clean up stale key files from key directory (call on startup)
|
|
42
75
|
*/
|
|
43
76
|
cleanupStaleKeyFiles(): Promise<number>;
|
|
44
77
|
/**
|
|
45
|
-
*
|
|
78
|
+
* Add a public key to authorized_keys
|
|
79
|
+
*/
|
|
80
|
+
private addToAuthorizedKeys;
|
|
81
|
+
/**
|
|
82
|
+
* Remove a public key from authorized_keys by delegation ID
|
|
46
83
|
*/
|
|
47
|
-
private
|
|
84
|
+
private removeFromAuthorizedKeys;
|
|
48
85
|
/**
|
|
49
86
|
* Execute ssh-keygen to generate a key pair
|
|
50
87
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-manager.d.ts","sourceRoot":"","sources":["../../src/delegator/credential-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credential-manager.d.ts","sourceRoot":"","sources":["../../src/delegator/credential-manager.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B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tB"}
|
|
@@ -1,51 +1,57 @@
|
|
|
1
|
-
import { unlink, mkdir, readFile,
|
|
1
|
+
import { unlink, mkdir, readFile, writeFile, appendFile, readdir } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { spawn } from 'node:child_process';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
5
|
const DEFAULT_KEY_DIR = join(homedir(), '.awcp', 'keys');
|
|
6
|
+
/**
|
|
7
|
+
* Marker prefix for AWCP-managed keys in authorized_keys
|
|
8
|
+
*/
|
|
9
|
+
const AWCP_KEY_COMMENT_PREFIX = 'awcp-temp-key-';
|
|
6
10
|
/**
|
|
7
11
|
* SSH Credential Manager
|
|
8
12
|
*
|
|
9
|
-
* Manages temporary SSH
|
|
10
|
-
*
|
|
13
|
+
* Manages temporary SSH keys for AWCP delegations.
|
|
14
|
+
*
|
|
15
|
+
* TODO [Security]: Consider SSH certificates with built-in expiry for production.
|
|
11
16
|
*/
|
|
12
17
|
export class CredentialManager {
|
|
13
18
|
config;
|
|
14
19
|
activeCredentials = new Map();
|
|
15
20
|
constructor(config) {
|
|
16
|
-
this.config = config;
|
|
21
|
+
this.config = config ?? {};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get the path to authorized_keys file
|
|
25
|
+
*/
|
|
26
|
+
getAuthorizedKeysPath() {
|
|
27
|
+
return this.config.authorizedKeysPath ?? join(homedir(), '.ssh', 'authorized_keys');
|
|
17
28
|
}
|
|
18
29
|
/**
|
|
19
|
-
* Generate a temporary SSH key pair
|
|
30
|
+
* Generate a temporary SSH key pair for a delegation
|
|
20
31
|
*/
|
|
21
|
-
async generateCredential(delegationId,
|
|
22
|
-
// Ensure CA key exists (auto-generate if needed)
|
|
23
|
-
await this.ensureCaKey();
|
|
32
|
+
async generateCredential(delegationId, _ttlSeconds) {
|
|
24
33
|
const keyDir = this.config.keyDir ?? DEFAULT_KEY_DIR;
|
|
25
34
|
await mkdir(keyDir, { recursive: true, mode: 0o700 });
|
|
26
|
-
const privateKeyPath = join(keyDir, delegationId);
|
|
35
|
+
const privateKeyPath = join(keyDir, `${delegationId}`);
|
|
27
36
|
const publicKeyPath = join(keyDir, `${delegationId}.pub`);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
await this.execSshKeygen(privateKeyPath,
|
|
31
|
-
//
|
|
32
|
-
await this.signCertificate(publicKeyPath, ttlSeconds, delegationId);
|
|
33
|
-
// Read the private key and certificate
|
|
37
|
+
// Generate key pair using ssh-keygen with AWCP marker comment
|
|
38
|
+
const keyComment = `${AWCP_KEY_COMMENT_PREFIX}${delegationId}`;
|
|
39
|
+
await this.execSshKeygen(privateKeyPath, keyComment);
|
|
40
|
+
// Read the generated keys
|
|
34
41
|
const privateKey = await readFile(privateKeyPath, 'utf-8');
|
|
35
|
-
const
|
|
36
|
-
const
|
|
42
|
+
const publicKey = await readFile(publicKeyPath, 'utf-8');
|
|
43
|
+
const credential = {
|
|
37
44
|
privateKey,
|
|
45
|
+
publicKey,
|
|
38
46
|
privateKeyPath,
|
|
39
47
|
publicKeyPath,
|
|
40
|
-
certPath,
|
|
41
48
|
delegationId,
|
|
42
49
|
};
|
|
43
|
-
this.activeCredentials.set(delegationId,
|
|
50
|
+
this.activeCredentials.set(delegationId, credential);
|
|
51
|
+
// Add public key to authorized_keys
|
|
52
|
+
await this.addToAuthorizedKeys(publicKey);
|
|
44
53
|
return {
|
|
45
|
-
credential:
|
|
46
|
-
privateKey,
|
|
47
|
-
certificate,
|
|
48
|
-
},
|
|
54
|
+
credential: privateKey,
|
|
49
55
|
endpoint: {
|
|
50
56
|
host: this.config.sshHost ?? 'localhost',
|
|
51
57
|
port: this.config.sshPort ?? 22,
|
|
@@ -54,42 +60,28 @@ export class CredentialManager {
|
|
|
54
60
|
};
|
|
55
61
|
}
|
|
56
62
|
/**
|
|
57
|
-
*
|
|
58
|
-
*/
|
|
59
|
-
async ensureCaKey() {
|
|
60
|
-
try {
|
|
61
|
-
await access(this.config.caKeyPath, constants.R_OK);
|
|
62
|
-
return; // CA key exists
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
// CA key doesn't exist, generate it
|
|
66
|
-
}
|
|
67
|
-
console.log(`[CredentialManager] CA key not found at ${this.config.caKeyPath}, generating...`);
|
|
68
|
-
const caDir = join(this.config.caKeyPath, '..');
|
|
69
|
-
await mkdir(caDir, { recursive: true, mode: 0o700 });
|
|
70
|
-
await this.execSshKeygen(this.config.caKeyPath, 'awcp-ca');
|
|
71
|
-
console.log(`[CredentialManager] CA key pair generated at ${this.config.caKeyPath}`);
|
|
72
|
-
console.log('');
|
|
73
|
-
console.log(' ⚠️ To enable SSH certificate authentication, add to /etc/ssh/sshd_config:');
|
|
74
|
-
console.log(` TrustedUserCAKeys ${this.config.caKeyPath}.pub`);
|
|
75
|
-
console.log('');
|
|
76
|
-
console.log(' Then restart sshd:');
|
|
77
|
-
console.log(' macOS: sudo launchctl stop com.openssh.sshd');
|
|
78
|
-
console.log(' Linux: sudo systemctl restart sshd');
|
|
79
|
-
console.log('');
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Revoke a credential (delete key files, certificate expires automatically)
|
|
63
|
+
* Revoke a credential
|
|
83
64
|
*/
|
|
84
65
|
async revokeCredential(delegationId) {
|
|
85
66
|
const credential = this.activeCredentials.get(delegationId);
|
|
86
67
|
if (!credential) {
|
|
87
68
|
return;
|
|
88
69
|
}
|
|
89
|
-
//
|
|
90
|
-
await
|
|
91
|
-
|
|
92
|
-
|
|
70
|
+
// Remove from authorized_keys first
|
|
71
|
+
await this.removeFromAuthorizedKeys(delegationId);
|
|
72
|
+
// Remove key files
|
|
73
|
+
try {
|
|
74
|
+
await unlink(credential.privateKeyPath);
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Ignore errors if file doesn't exist
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
await unlink(credential.publicKeyPath);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// Ignore errors if file doesn't exist
|
|
84
|
+
}
|
|
93
85
|
this.activeCredentials.delete(delegationId);
|
|
94
86
|
}
|
|
95
87
|
/**
|
|
@@ -106,6 +98,30 @@ export class CredentialManager {
|
|
|
106
98
|
await this.revokeCredential(delegationId);
|
|
107
99
|
}
|
|
108
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Clean up stale AWCP keys from authorized_keys (call on startup)
|
|
103
|
+
*/
|
|
104
|
+
async cleanupStaleKeys() {
|
|
105
|
+
const authorizedKeysPath = this.getAuthorizedKeysPath();
|
|
106
|
+
try {
|
|
107
|
+
const content = await readFile(authorizedKeysPath, 'utf-8');
|
|
108
|
+
const lines = content.split('\n');
|
|
109
|
+
const cleanedLines = lines.filter(line => {
|
|
110
|
+
// Keep lines that don't have AWCP marker
|
|
111
|
+
return !line.includes(AWCP_KEY_COMMENT_PREFIX);
|
|
112
|
+
});
|
|
113
|
+
const removedCount = lines.length - cleanedLines.length;
|
|
114
|
+
if (removedCount > 0) {
|
|
115
|
+
await writeFile(authorizedKeysPath, cleanedLines.join('\n'));
|
|
116
|
+
console.log(`[CredentialManager] Cleaned up ${removedCount} stale AWCP keys from authorized_keys`);
|
|
117
|
+
}
|
|
118
|
+
return removedCount;
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
// File doesn't exist or can't be read, nothing to clean
|
|
122
|
+
return 0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
109
125
|
/**
|
|
110
126
|
* Clean up stale key files from key directory (call on startup)
|
|
111
127
|
*/
|
|
@@ -115,14 +131,19 @@ export class CredentialManager {
|
|
|
115
131
|
const files = await readdir(keyDir);
|
|
116
132
|
let removedCount = 0;
|
|
117
133
|
for (const file of files) {
|
|
118
|
-
//
|
|
119
|
-
const delegationId = file.replace(
|
|
134
|
+
// Skip files that are currently active
|
|
135
|
+
const delegationId = file.replace(/\.pub$/, '');
|
|
120
136
|
if (this.activeCredentials.has(delegationId)) {
|
|
121
137
|
continue;
|
|
122
138
|
}
|
|
123
139
|
// Remove stale key files
|
|
124
|
-
|
|
125
|
-
|
|
140
|
+
try {
|
|
141
|
+
await unlink(join(keyDir, file));
|
|
142
|
+
removedCount++;
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
// Ignore errors
|
|
146
|
+
}
|
|
126
147
|
}
|
|
127
148
|
if (removedCount > 0) {
|
|
128
149
|
console.log(`[CredentialManager] Cleaned up ${removedCount} stale key files`);
|
|
@@ -135,32 +156,35 @@ export class CredentialManager {
|
|
|
135
156
|
}
|
|
136
157
|
}
|
|
137
158
|
/**
|
|
138
|
-
*
|
|
159
|
+
* Add a public key to authorized_keys
|
|
139
160
|
*/
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
161
|
+
async addToAuthorizedKeys(publicKey) {
|
|
162
|
+
const authorizedKeysPath = this.getAuthorizedKeysPath();
|
|
163
|
+
// Ensure .ssh directory exists
|
|
164
|
+
const sshDir = join(homedir(), '.ssh');
|
|
165
|
+
await mkdir(sshDir, { recursive: true, mode: 0o700 });
|
|
166
|
+
// Ensure the key ends with newline
|
|
167
|
+
const keyLine = publicKey.trim() + '\n';
|
|
168
|
+
// Append to authorized_keys
|
|
169
|
+
await appendFile(authorizedKeysPath, keyLine, { mode: 0o600 });
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Remove a public key from authorized_keys by delegation ID
|
|
173
|
+
*/
|
|
174
|
+
async removeFromAuthorizedKeys(delegationId) {
|
|
175
|
+
const authorizedKeysPath = this.getAuthorizedKeysPath();
|
|
176
|
+
const keyMarker = `${AWCP_KEY_COMMENT_PREFIX}${delegationId}`;
|
|
177
|
+
try {
|
|
178
|
+
const content = await readFile(authorizedKeysPath, 'utf-8');
|
|
179
|
+
const lines = content.split('\n');
|
|
180
|
+
// Filter out lines containing this delegation's key marker
|
|
181
|
+
const filteredLines = lines.filter(line => !line.includes(keyMarker));
|
|
182
|
+
// Write back
|
|
183
|
+
await writeFile(authorizedKeysPath, filteredLines.join('\n'), { mode: 0o600 });
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
// File doesn't exist or can't be read, nothing to remove
|
|
187
|
+
}
|
|
164
188
|
}
|
|
165
189
|
/**
|
|
166
190
|
* Execute ssh-keygen to generate a key pair
|
|
@@ -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,
|
|
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,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAkClC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAA0B;IAChC,iBAAiB,GAAG,IAAI,GAAG,EAA+B,CAAC;IAEnE,YAAY,MAAgC;QAC1C,IAAI,CA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@@
|
|
|
1
|
-
export { CredentialManager } from './credential-manager.js';
|
|
1
|
+
export { CredentialManager, type CredentialManagerConfig, type GeneratedCredential } from './credential-manager.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/delegator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/delegator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/delegator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/delegator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA0D,MAAM,yBAAyB,CAAC"}
|
package/dist/executor/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SshfsMountClient,
|
|
1
|
+
export { SshfsMountClient, type SshfsMountConfig, type MountParams } from './sshfs-client.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/executor/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SshfsMountClient
|
|
1
|
+
export { SshfsMountClient } from './sshfs-client.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA2C,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
import { type SshCredential } from '@awcp/core';
|
|
2
|
-
import type { SshfsMountConfig, MountParams, ActiveMount } from '../types.js';
|
|
3
|
-
export declare const DEFAULT_TEMP_KEY_DIR = "/tmp/awcp/client-keys";
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
2
|
+
* SSHFS Mount Client configuration
|
|
6
3
|
*/
|
|
7
|
-
export
|
|
4
|
+
export interface SshfsMountConfig {
|
|
5
|
+
/** Directory to store temporary key files */
|
|
6
|
+
tempKeyDir?: string;
|
|
7
|
+
/** Additional sshfs options */
|
|
8
|
+
defaultOptions?: Record<string, string>;
|
|
9
|
+
/** Timeout for mount operation in ms (default: 30000) */
|
|
10
|
+
mountTimeout?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Mount parameters
|
|
14
|
+
*/
|
|
15
|
+
export interface MountParams {
|
|
16
|
+
endpoint: {
|
|
17
|
+
host: string;
|
|
18
|
+
port: number;
|
|
19
|
+
user: string;
|
|
20
|
+
};
|
|
21
|
+
exportLocator: string;
|
|
22
|
+
credential: string;
|
|
23
|
+
mountPoint: string;
|
|
24
|
+
options?: Record<string, string>;
|
|
25
|
+
}
|
|
8
26
|
/**
|
|
9
27
|
* SSHFS Mount Client
|
|
10
28
|
*
|
|
@@ -14,10 +32,6 @@ export declare class SshfsMountClient {
|
|
|
14
32
|
private config;
|
|
15
33
|
private activeMounts;
|
|
16
34
|
constructor(config?: SshfsMountConfig);
|
|
17
|
-
/**
|
|
18
|
-
* Get active mounts (for testing)
|
|
19
|
-
*/
|
|
20
|
-
getActiveMounts(): Map<string, ActiveMount>;
|
|
21
35
|
/**
|
|
22
36
|
* Check if sshfs is available
|
|
23
37
|
*/
|
|
@@ -26,17 +40,6 @@ export declare class SshfsMountClient {
|
|
|
26
40
|
version?: string;
|
|
27
41
|
error?: string;
|
|
28
42
|
}>;
|
|
29
|
-
/**
|
|
30
|
-
* Write credential files to disk
|
|
31
|
-
*/
|
|
32
|
-
writeCredentialFiles(tempKeyDir: string, credential: SshCredential): Promise<{
|
|
33
|
-
keyPath: string;
|
|
34
|
-
certPath: string;
|
|
35
|
-
}>;
|
|
36
|
-
/**
|
|
37
|
-
* Clean up credential files
|
|
38
|
-
*/
|
|
39
|
-
cleanupCredentialFiles(keyPath: string, certPath: string): Promise<void>;
|
|
40
43
|
/**
|
|
41
44
|
* Mount a remote filesystem
|
|
42
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sshfs-client.d.ts","sourceRoot":"","sources":["../../src/executor/sshfs-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sshfs-client.d.ts","sourceRoot":"","sources":["../../src/executor/sshfs-client.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CA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