@alienplatform/commands 3.3.62 → 3.3.63
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/bootstrap.d.ts +7 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/capability-file.d.ts +25 -0
- package/dist/capability-file.d.ts.map +1 -0
- package/dist/index.js +254 -31
- package/dist/receiver-config.d.ts +9 -1
- package/dist/receiver-config.d.ts.map +1 -1
- package/dist/receiver.d.ts +3 -1
- package/dist/receiver.d.ts.map +1 -1
- package/package.json +5 -2
package/dist/bootstrap.d.ts
CHANGED
|
@@ -33,8 +33,14 @@ export interface RefreshingConnectionProvider<Connection> {
|
|
|
33
33
|
/**
|
|
34
34
|
* Refresh credentials after an authentication failure. Returns `undefined`
|
|
35
35
|
* when this connection is fixed and the request must not be retried.
|
|
36
|
+
* `rejected` is the connection the server refused.
|
|
36
37
|
*/
|
|
37
|
-
refresh(signal?: AbortSignal): Promise<Connection | undefined>;
|
|
38
|
+
refresh(signal?: AbortSignal, rejected?: Connection): Promise<Connection | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Called when the server also refused the connection returned by `refresh`,
|
|
41
|
+
* so the provider does not offer it again.
|
|
42
|
+
*/
|
|
43
|
+
reject?(rejected: Connection): void;
|
|
38
44
|
}
|
|
39
45
|
export type CommandConnectionProvider = RefreshingConnectionProvider<CommandConnection>;
|
|
40
46
|
/**
|
package/dist/bootstrap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AA2BtD,UAAU,qBAAqB;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,IAAI,CAAA;CAChB;AAED,MAAM,WAAW,uBAAwB,SAAQ,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AA+B,YAAW,yBAAyB;IAClE,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,iBAAiB;IAE1D,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAIjC,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC;CAG9B;AAED;;;;GAIG;AACH,qBAAa,+BAAgC,YAAW,yBAAyB;IAC/E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IACxC,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,eAAe,CAAwC;gBAEnD,OAAO,EAAE,uBAAuB;IAkBtC,GAAG,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAUrD,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAkBjD,SAAS;CAoFxB;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAa7D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reader for the bounded command credential an enrolled Operator mounts into a
|
|
3
|
+
* workload (`ALIEN_COMMANDS_CAPABILITY_FILE`).
|
|
4
|
+
*
|
|
5
|
+
* Twin of the file source in the Rust `RuntimeCredentials`
|
|
6
|
+
* (`alien-client-core`). The host rewrites the file before the credential
|
|
7
|
+
* expires, so the file is read on every request and nothing is renewed here.
|
|
8
|
+
* The file holds `{"token": "...", "expiresAt": "<RFC 3339>"}` and nothing
|
|
9
|
+
* else. Anything that does not fit is refused, never sent to the manager.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ENV_ALIEN_COMMANDS_CAPABILITY_FILE = "ALIEN_COMMANDS_CAPABILITY_FILE";
|
|
12
|
+
export declare class CapabilityFile {
|
|
13
|
+
private readonly path;
|
|
14
|
+
private readonly now;
|
|
15
|
+
private cached;
|
|
16
|
+
private rejected;
|
|
17
|
+
constructor(path: string, now?: () => number);
|
|
18
|
+
/** The current capability. Throws a retryable error when the file is unusable. */
|
|
19
|
+
read(): Promise<string>;
|
|
20
|
+
/** Record that the manager refused `token`, so the file must change before it is sent again. */
|
|
21
|
+
reject(token: string): void;
|
|
22
|
+
private readText;
|
|
23
|
+
private parse;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=capability-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-file.d.ts","sourceRoot":"","sources":["../src/capability-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,eAAO,MAAM,kCAAkC,mCAAmC,CAAA;AAUlF,qBAAa,cAAc;IAKvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IALtB,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,QAAQ,CAAoB;gBAGjB,IAAI,EAAE,MAAM,EACZ,GAAG,GAAE,MAAM,MAAiB;IAG/C,kFAAkF;IAC5E,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAU7B,gGAAgG;IAChG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;YAOb,QAAQ;IAkCtB,OAAO,CAAC,KAAK;CA8Bd"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AlienError, AlienError as AlienError$1, CommandStatusResponseSchema, CreateCommandResponseSchema, LeaseResponseSchema, defineError, defineError as defineError$1 } from "@alienplatform/core";
|
|
2
|
-
import { readFile } from "node:fs/promises";
|
|
1
|
+
import { AlienError, AlienError as AlienError$1, CommandStatusResponseSchema, CreateCommandResponseSchema, LeaseResponseSchema, ResponseHandlingSchema, defineError, defineError as defineError$1 } from "@alienplatform/core";
|
|
2
|
+
import { open, readFile } from "node:fs/promises";
|
|
3
3
|
// ../../node_modules/.pnpm/zod@4.5.2/node_modules/zod/v4/core/util.js
|
|
4
4
|
function getEnumValues(entries) {
|
|
5
5
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
@@ -2536,7 +2536,7 @@ function bucketFor(state, inst) {
|
|
|
2536
2536
|
return bucket;
|
|
2537
2537
|
}
|
|
2538
2538
|
let handoff;
|
|
2539
|
-
const open = [];
|
|
2539
|
+
const open$1 = [];
|
|
2540
2540
|
const memo = {
|
|
2541
2541
|
alloc(_inst, payload, empty) {
|
|
2542
2542
|
const bucket = handoff;
|
|
@@ -2547,7 +2547,7 @@ const memo = {
|
|
|
2547
2547
|
issues: null
|
|
2548
2548
|
};
|
|
2549
2549
|
bucket.set(payload.value, entry);
|
|
2550
|
-
open.push(entry);
|
|
2550
|
+
open$1.push(entry);
|
|
2551
2551
|
return empty;
|
|
2552
2552
|
},
|
|
2553
2553
|
guard(inst) {
|
|
@@ -2610,10 +2610,10 @@ const memo = {
|
|
|
2610
2610
|
return payload;
|
|
2611
2611
|
}
|
|
2612
2612
|
handoff = bucket;
|
|
2613
|
-
const depth = open.length;
|
|
2613
|
+
const depth = open$1.length;
|
|
2614
2614
|
const result = base(payload, ctx);
|
|
2615
2615
|
handoff = void 0;
|
|
2616
|
-
const entry = open.length > depth ? open.pop() : void 0;
|
|
2616
|
+
const entry = open$1.length > depth ? open$1.pop() : void 0;
|
|
2617
2617
|
if (result instanceof Promise) return result.then((r) => {
|
|
2618
2618
|
if (entry) entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
|
|
2619
2619
|
return r;
|
|
@@ -5158,11 +5158,13 @@ const ReceiverBootstrapResponseSchema = BootstrapConnectionSchema.extend({ targe
|
|
|
5158
5158
|
* credentials that the provider can refresh.
|
|
5159
5159
|
*/
|
|
5160
5160
|
async function requestWithRefreshingConnection(provider, request, signal) {
|
|
5161
|
-
|
|
5161
|
+
const connection = await provider.get(signal);
|
|
5162
|
+
let result = await request(connection);
|
|
5162
5163
|
if (result.response.status !== 401) return result;
|
|
5163
|
-
const refreshed = await provider.refresh(signal);
|
|
5164
|
+
const refreshed = await provider.refresh(signal, connection);
|
|
5164
5165
|
if (refreshed === void 0) return result;
|
|
5165
5166
|
result = await request(refreshed);
|
|
5167
|
+
if (result.response.status === 401) provider.reject?.(refreshed);
|
|
5166
5168
|
return result;
|
|
5167
5169
|
}
|
|
5168
5170
|
var FixedCommandConnectionProvider = class {
|
|
@@ -5797,6 +5799,105 @@ var TargetedCommands = class {
|
|
|
5797
5799
|
});
|
|
5798
5800
|
}
|
|
5799
5801
|
};
|
|
5802
|
+
// src/capability-file.ts
|
|
5803
|
+
/**
|
|
5804
|
+
* Reader for the bounded command credential an enrolled Operator mounts into a
|
|
5805
|
+
* workload (`ALIEN_COMMANDS_CAPABILITY_FILE`).
|
|
5806
|
+
*
|
|
5807
|
+
* Twin of the file source in the Rust `RuntimeCredentials`
|
|
5808
|
+
* (`alien-client-core`). The host rewrites the file before the credential
|
|
5809
|
+
* expires, so the file is read on every request and nothing is renewed here.
|
|
5810
|
+
* The file holds `{"token": "...", "expiresAt": "<RFC 3339>"}` and nothing
|
|
5811
|
+
* else. Anything that does not fit is refused, never sent to the manager.
|
|
5812
|
+
*/
|
|
5813
|
+
const ENV_ALIEN_COMMANDS_CAPABILITY_FILE = "ALIEN_COMMANDS_CAPABILITY_FILE";
|
|
5814
|
+
const MAX_FILE_BYTES = 16384;
|
|
5815
|
+
const TOKEN_PREFIX = "ax_cap_v1_";
|
|
5816
|
+
const RFC3339 = /^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(\.\d+)?([Zz]|[+-]\d{2}:\d{2})$/;
|
|
5817
|
+
var CapabilityFile = class {
|
|
5818
|
+
path;
|
|
5819
|
+
now;
|
|
5820
|
+
cached;
|
|
5821
|
+
rejected;
|
|
5822
|
+
constructor(path, now = Date.now) {
|
|
5823
|
+
this.path = path;
|
|
5824
|
+
this.now = now;
|
|
5825
|
+
}
|
|
5826
|
+
/** The current capability. Throws a retryable error when the file is unusable. */
|
|
5827
|
+
async read() {
|
|
5828
|
+
const text = await this.readText();
|
|
5829
|
+
const capability = this.parse(text);
|
|
5830
|
+
if (this.rejected === capability) throw unusable("the capability file still contains a rejected credential");
|
|
5831
|
+
this.cached = capability;
|
|
5832
|
+
return capability;
|
|
5833
|
+
}
|
|
5834
|
+
/** Record that the manager refused `token`, so the file must change before it is sent again. */
|
|
5835
|
+
reject(token) {
|
|
5836
|
+
if (this.cached === token) {
|
|
5837
|
+
this.cached = void 0;
|
|
5838
|
+
this.rejected = token;
|
|
5839
|
+
}
|
|
5840
|
+
}
|
|
5841
|
+
async readText() {
|
|
5842
|
+
let handle;
|
|
5843
|
+
try {
|
|
5844
|
+
handle = await open(this.path, "r");
|
|
5845
|
+
} catch (error) {
|
|
5846
|
+
throw unusable("cannot open the capability file", await AlienError$1.from(error));
|
|
5847
|
+
}
|
|
5848
|
+
try {
|
|
5849
|
+
const stat = await handle.stat();
|
|
5850
|
+
if (!stat.isFile() || stat.size > MAX_FILE_BYTES) throw unusable("the capability file is not a regular file of at most 16 KiB");
|
|
5851
|
+
if (process.platform !== "win32") {
|
|
5852
|
+
const mode = stat.mode;
|
|
5853
|
+
if ((mode & 31) !== 0 || (mode & 32) !== 0 && stat.uid !== 0) throw unusable("the capability file must be private or root-owned group-read-only");
|
|
5854
|
+
}
|
|
5855
|
+
const buffer = Buffer.alloc(16385);
|
|
5856
|
+
const { bytesRead } = await handle.read(buffer, 0, buffer.length, 0);
|
|
5857
|
+
if (bytesRead > MAX_FILE_BYTES) throw unusable("the capability file exceeds its size limit");
|
|
5858
|
+
return buffer.subarray(0, bytesRead).toString("utf8");
|
|
5859
|
+
} catch (error) {
|
|
5860
|
+
if (error instanceof AlienError$1) throw error;
|
|
5861
|
+
throw unusable("cannot read the capability file", await AlienError$1.from(error));
|
|
5862
|
+
} finally {
|
|
5863
|
+
await handle.close().catch(() => {});
|
|
5864
|
+
}
|
|
5865
|
+
}
|
|
5866
|
+
parse(text) {
|
|
5867
|
+
let value;
|
|
5868
|
+
try {
|
|
5869
|
+
value = JSON.parse(text);
|
|
5870
|
+
} catch {
|
|
5871
|
+
throw unusable("the capability file is not valid JSON");
|
|
5872
|
+
}
|
|
5873
|
+
if (typeof value !== "object" || value === null || Array.isArray(value) || Object.keys(value).sort().join(",") !== "expiresAt,token") throw unusable("the capability file must hold only token and expiresAt");
|
|
5874
|
+
const { token, expiresAt } = value;
|
|
5875
|
+
if (typeof token !== "string" || typeof expiresAt !== "string" || !RFC3339.test(expiresAt)) throw unusable("the capability file has an invalid token or expiry");
|
|
5876
|
+
const remainingMs = Date.parse(expiresAt) - this.now();
|
|
5877
|
+
if (!token.startsWith(TOKEN_PREFIX) || !(remainingMs > 0) || remainingMs > 39e5) throw unusable("the capability file has an invalid credential lifetime");
|
|
5878
|
+
return token;
|
|
5879
|
+
}
|
|
5880
|
+
};
|
|
5881
|
+
/**
|
|
5882
|
+
* The host writes the file and replaces it before expiry, so it can be
|
|
5883
|
+
* missing, late or stale for a while. The receiver keeps polling with backoff.
|
|
5884
|
+
*/
|
|
5885
|
+
function unusable(reason, source) {
|
|
5886
|
+
const context = {
|
|
5887
|
+
envVar: ENV_ALIEN_COMMANDS_CAPABILITY_FILE,
|
|
5888
|
+
reason
|
|
5889
|
+
};
|
|
5890
|
+
const definition = CommandReceiverConfigInvalidError.create(context);
|
|
5891
|
+
return new AlienError$1({
|
|
5892
|
+
code: definition.metadata.code,
|
|
5893
|
+
message: definition.metadata.message(context),
|
|
5894
|
+
retryable: true,
|
|
5895
|
+
internal: definition.metadata.internal,
|
|
5896
|
+
httpStatusCode: definition.metadata.httpStatusCode,
|
|
5897
|
+
context: definition.context,
|
|
5898
|
+
source
|
|
5899
|
+
});
|
|
5900
|
+
}
|
|
5800
5901
|
// src/receiver-config.ts
|
|
5801
5902
|
const DEFAULT_POLL_INTERVAL_MS = 5e3;
|
|
5802
5903
|
const DEFAULT_MAX_LEASES = 1;
|
|
@@ -5807,6 +5908,8 @@ const DEFAULT_DRAIN_TIMEOUT_MS = 3e4;
|
|
|
5807
5908
|
const ENV_ALIEN_COMMANDS_URL = "ALIEN_COMMANDS_URL";
|
|
5808
5909
|
const ENV_ALIEN_COMMANDS_TOKEN = "ALIEN_COMMANDS_TOKEN";
|
|
5809
5910
|
const ENV_ALIEN_COMMANDS_TOKEN_FILE = "ALIEN_COMMANDS_TOKEN_FILE";
|
|
5911
|
+
const ENV_ALIEN_IDENTITY_PROVIDER = "ALIEN_IDENTITY_PROVIDER";
|
|
5912
|
+
const ENV_ALIEN_MANAGER_URL = "ALIEN_MANAGER_URL";
|
|
5810
5913
|
const ENV_ALIEN_DEPLOYMENT_ID = "ALIEN_DEPLOYMENT_ID";
|
|
5811
5914
|
const ENV_ALIEN_COMMANDS_TARGET_RESOURCE_ID = "ALIEN_COMMANDS_TARGET_RESOURCE_ID";
|
|
5812
5915
|
const ENV_ALIEN_COMMANDS_TARGET_RESOURCE_TYPE = "ALIEN_COMMANDS_TARGET_RESOURCE_TYPE";
|
|
@@ -5875,12 +5978,20 @@ function validateConfig(env, options) {
|
|
|
5875
5978
|
reason: `${ENV_ALIEN_COMMANDS_URL} is not a valid URL: ${url}`
|
|
5876
5979
|
}));
|
|
5877
5980
|
}
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5981
|
+
let token;
|
|
5982
|
+
let tokenFile;
|
|
5983
|
+
let capabilityFile;
|
|
5984
|
+
if (env[ENV_ALIEN_IDENTITY_PROVIDER] === "capabilityFile") {
|
|
5985
|
+
capabilityFile = requireEnv(env, ENV_ALIEN_COMMANDS_CAPABILITY_FILE);
|
|
5986
|
+
validateManagerOrigin(requireEnv(env, ENV_ALIEN_MANAGER_URL), url);
|
|
5987
|
+
} else {
|
|
5988
|
+
token = optionalNonEmpty(env, ENV_ALIEN_COMMANDS_TOKEN);
|
|
5989
|
+
tokenFile = optionalNonEmpty(env, ENV_ALIEN_COMMANDS_TOKEN_FILE);
|
|
5990
|
+
if (token === void 0 && tokenFile === void 0) throw new AlienError$1(CommandReceiverConfigInvalidError.create({
|
|
5991
|
+
envVar: ENV_ALIEN_COMMANDS_TOKEN,
|
|
5992
|
+
reason: `${ENV_ALIEN_COMMANDS_TOKEN} or ${ENV_ALIEN_COMMANDS_TOKEN_FILE} is required`
|
|
5993
|
+
}));
|
|
5994
|
+
}
|
|
5884
5995
|
const deploymentId = requireEnv(env, ENV_ALIEN_DEPLOYMENT_ID);
|
|
5885
5996
|
const resourceId = requireEnv(env, ENV_ALIEN_COMMANDS_TARGET_RESOURCE_ID);
|
|
5886
5997
|
const rawType = requireEnv(env, ENV_ALIEN_COMMANDS_TARGET_RESOURCE_TYPE);
|
|
@@ -5892,12 +6003,38 @@ function validateConfig(env, options) {
|
|
|
5892
6003
|
url,
|
|
5893
6004
|
token,
|
|
5894
6005
|
tokenFile,
|
|
6006
|
+
capabilityFile,
|
|
5895
6007
|
deploymentId,
|
|
5896
6008
|
resourceId,
|
|
5897
6009
|
resourceType: rawType,
|
|
5898
6010
|
...validateRuntimeConfig(env, options)
|
|
5899
6011
|
};
|
|
5900
6012
|
}
|
|
6013
|
+
/**
|
|
6014
|
+
* A capability may only go to the manager it was issued for: the configured
|
|
6015
|
+
* manager URL must be HTTPS (HTTP only on loopback, no credentials, query or
|
|
6016
|
+
* fragment) and the commands URL must share its origin.
|
|
6017
|
+
*/
|
|
6018
|
+
function validateManagerOrigin(managerUrl, commandsUrl) {
|
|
6019
|
+
const invalid = (envVar, reason) => new AlienError$1(CommandReceiverConfigInvalidError.create({
|
|
6020
|
+
envVar,
|
|
6021
|
+
reason
|
|
6022
|
+
}));
|
|
6023
|
+
let manager;
|
|
6024
|
+
try {
|
|
6025
|
+
manager = new URL(managerUrl);
|
|
6026
|
+
} catch {
|
|
6027
|
+
throw invalid(ENV_ALIEN_MANAGER_URL, `${ENV_ALIEN_MANAGER_URL} is not a valid URL`);
|
|
6028
|
+
}
|
|
6029
|
+
const loopback = [
|
|
6030
|
+
"localhost",
|
|
6031
|
+
"127.0.0.1",
|
|
6032
|
+
"[::1]"
|
|
6033
|
+
].includes(manager.hostname);
|
|
6034
|
+
if (manager.username !== "" || manager.password !== "" || manager.search !== "" || manager.hash !== "" || !(manager.protocol === "https:" || manager.protocol === "http:" && loopback)) throw invalid(ENV_ALIEN_MANAGER_URL, `${ENV_ALIEN_MANAGER_URL} must use HTTPS (HTTP is allowed only on loopback) and carry no credentials, query or fragment`);
|
|
6035
|
+
const commands = new URL(commandsUrl);
|
|
6036
|
+
if (commands.username !== "" || commands.password !== "" || commands.origin !== manager.origin) throw invalid(ENV_ALIEN_COMMANDS_URL, `${ENV_ALIEN_COMMANDS_URL} must use the configured manager origin`);
|
|
6037
|
+
}
|
|
5901
6038
|
function validateRuntimeConfig(env, options) {
|
|
5902
6039
|
const pollIntervalMs = numericConfig(env, ENV_ALIEN_COMMANDS_POLL_INTERVAL_MS, options.pollIntervalMs, DEFAULT_POLL_INTERVAL_MS, (value) => Number.isInteger(value) && value > 0);
|
|
5903
6040
|
const pollMaxIntervalMs = numericConfig(env, ENV_ALIEN_COMMANDS_POLL_MAX_INTERVAL_MS, options.pollMaxIntervalMs, DEFAULT_POLL_MAX_INTERVAL_MS, (value) => Number.isInteger(value) && value > 0);
|
|
@@ -5922,7 +6059,7 @@ var TokenSource = class {
|
|
|
5922
6059
|
this.token = token;
|
|
5923
6060
|
this.tokenFile = tokenFile;
|
|
5924
6061
|
}
|
|
5925
|
-
async
|
|
6062
|
+
async read() {
|
|
5926
6063
|
if (this.token !== void 0) return this.token;
|
|
5927
6064
|
if (this.cachedFileToken !== void 0) return this.cachedFileToken;
|
|
5928
6065
|
return this.readFileToken();
|
|
@@ -5937,33 +6074,62 @@ var TokenSource = class {
|
|
|
5937
6074
|
try {
|
|
5938
6075
|
token = (await readFile(path, "utf8")).trim();
|
|
5939
6076
|
} catch (error) {
|
|
5940
|
-
throw (await AlienError$1.from(error))
|
|
5941
|
-
envVar: ENV_ALIEN_COMMANDS_TOKEN_FILE,
|
|
5942
|
-
reason: `Failed to read command token file '${path}'`
|
|
5943
|
-
}));
|
|
6077
|
+
throw unavailableTokenFile(`Failed to read command token file '${path}'`, await AlienError$1.from(error));
|
|
5944
6078
|
}
|
|
5945
|
-
if (token === "") throw
|
|
5946
|
-
envVar: ENV_ALIEN_COMMANDS_TOKEN_FILE,
|
|
5947
|
-
reason: `${ENV_ALIEN_COMMANDS_TOKEN_FILE} '${path}' contains an empty token`
|
|
5948
|
-
}));
|
|
6079
|
+
if (token === "") throw unavailableTokenFile(`${ENV_ALIEN_COMMANDS_TOKEN_FILE} '${path}' contains an empty token`);
|
|
5949
6080
|
this.cachedFileToken = token;
|
|
5950
6081
|
return token;
|
|
5951
6082
|
}
|
|
5952
6083
|
};
|
|
6084
|
+
/**
|
|
6085
|
+
* The host writes the token file and rotates it, so it can be missing, empty
|
|
6086
|
+
* or stale for a while. The receiver keeps polling with backoff.
|
|
6087
|
+
*/
|
|
6088
|
+
function unavailableTokenFile(reason, source) {
|
|
6089
|
+
const definition = CommandReceiverConfigInvalidError.create({
|
|
6090
|
+
envVar: ENV_ALIEN_COMMANDS_TOKEN_FILE,
|
|
6091
|
+
reason
|
|
6092
|
+
});
|
|
6093
|
+
return new AlienError$1({
|
|
6094
|
+
code: definition.metadata.code,
|
|
6095
|
+
message: definition.metadata.message(definition.context),
|
|
6096
|
+
retryable: true,
|
|
6097
|
+
internal: definition.metadata.internal,
|
|
6098
|
+
httpStatusCode: definition.metadata.httpStatusCode,
|
|
6099
|
+
context: definition.context,
|
|
6100
|
+
source
|
|
6101
|
+
});
|
|
6102
|
+
}
|
|
5953
6103
|
var EnvironmentReceiverConnectionProvider = class {
|
|
5954
6104
|
config;
|
|
5955
6105
|
tokenSource;
|
|
6106
|
+
capability;
|
|
6107
|
+
credentialRotates;
|
|
6108
|
+
refreshesResponseContext;
|
|
5956
6109
|
constructor(config) {
|
|
5957
6110
|
this.config = config;
|
|
5958
|
-
this.
|
|
6111
|
+
if (config.capabilityFile !== void 0) this.capability = new CapabilityFile(config.capabilityFile);
|
|
6112
|
+
else this.tokenSource = new TokenSource(config.token, config.tokenFile);
|
|
6113
|
+
this.credentialRotates = config.capabilityFile !== void 0 || config.token === void 0;
|
|
6114
|
+
this.refreshesResponseContext = config.capabilityFile !== void 0;
|
|
5959
6115
|
}
|
|
5960
6116
|
async get() {
|
|
5961
|
-
return this.connection(await this.
|
|
6117
|
+
return this.connection(await this.readToken());
|
|
5962
6118
|
}
|
|
5963
|
-
async refresh() {
|
|
5964
|
-
|
|
6119
|
+
async refresh(_signal, rejected) {
|
|
6120
|
+
if (this.capability !== void 0) {
|
|
6121
|
+
if (rejected !== void 0) this.capability.reject(rejected.token);
|
|
6122
|
+
return this.connection(await this.capability.read());
|
|
6123
|
+
}
|
|
6124
|
+
const token = await this.tokenSource?.refresh();
|
|
5965
6125
|
return token === void 0 ? void 0 : this.connection(token);
|
|
5966
6126
|
}
|
|
6127
|
+
reject(rejected) {
|
|
6128
|
+
this.capability?.reject(rejected.token);
|
|
6129
|
+
}
|
|
6130
|
+
readToken() {
|
|
6131
|
+
return (this.capability ?? this.tokenSource).read();
|
|
6132
|
+
}
|
|
5967
6133
|
connection(token) {
|
|
5968
6134
|
return {
|
|
5969
6135
|
url: this.config.url,
|
|
@@ -6014,7 +6180,9 @@ var HostedReceiverConnectionProvider = class {
|
|
|
6014
6180
|
*
|
|
6015
6181
|
* Pure `fetch`; no bindings. The receiver implements these public
|
|
6016
6182
|
* command-delivery semantics:
|
|
6017
|
-
* - required identity plus token
|
|
6183
|
+
* - required identity plus a token, a token file or (with
|
|
6184
|
+
* `ALIEN_IDENTITY_PROVIDER=capabilityFile`) a short-lived capability file,
|
|
6185
|
+
* with fail-fast validation
|
|
6018
6186
|
* - execution budget = `min(envelope.deadline, leaseExpiresAt − safety margin)`;
|
|
6019
6187
|
* on expiry the handler's `signal` fires and a `HANDLER_TIMEOUT` is submitted
|
|
6020
6188
|
* - error codes `UNKNOWN_COMMAND` / handler `error.code` (falling back to
|
|
@@ -6067,6 +6235,8 @@ const LEASE_SAFETY_MARGIN_MS = 5e3;
|
|
|
6067
6235
|
* timeout.
|
|
6068
6236
|
*/
|
|
6069
6237
|
const CONTROL_TIMEOUT_MS = 3e4;
|
|
6238
|
+
/** Size cap on the refreshed response context, as in the Rust receiver. */
|
|
6239
|
+
const MAX_RESPONSE_CONTEXT_BYTES = 65536;
|
|
6070
6240
|
function createCommandReceiver(options = {}) {
|
|
6071
6241
|
if (!("deploymentId" in options || "apiKey" in options || "target" in options)) {
|
|
6072
6242
|
if ((options.env ?? (typeof process !== "undefined" ? process.env : {})).ALIEN_COMMANDS_DISABLED === "true") return new DisabledCommandReceiver();
|
|
@@ -6242,7 +6412,7 @@ var PullCommandReceiver = class {
|
|
|
6242
6412
|
throw new AlienError$1({
|
|
6243
6413
|
code: definition.metadata.code,
|
|
6244
6414
|
message: definition.metadata.message(context),
|
|
6245
|
-
retryable: response.status === 408 || response.status === 429 || response.status >= 500,
|
|
6415
|
+
retryable: response.status === 408 || response.status === 429 || response.status >= 500 || response.status === 401 && this.connectionProvider.credentialRotates === true,
|
|
6246
6416
|
internal: definition.metadata.internal,
|
|
6247
6417
|
httpStatusCode: definition.metadata.httpStatusCode,
|
|
6248
6418
|
context
|
|
@@ -6286,7 +6456,7 @@ var PullCommandReceiver = class {
|
|
|
6286
6456
|
const handlerStatus = commandResponseStatus(response);
|
|
6287
6457
|
let submitStatus = "submitted";
|
|
6288
6458
|
try {
|
|
6289
|
-
await this.submitResponse(lease.envelope, response, lease.leaseExpiresAt);
|
|
6459
|
+
await this.submitResponse(lease.envelope, response, lease.leaseExpiresAt, lease.leaseId);
|
|
6290
6460
|
} catch (error) {
|
|
6291
6461
|
submitStatus = "failed";
|
|
6292
6462
|
logError(`Failed to submit response for command '${lease.commandId}'`, error);
|
|
@@ -6351,7 +6521,59 @@ var PullCommandReceiver = class {
|
|
|
6351
6521
|
logWarn(`Failed to release command lease '${leaseId}'`, error);
|
|
6352
6522
|
}
|
|
6353
6523
|
}
|
|
6354
|
-
|
|
6524
|
+
/**
|
|
6525
|
+
* Fetch fresh response authority for a running command (twin of the Rust
|
|
6526
|
+
* `refresh_response_context`). The receiver's current bearer authorizes it.
|
|
6527
|
+
*/
|
|
6528
|
+
async refreshResponseContext(envelope, leaseId, signal) {
|
|
6529
|
+
let leaseEndpoint = "";
|
|
6530
|
+
const { response, endpoint } = await this.authenticatedFetch((connection) => {
|
|
6531
|
+
leaseEndpoint = buildLeaseEndpoint(connection.url);
|
|
6532
|
+
const url = new URL(leaseEndpoint);
|
|
6533
|
+
const segments = url.pathname.split("/");
|
|
6534
|
+
segments.pop();
|
|
6535
|
+
segments.push(encodeURIComponent(envelope.commandId), "response-context");
|
|
6536
|
+
url.pathname = segments.join("/");
|
|
6537
|
+
url.searchParams.append("leaseId", leaseId);
|
|
6538
|
+
return {
|
|
6539
|
+
endpoint: url.toString(),
|
|
6540
|
+
init: {
|
|
6541
|
+
method: "GET",
|
|
6542
|
+
signal
|
|
6543
|
+
}
|
|
6544
|
+
};
|
|
6545
|
+
});
|
|
6546
|
+
if (!response.ok) {
|
|
6547
|
+
const context = {
|
|
6548
|
+
method: "GET",
|
|
6549
|
+
url: redactUrlForError(endpoint),
|
|
6550
|
+
status: response.status,
|
|
6551
|
+
statusText: response.statusText
|
|
6552
|
+
};
|
|
6553
|
+
const definition = ManagerHttpError.create(context);
|
|
6554
|
+
throw new AlienError$1({
|
|
6555
|
+
code: definition.metadata.code,
|
|
6556
|
+
message: definition.metadata.message(context),
|
|
6557
|
+
retryable: false,
|
|
6558
|
+
internal: definition.metadata.internal,
|
|
6559
|
+
httpStatusCode: definition.metadata.httpStatusCode,
|
|
6560
|
+
context
|
|
6561
|
+
});
|
|
6562
|
+
}
|
|
6563
|
+
const text = await response.text();
|
|
6564
|
+
if (text.length > MAX_RESPONSE_CONTEXT_BYTES) throw new AlienError$1(InvalidEnvelopeError.create({
|
|
6565
|
+
field: "responseHandling",
|
|
6566
|
+
reason: "Command response context exceeds its size limit"
|
|
6567
|
+
}));
|
|
6568
|
+
const responseHandling = parseWireResponse(ResponseHandlingSchema, JSON.parse(text), "GET", redactUrlForError(endpoint));
|
|
6569
|
+
const refreshed = {
|
|
6570
|
+
...envelope,
|
|
6571
|
+
responseHandling
|
|
6572
|
+
};
|
|
6573
|
+
resolveEnvelopeUrls(refreshed, leaseEndpoint);
|
|
6574
|
+
return refreshed;
|
|
6575
|
+
}
|
|
6576
|
+
async submitResponse(envelope, response, leaseExpiresAt, leaseId) {
|
|
6355
6577
|
const remainingLeaseMs = new Date(leaseExpiresAt).getTime() - Date.now();
|
|
6356
6578
|
if (remainingLeaseMs <= 0) throw new AlienError$1(StorageOperationFailedError.create({
|
|
6357
6579
|
operation: "upload",
|
|
@@ -6361,6 +6583,7 @@ var PullCommandReceiver = class {
|
|
|
6361
6583
|
const submissionTimeoutMs = Math.min(CONTROL_TIMEOUT_MS, remainingLeaseMs);
|
|
6362
6584
|
const submissionSignal = AbortSignal.timeout(submissionTimeoutMs);
|
|
6363
6585
|
let finalResponse = response;
|
|
6586
|
+
if (this.connectionProvider.refreshesResponseContext === true) envelope = await this.refreshResponseContext(envelope, leaseId, submissionSignal);
|
|
6364
6587
|
if (response.status === "success" && response.response.mode === "inline") {
|
|
6365
6588
|
const bytes = base64ToBytes(response.response.inlineBase64);
|
|
6366
6589
|
const maxInline = envelope.responseHandling.maxInlineBytes;
|
|
@@ -51,7 +51,15 @@ export interface ReceiverConnection {
|
|
|
51
51
|
resourceId: string;
|
|
52
52
|
resourceType: Exclude<CommandTargetType, "worker">;
|
|
53
53
|
}
|
|
54
|
-
export type ReceiverConnectionProvider = RefreshingConnectionProvider<ReceiverConnection
|
|
54
|
+
export type ReceiverConnectionProvider = RefreshingConnectionProvider<ReceiverConnection> & {
|
|
55
|
+
/** The credential is a file the host rotates; a rejection may clear later. */
|
|
56
|
+
readonly credentialRotates?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The credential is short-lived, so the authority to submit a result is
|
|
59
|
+
* fetched again from the manager just before the result is sent.
|
|
60
|
+
*/
|
|
61
|
+
readonly refreshesResponseContext?: boolean;
|
|
62
|
+
};
|
|
55
63
|
export declare function resolveReceiverConfig(options: CommandReceiverOptions | HostedCommandReceiverOptions): {
|
|
56
64
|
connectionProvider: ReceiverConnectionProvider;
|
|
57
65
|
runtimeConfig: ReceiverRuntimeConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receiver-config.d.ts","sourceRoot":"","sources":["../src/receiver-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,4BAA4B,EAClC,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"receiver-config.d.ts","sourceRoot":"","sources":["../src/receiver-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,4BAA4B,EAClC,MAAM,gBAAgB,CAAA;AAGvB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAWtD,eAAO,MAAM,sBAAsB,uBAAuB,CAAA;AAe1D,MAAM,WAAW,6BAA6B;IAC5C,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;IACpB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,6BAA6B;IAC3E,sDAAsD;IACtD,GA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
* command-delivery semantics:
|
|
12
|
-
* - required identity plus token
|
|
12
|
+
* - required identity plus a token, a token file or (with
|
|
13
|
+
* `ALIEN_IDENTITY_PROVIDER=capabilityFile`) a short-lived capability file,
|
|
14
|
+
* with fail-fast validation
|
|
13
15
|
* - execution budget = `min(envelope.deadline, leaseExpiresAt − safety margin)`;
|
|
14
16
|
* on expiry the handler's `signal` fires and a `HANDLER_TIMEOUT` is submitted
|
|
15
17
|
* - error codes `UNKNOWN_COMMAND` / handler `error.code` (falling back to
|
package/dist/receiver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receiver.d.ts","sourceRoot":"","sources":["../src/receiver.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"receiver.d.ts","sourceRoot":"","sources":["../src/receiver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAWH,OAAO,KAAK,EAGV,iBAAiB,EACjB,QAAQ,EAIR,YAAY,EACb,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,KAAK,sBAAsB,EAG3B,KAAK,4BAA4B,EAKlC,MAAM,sBAAsB,CAAA;AAG7B,YAAY,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAA;AAUhG,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B,oBAAoB,CAAA;AAC3D,wEAAwE;AACxE,eAAO,MAAM,0BAA0B,oBAAoB,CAAA;AAC3D,+FAA+F;AAC/F,eAAO,MAAM,wBAAwB,kBAAkB,CAAA;AAqBvD;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,KAAK,EAAE,UAAU,CAAA;IACjB;;;;OAIG;IACH,MAAM,EAAE,WAAW,CAAA;IACnB;;;OAGG;IACH,QAAQ,EAAE,IAAI,CAAA;IACd,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,gDAAgD;IAChD,MAAM,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sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAM7E;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAoCnF;AA4GD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,KAAK,EACvB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAqBrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alienplatform/commands",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.63",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
],
|
|
28
28
|
"author": "Alien Software, Inc. <hi@alien.dev>",
|
|
29
29
|
"license": "FSL-1.1-Apache-2.0",
|
|
30
|
+
"alien": {
|
|
31
|
+
"commandsCapabilityFile": true
|
|
32
|
+
},
|
|
30
33
|
"description": "Pure-TypeScript command sender and pull receiver for the Alien platform, over fetch",
|
|
31
34
|
"homepage": "https://alien.dev",
|
|
32
35
|
"repository": {
|
|
@@ -47,7 +50,7 @@
|
|
|
47
50
|
"@alienplatform/typescript-config": "^1.0.0"
|
|
48
51
|
},
|
|
49
52
|
"dependencies": {
|
|
50
|
-
"@alienplatform/core": "^3.3.
|
|
53
|
+
"@alienplatform/core": "^3.3.63"
|
|
51
54
|
},
|
|
52
55
|
"scripts": {
|
|
53
56
|
"build": "tsdown && tsc -p tsconfig.build.json --emitDeclarationOnly",
|