@alineo-labs/vault 0.3.2 → 0.4.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.
Files changed (2) hide show
  1. package/dist/index.d.mts +14 -4
  2. package/package.json +2 -3
package/dist/index.d.mts CHANGED
@@ -1,6 +1,16 @@
1
1
  import { CredentialBinding, CredentialBroker } from "@alineo-labs/core";
2
- import { ControlClient } from "@alineo-labs/opensandbox";
3
2
  //#region src/vault-client.d.ts
3
+ /**
4
+ * What the vault needs from a sandbox provider: where a port inside the sandbox can be reached.
5
+ * A `SandboxProvider` satisfies it, so does OpenSandbox's own `ControlClient`, and a test can
6
+ * pass an object literal.
7
+ */
8
+ interface EndpointSource {
9
+ getEndpoint(sandboxId: string, port: number, useServerProxy?: boolean): Promise<{
10
+ endpoint: string;
11
+ headers?: Record<string, string>;
12
+ }>;
13
+ }
4
14
  /** Thrown for a non-2xx response from the egress sidecar's Credential Vault API. */
5
15
  export declare class VaultClientError extends Error {
6
16
  readonly status: number;
@@ -109,7 +119,7 @@ interface MutationRequest {
109
119
  export declare class VaultClient {
110
120
  private readonly control;
111
121
  private static readonly PORT;
112
- constructor(control: ControlClient);
122
+ constructor(control: EndpointSource);
113
123
  private request;
114
124
  /** Creates the sandbox's Credential Vault. Throws `VaultClientError` with `status: 409` if one already exists — see `createOrPatch()`. */
115
125
  create(sandboxId: string, req: CreateRequest, useServerProxy?: boolean): Promise<VaultState>;
@@ -169,7 +179,7 @@ export declare class UnsupportedInjectionError extends Error {
169
179
  export declare class OpenSandboxCredentialBroker implements CredentialBroker {
170
180
  private readonly useServerProxy?;
171
181
  private readonly vault;
172
- constructor(control: ControlClient, useServerProxy?: boolean | undefined);
182
+ constructor(control: EndpointSource, useServerProxy?: boolean | undefined);
173
183
  set(sandboxId: string, name: string, value: string, binding: CredentialBinding): Promise<void>;
174
184
  /**
175
185
  * Both `changes.value` and `changes.binding` are required — the vault's `GET` response never
@@ -187,4 +197,4 @@ export declare class OpenSandboxCredentialBroker implements CredentialBroker {
187
197
  }>>;
188
198
  }
189
199
  //#endregion
190
- export type { CreateRequest, MutationRequest, VaultState, WireAuth, WireBinding, WireCredential, WireCredentialSource, WireMatch };
200
+ export type { CreateRequest, EndpointSource, MutationRequest, VaultState, WireAuth, WireBinding, WireCredential, WireCredentialSource, WireMatch };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alineo-labs/vault",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,8 +28,7 @@
28
28
  "test": "bun test"
29
29
  },
30
30
  "dependencies": {
31
- "@alineo-labs/core": "0.4.2",
32
- "@alineo-labs/opensandbox": "0.3.1"
31
+ "@alineo-labs/core": "0.6.0"
33
32
  },
34
33
  "devDependencies": {
35
34
  "bun-types": "1.4.2",