aquaman-proxy 0.15.0 → 0.17.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 +12 -1
- package/dist/cli/index.js +341 -18
- package/dist/cli/index.js.map +1 -1
- package/dist/core/credentials/backends/keeper.d.ts +69 -0
- package/dist/core/credentials/backends/keeper.d.ts.map +1 -0
- package/dist/core/credentials/backends/keeper.js +189 -0
- package/dist/core/credentials/backends/keeper.js.map +1 -0
- package/dist/core/credentials/store.d.ts +2 -0
- package/dist/core/credentials/store.d.ts.map +1 -1
- package/dist/core/credentials/store.js +7 -0
- package/dist/core/credentials/store.js.map +1 -1
- package/dist/core/redactor/index.d.ts.map +1 -1
- package/dist/core/redactor/index.js +10 -0
- package/dist/core/redactor/index.js.map +1 -1
- package/dist/core/types.d.ts +15 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/utils/config.d.ts +2 -1
- package/dist/core/utils/config.d.ts.map +1 -1
- package/dist/core/utils/config.js +19 -4
- package/dist/core/utils/config.js.map +1 -1
- package/dist/openshell/credential-driver.d.ts +117 -0
- package/dist/openshell/credential-driver.d.ts.map +1 -0
- package/dist/openshell/credential-driver.js +181 -0
- package/dist/openshell/credential-driver.js.map +1 -0
- package/dist/openshell/grpc-server.d.ts +23 -0
- package/dist/openshell/grpc-server.d.ts.map +1 -0
- package/dist/openshell/grpc-server.js +122 -0
- package/dist/openshell/grpc-server.js.map +1 -0
- package/dist/openshell/integration.d.ts +37 -0
- package/dist/openshell/integration.d.ts.map +1 -0
- package/dist/openshell/integration.js +69 -0
- package/dist/openshell/integration.js.map +1 -0
- package/package.json +13 -4
- package/proto/openshell/README.md +9 -0
- package/proto/openshell/credential_driver.proto +146 -0
- package/proto/openshell/datamodel.proto +128 -0
- package/proto/openshell/extension.proto +34 -0
- package/proto/openshell/options.proto +36 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenShell external credential driver (v0.17.0): the transport-free core.
|
|
3
|
+
*
|
|
4
|
+
* NVIDIA OpenShell keeps provider credentials behind opaque handles owned by a
|
|
5
|
+
* credential driver (`credential_driver.proto`, extension protocol 1.0). The
|
|
6
|
+
* gateway calls Store when a provider is created, Resolve when a sandbox
|
|
7
|
+
* starts, and Delete when a provider is removed. Its supervisor injects the
|
|
8
|
+
* resolved value at egress while the sandbox sees only a placeholder, so
|
|
9
|
+
* OpenShell does the isolation; aquaman supplies the value from the user's
|
|
10
|
+
* vault, scopes it and audits it.
|
|
11
|
+
*
|
|
12
|
+
* Two modes, chosen by the value the gateway submits:
|
|
13
|
+
* - reference: the value is an `aquaman://service/key` ref
|
|
14
|
+
* (`openshell provider create --credential KEY=aquaman://svc/key`). It must
|
|
15
|
+
* be declared (same scope as the broker) and present in the vault. Nothing
|
|
16
|
+
* is stored; the ref itself is the handle. Delete is a no-op, so removing a
|
|
17
|
+
* provider never deletes the user's own vault item.
|
|
18
|
+
* - copy: any other value is written to the vault under the gateway-owned
|
|
19
|
+
* `openshell` service, keyed by OpenShell's object id and credential key.
|
|
20
|
+
*
|
|
21
|
+
* The meaning of a handle comes from its namespace, never from the metadata
|
|
22
|
+
* the gateway echoes back: `aquaman://openshell/...` is a gateway-owned copy,
|
|
23
|
+
* anything else is a reference and is re-checked against the scope on every
|
|
24
|
+
* Resolve (a revoked declaration stops resolving). Otherwise a caller could
|
|
25
|
+
* label `aquaman://github/token` as a copy to skip the scope.
|
|
26
|
+
*
|
|
27
|
+
* Verified against OpenShell 0.1.2 (2026-10-02): the gateway authenticates
|
|
28
|
+
* nothing on the socket (only a user-agent header), so the socket's 0600 mode
|
|
29
|
+
* is the boundary; it does not validate the submitted value's format; it
|
|
30
|
+
* resolves about once per sandbox start, not per request; it never calls
|
|
31
|
+
* ListCredentials.
|
|
32
|
+
*/
|
|
33
|
+
import type { CredentialStore } from '../core/credentials/store.js';
|
|
34
|
+
import { type BrokerScope } from '../broker-scope.js';
|
|
35
|
+
export declare const OPENSHELL_PROTOCOL: {
|
|
36
|
+
readonly major: 1;
|
|
37
|
+
readonly minor: 0;
|
|
38
|
+
};
|
|
39
|
+
export declare const CREDENTIALS_CONTRACT = "openshell.credentials.contract";
|
|
40
|
+
/** Vault service that holds gateway-submitted copies. */
|
|
41
|
+
export declare const COPY_SERVICE = "openshell";
|
|
42
|
+
export declare const DRIVER_NAME = "aquaman";
|
|
43
|
+
export type DriverErrorCode = 'invalid_argument' | 'not_found' | 'failed_precondition' | 'internal';
|
|
44
|
+
/** A refusal or failure carried back to the gateway (mapped to a gRPC status by the transport). */
|
|
45
|
+
export declare class DriverError extends Error {
|
|
46
|
+
readonly code: DriverErrorCode;
|
|
47
|
+
constructor(code: DriverErrorCode, message: string);
|
|
48
|
+
}
|
|
49
|
+
export interface PeerMetadata {
|
|
50
|
+
protocol_version?: {
|
|
51
|
+
major?: number;
|
|
52
|
+
minor?: number;
|
|
53
|
+
};
|
|
54
|
+
implementation_name?: string;
|
|
55
|
+
implementation_version?: string;
|
|
56
|
+
supported_capabilities?: string[];
|
|
57
|
+
required_capabilities?: string[];
|
|
58
|
+
}
|
|
59
|
+
export interface CredentialHandle {
|
|
60
|
+
driver?: string;
|
|
61
|
+
handle?: string;
|
|
62
|
+
metadata?: Record<string, string>;
|
|
63
|
+
}
|
|
64
|
+
export interface StoreRequest {
|
|
65
|
+
provider?: string;
|
|
66
|
+
credential_key?: string;
|
|
67
|
+
value?: string;
|
|
68
|
+
workspace?: string;
|
|
69
|
+
provider_id?: string;
|
|
70
|
+
object_id?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface ResolveRequest {
|
|
73
|
+
request_id?: string;
|
|
74
|
+
provider?: string;
|
|
75
|
+
credential_key?: string;
|
|
76
|
+
handle?: CredentialHandle | null;
|
|
77
|
+
}
|
|
78
|
+
export interface DeleteRequest {
|
|
79
|
+
provider?: string;
|
|
80
|
+
credential_key?: string;
|
|
81
|
+
handle?: CredentialHandle | null;
|
|
82
|
+
}
|
|
83
|
+
/** One driver operation, for the audit log. Never carries a credential value. */
|
|
84
|
+
export interface DriverAccessEvent {
|
|
85
|
+
op: 'store' | 'resolve' | 'delete';
|
|
86
|
+
mode: 'reference' | 'copy';
|
|
87
|
+
ref: string;
|
|
88
|
+
service: string;
|
|
89
|
+
provider: string;
|
|
90
|
+
success: boolean;
|
|
91
|
+
error?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface OpenShellDriverOptions {
|
|
94
|
+
store: CredentialStore;
|
|
95
|
+
/** Declared-ref scope shared with the broker. Absent means the broker is off: references are refused. */
|
|
96
|
+
scope?: BrokerScope;
|
|
97
|
+
version: string;
|
|
98
|
+
onAccess?: (event: DriverAccessEvent) => void;
|
|
99
|
+
}
|
|
100
|
+
export interface OpenShellDriverCore {
|
|
101
|
+
getCapabilities(gateway: PeerMetadata | null | undefined): Record<string, unknown>;
|
|
102
|
+
store(req: StoreRequest): Promise<{
|
|
103
|
+
handle: CredentialHandle;
|
|
104
|
+
}>;
|
|
105
|
+
resolve(reqs: ResolveRequest[]): Promise<{
|
|
106
|
+
request_id: string;
|
|
107
|
+
value: string;
|
|
108
|
+
}[]>;
|
|
109
|
+
delete(req: DeleteRequest): Promise<void>;
|
|
110
|
+
list(): {
|
|
111
|
+
handle: string;
|
|
112
|
+
keys: string[];
|
|
113
|
+
metadata: Record<string, string>;
|
|
114
|
+
}[];
|
|
115
|
+
}
|
|
116
|
+
export declare function createOpenShellDriverCore(opts: OpenShellDriverOptions): OpenShellDriverCore;
|
|
117
|
+
//# sourceMappingURL=credential-driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-driver.d.ts","sourceRoot":"","sources":["../../src/openshell/credential-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAA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,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,EAAE,CAAC;CAChF;AAUD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,sBAAsB,GAAG,mBAAmB,CA4H3F"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenShell external credential driver (v0.17.0): the transport-free core.
|
|
3
|
+
*
|
|
4
|
+
* NVIDIA OpenShell keeps provider credentials behind opaque handles owned by a
|
|
5
|
+
* credential driver (`credential_driver.proto`, extension protocol 1.0). The
|
|
6
|
+
* gateway calls Store when a provider is created, Resolve when a sandbox
|
|
7
|
+
* starts, and Delete when a provider is removed. Its supervisor injects the
|
|
8
|
+
* resolved value at egress while the sandbox sees only a placeholder, so
|
|
9
|
+
* OpenShell does the isolation; aquaman supplies the value from the user's
|
|
10
|
+
* vault, scopes it and audits it.
|
|
11
|
+
*
|
|
12
|
+
* Two modes, chosen by the value the gateway submits:
|
|
13
|
+
* - reference: the value is an `aquaman://service/key` ref
|
|
14
|
+
* (`openshell provider create --credential KEY=aquaman://svc/key`). It must
|
|
15
|
+
* be declared (same scope as the broker) and present in the vault. Nothing
|
|
16
|
+
* is stored; the ref itself is the handle. Delete is a no-op, so removing a
|
|
17
|
+
* provider never deletes the user's own vault item.
|
|
18
|
+
* - copy: any other value is written to the vault under the gateway-owned
|
|
19
|
+
* `openshell` service, keyed by OpenShell's object id and credential key.
|
|
20
|
+
*
|
|
21
|
+
* The meaning of a handle comes from its namespace, never from the metadata
|
|
22
|
+
* the gateway echoes back: `aquaman://openshell/...` is a gateway-owned copy,
|
|
23
|
+
* anything else is a reference and is re-checked against the scope on every
|
|
24
|
+
* Resolve (a revoked declaration stops resolving). Otherwise a caller could
|
|
25
|
+
* label `aquaman://github/token` as a copy to skip the scope.
|
|
26
|
+
*
|
|
27
|
+
* Verified against OpenShell 0.1.2 (2026-10-02): the gateway authenticates
|
|
28
|
+
* nothing on the socket (only a user-agent header), so the socket's 0600 mode
|
|
29
|
+
* is the boundary; it does not validate the submitted value's format; it
|
|
30
|
+
* resolves about once per sandbox start, not per request; it never calls
|
|
31
|
+
* ListCredentials.
|
|
32
|
+
*/
|
|
33
|
+
import { formatAquamanRef, parseAquamanRef } from '../broker-scope.js';
|
|
34
|
+
export const OPENSHELL_PROTOCOL = { major: 1, minor: 0 };
|
|
35
|
+
export const CREDENTIALS_CONTRACT = 'openshell.credentials.contract';
|
|
36
|
+
/** Vault service that holds gateway-submitted copies. */
|
|
37
|
+
export const COPY_SERVICE = 'openshell';
|
|
38
|
+
export const DRIVER_NAME = 'aquaman';
|
|
39
|
+
const SAFE_KEY = /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/;
|
|
40
|
+
/** A refusal or failure carried back to the gateway (mapped to a gRPC status by the transport). */
|
|
41
|
+
export class DriverError extends Error {
|
|
42
|
+
code;
|
|
43
|
+
constructor(code, message) {
|
|
44
|
+
super(message);
|
|
45
|
+
this.code = code;
|
|
46
|
+
this.name = 'DriverError';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function parseHandle(handle) {
|
|
50
|
+
const parsed = parseAquamanRef(handle);
|
|
51
|
+
if (!parsed)
|
|
52
|
+
return null;
|
|
53
|
+
return { mode: parsed.service === COPY_SERVICE ? 'copy' : 'reference', ...parsed, ref: handle };
|
|
54
|
+
}
|
|
55
|
+
export function createOpenShellDriverCore(opts) {
|
|
56
|
+
const { store, scope, onAccess } = opts;
|
|
57
|
+
const emit = (e) => {
|
|
58
|
+
try {
|
|
59
|
+
onAccess?.(e);
|
|
60
|
+
}
|
|
61
|
+
catch { /* auditing must not break the driver */ }
|
|
62
|
+
};
|
|
63
|
+
const checkScope = (service, key) => {
|
|
64
|
+
if (!scope) {
|
|
65
|
+
throw new DriverError('failed_precondition', `aquaman: the broker is disabled (broker.enabled: false), so ${formatAquamanRef(service, key)} cannot be resolved. Fix: enable the broker in ~/.aquaman/config.yaml`);
|
|
66
|
+
}
|
|
67
|
+
const decision = scope.check(service, key, 'uds');
|
|
68
|
+
if (!decision.allowed) {
|
|
69
|
+
throw new DriverError('failed_precondition', `aquaman: ${decision.reason}. Fix: aquaman broker allow ${formatAquamanRef(service, key)}`);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
getCapabilities(gateway) {
|
|
74
|
+
const major = gateway?.protocol_version?.major;
|
|
75
|
+
if (major !== undefined && major !== OPENSHELL_PROTOCOL.major) {
|
|
76
|
+
throw new DriverError('failed_precondition', `aquaman: gateway speaks credential driver protocol ${major}.x, aquaman supports ${OPENSHELL_PROTOCOL.major}.${OPENSHELL_PROTOCOL.minor}`);
|
|
77
|
+
}
|
|
78
|
+
const missing = (gateway?.required_capabilities ?? []).filter((c) => c !== CREDENTIALS_CONTRACT);
|
|
79
|
+
if (missing.length > 0) {
|
|
80
|
+
throw new DriverError('failed_precondition', `aquaman: gateway requires unsupported capabilities: ${missing.join(', ')}`);
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
driver_name: DRIVER_NAME,
|
|
84
|
+
driver_version: opts.version,
|
|
85
|
+
backend_kind: DRIVER_NAME,
|
|
86
|
+
supports_list: true,
|
|
87
|
+
supports_expires_at: false,
|
|
88
|
+
extension: {
|
|
89
|
+
protocol_version: { ...OPENSHELL_PROTOCOL },
|
|
90
|
+
implementation_name: 'aquaman/openshell',
|
|
91
|
+
implementation_version: opts.version,
|
|
92
|
+
supported_capabilities: [CREDENTIALS_CONTRACT],
|
|
93
|
+
required_capabilities: [CREDENTIALS_CONTRACT],
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
async store(req) {
|
|
98
|
+
const provider = req.provider ?? '';
|
|
99
|
+
const value = req.value ?? '';
|
|
100
|
+
if (!value)
|
|
101
|
+
throw new DriverError('invalid_argument', 'aquaman: empty credential value');
|
|
102
|
+
if (value.startsWith('aquaman://')) {
|
|
103
|
+
const parsed = parseAquamanRef(value);
|
|
104
|
+
if (!parsed || parsed.service === COPY_SERVICE) {
|
|
105
|
+
throw new DriverError('invalid_argument', `aquaman: ${value} is not a valid aquaman://service/key reference`);
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
checkScope(parsed.service, parsed.key);
|
|
109
|
+
if (!(await store.exists(parsed.service, parsed.key))) {
|
|
110
|
+
throw new DriverError('not_found', `aquaman: ${value} is not in the vault. Fix: aquaman credentials add ${parsed.service} ${parsed.key}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
emit({ op: 'store', mode: 'reference', ref: value, service: parsed.service, provider, success: false, error: err.message });
|
|
115
|
+
throw err;
|
|
116
|
+
}
|
|
117
|
+
emit({ op: 'store', mode: 'reference', ref: value, service: parsed.service, provider, success: true });
|
|
118
|
+
return { handle: { driver: DRIVER_NAME, handle: value, metadata: { mode: 'reference' } } };
|
|
119
|
+
}
|
|
120
|
+
const owner = req.object_id || req.provider_id || '';
|
|
121
|
+
const key = `${owner}.${req.credential_key ?? ''}`;
|
|
122
|
+
if (!owner || !req.credential_key || !SAFE_KEY.test(key)) {
|
|
123
|
+
throw new DriverError('invalid_argument', `aquaman: cannot derive a vault key from provider id ${JSON.stringify(owner)} and credential key ${JSON.stringify(req.credential_key)}`);
|
|
124
|
+
}
|
|
125
|
+
const ref = formatAquamanRef(COPY_SERVICE, key);
|
|
126
|
+
try {
|
|
127
|
+
await store.set(COPY_SERVICE, key, value);
|
|
128
|
+
}
|
|
129
|
+
catch (err) {
|
|
130
|
+
emit({ op: 'store', mode: 'copy', ref, service: COPY_SERVICE, provider, success: false, error: err.message });
|
|
131
|
+
throw new DriverError('internal', `aquaman: vault write failed: ${err.message}`);
|
|
132
|
+
}
|
|
133
|
+
emit({ op: 'store', mode: 'copy', ref, service: COPY_SERVICE, provider, success: true });
|
|
134
|
+
return { handle: { driver: DRIVER_NAME, handle: ref, metadata: { mode: 'copy' } } };
|
|
135
|
+
},
|
|
136
|
+
async resolve(reqs) {
|
|
137
|
+
const out = [];
|
|
138
|
+
for (const r of reqs) {
|
|
139
|
+
const provider = r.provider ?? '';
|
|
140
|
+
const h = parseHandle(r.handle?.handle ?? '');
|
|
141
|
+
if (!h)
|
|
142
|
+
throw new DriverError('invalid_argument', `aquaman: not an aquaman handle: ${JSON.stringify(r.handle?.handle ?? '')}`);
|
|
143
|
+
let value;
|
|
144
|
+
try {
|
|
145
|
+
if (h.mode === 'reference')
|
|
146
|
+
checkScope(h.service, h.key);
|
|
147
|
+
value = await store.get(h.service, h.key);
|
|
148
|
+
if (value === null) {
|
|
149
|
+
throw new DriverError('not_found', `aquaman: ${h.ref} is not in the vault. Fix: aquaman credentials add ${h.service} ${h.key}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch (err) {
|
|
153
|
+
emit({ op: 'resolve', mode: h.mode, ref: h.ref, service: h.service, provider, success: false, error: err.message });
|
|
154
|
+
if (err instanceof DriverError)
|
|
155
|
+
throw err;
|
|
156
|
+
throw new DriverError('internal', `aquaman: vault read failed for ${h.ref}: ${err.message}`);
|
|
157
|
+
}
|
|
158
|
+
emit({ op: 'resolve', mode: h.mode, ref: h.ref, service: h.service, provider, success: true });
|
|
159
|
+
out.push({ request_id: r.request_id ?? '', value });
|
|
160
|
+
}
|
|
161
|
+
return out;
|
|
162
|
+
},
|
|
163
|
+
async delete(req) {
|
|
164
|
+
const provider = req.provider ?? '';
|
|
165
|
+
const h = parseHandle(req.handle?.handle ?? '');
|
|
166
|
+
if (!h)
|
|
167
|
+
throw new DriverError('invalid_argument', `aquaman: not an aquaman handle: ${JSON.stringify(req.handle?.handle ?? '')}`);
|
|
168
|
+
// A reference points at the user's own vault item: removing the provider must not delete it.
|
|
169
|
+
if (h.mode === 'copy')
|
|
170
|
+
await store.delete(h.service, h.key);
|
|
171
|
+
emit({ op: 'delete', mode: h.mode, ref: h.ref, service: h.service, provider, success: true });
|
|
172
|
+
},
|
|
173
|
+
list() {
|
|
174
|
+
return (scope?.declared() ?? []).map(({ ref, source }) => {
|
|
175
|
+
const parsed = parseAquamanRef(ref);
|
|
176
|
+
return { handle: ref, keys: [parsed.key], metadata: { source, mode: 'reference' } };
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=credential-driver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-driver.js","sourceRoot":"","sources":["../../src/openshell/credential-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAoB,MAAM,oBAAoB,CAAC;AAEzF,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAW,CAAC;AAClE,MAAM,CAAC,MAAM,oBAAoB,GAAG,gCAAgC,CAAC;AACrE,yDAAyD;AACzD,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC;AAErC,MAAM,QAAQ,GAAG,8BAA8B,CAAC;AAIhD,mGAAmG;AACnG,MAAM,OAAO,WAAY,SAAQ,KAAK;IACf;IAArB,YAAqB,IAAqB,EAAE,OAAe;QACzD,KAAK,CAAC,OAAO,CAAC,CAAC;QADI,SAAI,GAAJ,IAAI,CAAiB;QAExC,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF;AAmED,SAAS,WAAW,CAAC,MAAc;IACjC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,KAAK,YAAY,CAAC,CAAC,CAAC,MA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GAAG,eAAe,CAAC,GAAG,CAAE,CAAC;gBACrC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC;YACtF,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gRPC transport for the OpenShell credential driver. Serves
|
|
3
|
+
* `openshell.credentials.v1.CredentialDriver` on a Unix socket (mode 0600).
|
|
4
|
+
*
|
|
5
|
+
* `@grpc/grpc-js` and `@grpc/proto-loader` are optional peer dependencies,
|
|
6
|
+
* loaded only here, so installs that never enable the driver carry neither
|
|
7
|
+
* (the same posture as kdbxweb/argon2 for KeePassXC).
|
|
8
|
+
*/
|
|
9
|
+
import { type OpenShellDriverCore } from './credential-driver.js';
|
|
10
|
+
export declare const GRPC_INSTALL_HINT = "npm install -g @grpc/grpc-js@^1.14 @grpc/proto-loader@^0.8";
|
|
11
|
+
/** Vendored protos: packages/proxy/proto/openshell, from both src/openshell and dist/openshell. */
|
|
12
|
+
export declare function openshellProtoDir(): string;
|
|
13
|
+
/** Throws with an install hint when the optional gRPC packages are missing. */
|
|
14
|
+
export declare function loadGrpc(): Promise<{
|
|
15
|
+
grpc: any;
|
|
16
|
+
protoLoader: any;
|
|
17
|
+
}>;
|
|
18
|
+
export interface OpenShellDriverServer {
|
|
19
|
+
socketPath: string;
|
|
20
|
+
stop(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export declare function startOpenShellDriverServer(core: OpenShellDriverCore, socketPath: string): Promise<OpenShellDriverServer>;
|
|
23
|
+
//# sourceMappingURL=grpc-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grpc-server.d.ts","sourceRoot":"","sources":["../../src/openshell/grpc-server.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAe,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,eAAO,MAAM,iBAAiB,+DAA+D,CAAC;AAE9F,mGAAmG;AACnG,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,+EAA+E;AAC/E,wBAAsB,QAAQ,IAAI,OAAO,CAAC;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,WAAW,EAAE,GAAG,CAAA;CAAE,CAAC,CAQzE;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAyE9H"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gRPC transport for the OpenShell credential driver. Serves
|
|
3
|
+
* `openshell.credentials.v1.CredentialDriver` on a Unix socket (mode 0600).
|
|
4
|
+
*
|
|
5
|
+
* `@grpc/grpc-js` and `@grpc/proto-loader` are optional peer dependencies,
|
|
6
|
+
* loaded only here, so installs that never enable the driver carry neither
|
|
7
|
+
* (the same posture as kdbxweb/argon2 for KeePassXC).
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from 'node:fs';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
import { DriverError } from './credential-driver.js';
|
|
12
|
+
export const GRPC_INSTALL_HINT = 'npm install -g @grpc/grpc-js@^1.14 @grpc/proto-loader@^0.8';
|
|
13
|
+
/** Vendored protos: packages/proxy/proto/openshell, from both src/openshell and dist/openshell. */
|
|
14
|
+
export function openshellProtoDir() {
|
|
15
|
+
return fileURLToPath(new URL('../../proto/openshell/', import.meta.url));
|
|
16
|
+
}
|
|
17
|
+
/** Throws with an install hint when the optional gRPC packages are missing. */
|
|
18
|
+
export async function loadGrpc() {
|
|
19
|
+
try {
|
|
20
|
+
const grpc = await import('@grpc/grpc-js');
|
|
21
|
+
const protoLoader = await import('@grpc/proto-loader');
|
|
22
|
+
return { grpc: grpc.default ?? grpc, protoLoader: protoLoader.default ?? protoLoader };
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
throw new Error(`The OpenShell credential driver needs the optional gRPC packages. Install them with: ${GRPC_INSTALL_HINT}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export async function startOpenShellDriverServer(core, socketPath) {
|
|
29
|
+
const { grpc, protoLoader } = await loadGrpc();
|
|
30
|
+
const definition = protoLoader.loadSync('credential_driver.proto', {
|
|
31
|
+
includeDirs: [openshellProtoDir()],
|
|
32
|
+
keepCase: true,
|
|
33
|
+
longs: String,
|
|
34
|
+
enums: String,
|
|
35
|
+
defaults: true,
|
|
36
|
+
oneofs: true,
|
|
37
|
+
});
|
|
38
|
+
const pkg = grpc.loadPackageDefinition(definition);
|
|
39
|
+
const STATUS = {
|
|
40
|
+
invalid_argument: grpc.status.INVALID_ARGUMENT,
|
|
41
|
+
not_found: grpc.status.NOT_FOUND,
|
|
42
|
+
failed_precondition: grpc.status.FAILED_PRECONDITION,
|
|
43
|
+
internal: grpc.status.INTERNAL,
|
|
44
|
+
};
|
|
45
|
+
const fail = (cb, err) => {
|
|
46
|
+
const code = err instanceof DriverError ? STATUS[err.code] : grpc.status.INTERNAL;
|
|
47
|
+
cb({ code, message: err instanceof Error ? err.message : String(err) });
|
|
48
|
+
};
|
|
49
|
+
const handlers = {
|
|
50
|
+
GetCapabilities(call, cb) {
|
|
51
|
+
try {
|
|
52
|
+
cb(null, core.getCapabilities(call.request.gateway));
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
fail(cb, err);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
StoreCredential(call, cb) {
|
|
59
|
+
core.store(call.request).then((res) => cb(null, res), (err) => fail(cb, err));
|
|
60
|
+
},
|
|
61
|
+
ResolveCredentials(call, cb) {
|
|
62
|
+
core.resolve(call.request.credentials ?? []).then((credentials) => cb(null, { credentials }), (err) => fail(cb, err));
|
|
63
|
+
},
|
|
64
|
+
DeleteCredential(call, cb) {
|
|
65
|
+
core.delete(call.request).then(() => cb(null, {}), (err) => fail(cb, err));
|
|
66
|
+
},
|
|
67
|
+
ListCredentials(_call, cb) {
|
|
68
|
+
try {
|
|
69
|
+
cb(null, { credentials: core.list() });
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
fail(cb, err);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
const server = new grpc.Server();
|
|
77
|
+
server.addService(pkg.openshell.credentials.v1.CredentialDriver.service, handlers);
|
|
78
|
+
// Never unlink something that isn't a stale socket.
|
|
79
|
+
try {
|
|
80
|
+
if (fs.lstatSync(socketPath).isSocket())
|
|
81
|
+
fs.unlinkSync(socketPath);
|
|
82
|
+
}
|
|
83
|
+
catch { /* absent */ }
|
|
84
|
+
// Create the socket 0600 from the start (no window where it is group/world
|
|
85
|
+
// accessible), then chmod as a fallback. process.umask() throws in worker
|
|
86
|
+
// threads (vitest), hence the try/catch, same as the proxy socket.
|
|
87
|
+
let previousUmask;
|
|
88
|
+
try {
|
|
89
|
+
previousUmask = process.umask(0o177);
|
|
90
|
+
}
|
|
91
|
+
catch { /* unsupported in workers */ }
|
|
92
|
+
try {
|
|
93
|
+
await new Promise((resolve, reject) => {
|
|
94
|
+
server.bindAsync(`unix://${socketPath}`, grpc.ServerCredentials.createInsecure(), (err) => {
|
|
95
|
+
if (err)
|
|
96
|
+
reject(new Error(`OpenShell driver could not bind ${socketPath}: ${err.message}`));
|
|
97
|
+
else
|
|
98
|
+
resolve();
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
if (previousUmask !== undefined) {
|
|
104
|
+
try {
|
|
105
|
+
process.umask(previousUmask);
|
|
106
|
+
}
|
|
107
|
+
catch { /* ignore */ }
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
fs.chmodSync(socketPath, 0o600);
|
|
111
|
+
return {
|
|
112
|
+
socketPath,
|
|
113
|
+
async stop() {
|
|
114
|
+
await new Promise((resolve) => server.tryShutdown(() => resolve()));
|
|
115
|
+
try {
|
|
116
|
+
fs.unlinkSync(socketPath);
|
|
117
|
+
}
|
|
118
|
+
catch { /* already gone */ }
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=grpc-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grpc-server.js","sourceRoot":"","sources":["../../src/openshell/grpc-server.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAA4B,MAAM,wBAAwB,CAAC;AAE/E,MAAM,CAAC,MAAM,iBAAiB,GAAG,4DAA4D,CAAC;AAE9F,mGAAmG;AACnG,MAAM,UAAU,iBAAiB;IAC/B,OAAO,aAAa,CAAC,IAAI,GAAG,CAAC,wBAAwB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,+EAA+E;AAC/E,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;QAC3C,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACvD,OAAO,EAAE,IAAI,EAAG,IAAY,CAAC,OAAO,IAAI,IAAI,EAAE,WAAW,EAAG,WAAmB,CAAC,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3G,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,C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;YAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;QAAC,CAAC;IACnG,CAAC;IACD,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAEhC,OAAO;QACL,UAAU;QACV,KAAK,CAAC,IAAI;YACR,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YAC1E,IAAI,CAAC;gBAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC;QACjE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Glue between `aquaman daemon` / the CLI and the OpenShell credential driver.
|
|
3
|
+
*/
|
|
4
|
+
import type { WrapperConfig } from '../core/types.js';
|
|
5
|
+
import type { CredentialStore } from '../core/credentials/store.js';
|
|
6
|
+
import type { BrokerScope } from '../broker-scope.js';
|
|
7
|
+
import { type DriverAccessEvent } from './credential-driver.js';
|
|
8
|
+
import { type OpenShellDriverServer } from './grpc-server.js';
|
|
9
|
+
/** macOS caps Unix socket paths at 104 bytes (Linux 108); bind fails above that. */
|
|
10
|
+
export declare const MAX_SOCKET_PATH = 103;
|
|
11
|
+
export declare function openshellDriverSocketPath(config: WrapperConfig): string;
|
|
12
|
+
/** True when the optional gRPC peers can be loaded. */
|
|
13
|
+
export declare function grpcAvailable(): Promise<boolean>;
|
|
14
|
+
/** The gateway TOML that points OpenShell at this driver. */
|
|
15
|
+
export declare function gatewayConfigSnippet(socketPath: string): string;
|
|
16
|
+
export interface AuditSink {
|
|
17
|
+
logCredentialAccess(sessionId: string, agentId: string, access: {
|
|
18
|
+
service: string;
|
|
19
|
+
operation: 'read' | 'use' | 'rotate';
|
|
20
|
+
success: boolean;
|
|
21
|
+
error?: string;
|
|
22
|
+
}): unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Resolves hand a value to the gateway (`read`); copy-mode writes and deletes
|
|
26
|
+
* change the vault (`rotate`). Validating a reference at create time hands
|
|
27
|
+
* nothing out, so only its refusals are recorded.
|
|
28
|
+
*/
|
|
29
|
+
export declare function auditDriverAccess(audit: AuditSink, e: DriverAccessEvent): void;
|
|
30
|
+
export declare function startOpenShellDriver(opts: {
|
|
31
|
+
config: WrapperConfig;
|
|
32
|
+
store: CredentialStore;
|
|
33
|
+
scope: BrokerScope | undefined;
|
|
34
|
+
audit: AuditSink;
|
|
35
|
+
version: string;
|
|
36
|
+
}): Promise<OpenShellDriverServer>;
|
|
37
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/openshell/integration.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAA6B,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAwC,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEpG,oFAAoF;AACpF,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAEvE;AAED,uDAAuD;AACvD,wBAAsB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAOtD;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAS/D;AAED,MAAM,WAAW,SAAS;IACxB,mBAAmB,CACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAClG,OAAO,CAAC;CACZ;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAY9E;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAYjC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Glue between `aquaman daemon` / the CLI and the OpenShell credential driver.
|
|
3
|
+
*/
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
import { getConfigDir } from '../core/utils/config.js';
|
|
6
|
+
import { createOpenShellDriverCore } from './credential-driver.js';
|
|
7
|
+
import { startOpenShellDriverServer, loadGrpc } from './grpc-server.js';
|
|
8
|
+
/** macOS caps Unix socket paths at 104 bytes (Linux 108); bind fails above that. */
|
|
9
|
+
export const MAX_SOCKET_PATH = 103;
|
|
10
|
+
export function openshellDriverSocketPath(config) {
|
|
11
|
+
return config.openshell?.driver?.socketPath || path.join(getConfigDir(), 'openshell.sock');
|
|
12
|
+
}
|
|
13
|
+
/** True when the optional gRPC peers can be loaded. */
|
|
14
|
+
export async function grpcAvailable() {
|
|
15
|
+
try {
|
|
16
|
+
await loadGrpc();
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** The gateway TOML that points OpenShell at this driver. */
|
|
24
|
+
export function gatewayConfigSnippet(socketPath) {
|
|
25
|
+
return [
|
|
26
|
+
'[openshell.gateway]',
|
|
27
|
+
'credential_drivers = ["aquaman"]',
|
|
28
|
+
'',
|
|
29
|
+
'[openshell.credential_drivers.aquaman]',
|
|
30
|
+
'transport = "uds"',
|
|
31
|
+
`socket_path = "${socketPath}"`,
|
|
32
|
+
].join('\n');
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Resolves hand a value to the gateway (`read`); copy-mode writes and deletes
|
|
36
|
+
* change the vault (`rotate`). Validating a reference at create time hands
|
|
37
|
+
* nothing out, so only its refusals are recorded.
|
|
38
|
+
*/
|
|
39
|
+
export function auditDriverAccess(audit, e) {
|
|
40
|
+
let operation;
|
|
41
|
+
if (e.op === 'resolve')
|
|
42
|
+
operation = 'read';
|
|
43
|
+
else if (e.mode === 'copy')
|
|
44
|
+
operation = 'rotate';
|
|
45
|
+
else if (!e.success)
|
|
46
|
+
operation = 'read';
|
|
47
|
+
else
|
|
48
|
+
return;
|
|
49
|
+
audit.logCredentialAccess('system', 'openshell', {
|
|
50
|
+
service: e.service,
|
|
51
|
+
operation,
|
|
52
|
+
success: e.success,
|
|
53
|
+
error: e.success ? undefined : `${e.ref}: ${e.error ?? 'refused'}`,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export async function startOpenShellDriver(opts) {
|
|
57
|
+
const socketPath = openshellDriverSocketPath(opts.config);
|
|
58
|
+
if (Buffer.byteLength(socketPath) > MAX_SOCKET_PATH) {
|
|
59
|
+
throw new Error(`socket path is ${Buffer.byteLength(socketPath)} bytes, over the ${MAX_SOCKET_PATH}-byte Unix socket limit: ${socketPath}. Set openshell.driver.socketPath to a shorter path.`);
|
|
60
|
+
}
|
|
61
|
+
const core = createOpenShellDriverCore({
|
|
62
|
+
store: opts.store,
|
|
63
|
+
scope: opts.scope,
|
|
64
|
+
version: opts.version,
|
|
65
|
+
onAccess: (e) => auditDriverAccess(opts.audit, e),
|
|
66
|
+
});
|
|
67
|
+
return startOpenShellDriverServer(core, socketPath);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.js","sourceRoot":"","sources":["../../src/openshell/integration.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAA0B,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,QAAQ,EAA8B,MAAM,kBAAkB,CAAC;AAEpG,oFAAoF;AACpF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC,MAAM,UAAU,yBAAyB,CAAC,MAAqB;IAC7D,OAAO,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,gBAAgB,CAAC,CAAC;AAC7F,CAAC;AAED,uDAAuD;AACvD,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,IAAI,CAAC;QACH,MAAM,QAAQ,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,oBAAoB,CAAC,UAAkB;IACrD,OAAO;QACL,qBAAqB;QACrB,kCAAkC;QAClC,EAAE;QACF,wCAAwC;QACxC,mBAAmB;QACnB,kBAAkB,UAAU,GAAG;KAChC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAUD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAgB,EAAE,CAAoB;IACtE,IAAI,SAA4B,CAAC;IACjC,IAAI,CAAC,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1
|
{
|
|
2
2
|
"name": "aquaman-proxy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "🔱 API key protection for AI agents. Bring your own vault. Credentials stay where you already keep them, never in the agent's memory.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -44,14 +44,16 @@
|
|
|
44
44
|
"license": "MIT",
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"commander": "^12.0.0",
|
|
47
|
-
"yaml": "^2.
|
|
47
|
+
"yaml": "^2.9.1"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
50
|
"keytar": "^7.9.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"argon2": "^0.45.1",
|
|
54
|
-
"kdbxweb": "^2.1.1"
|
|
54
|
+
"kdbxweb": "^2.1.1",
|
|
55
|
+
"@grpc/grpc-js": "^1.14.5",
|
|
56
|
+
"@grpc/proto-loader": "^0.8.1"
|
|
55
57
|
},
|
|
56
58
|
"peerDependenciesMeta": {
|
|
57
59
|
"argon2": {
|
|
@@ -59,15 +61,22 @@
|
|
|
59
61
|
},
|
|
60
62
|
"kdbxweb": {
|
|
61
63
|
"optional": true
|
|
64
|
+
},
|
|
65
|
+
"@grpc/grpc-js": {
|
|
66
|
+
"optional": true
|
|
67
|
+
},
|
|
68
|
+
"@grpc/proto-loader": {
|
|
69
|
+
"optional": true
|
|
62
70
|
}
|
|
63
71
|
},
|
|
64
72
|
"devDependencies": {
|
|
65
73
|
"@types/node": "^20.19.43",
|
|
66
|
-
"tsx": "^4.23.
|
|
74
|
+
"tsx": "^4.23.15",
|
|
67
75
|
"typescript": "^5.3.0"
|
|
68
76
|
},
|
|
69
77
|
"files": [
|
|
70
78
|
"dist",
|
|
79
|
+
"proto",
|
|
71
80
|
"LICENSE",
|
|
72
81
|
"README.md"
|
|
73
82
|
],
|