@knowttl/artium-axi 0.0.14 → 0.0.16
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 -4
- package/bin/artium-axi.mjs +679 -106
- package/package.json +1 -1
package/bin/artium-axi.mjs
CHANGED
|
@@ -6,9 +6,9 @@ var __export = (target, all) => {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
// src/cli/main.ts
|
|
9
|
-
import { randomUUID as
|
|
9
|
+
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
10
10
|
import { homedir as homedir3 } from "node:os";
|
|
11
|
-
import { resolve as
|
|
11
|
+
import { resolve as resolve4, relative, sep, isAbsolute as isAbsolute2 } from "node:path";
|
|
12
12
|
|
|
13
13
|
// node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/external.js
|
|
14
14
|
var external_exports = {};
|
|
@@ -5036,7 +5036,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
5036
5036
|
var NONE = 0;
|
|
5037
5037
|
var ASSUMED = 1;
|
|
5038
5038
|
var PROVEN = 2;
|
|
5039
|
-
function isRecursive(inst, stack,
|
|
5039
|
+
function isRecursive(inst, stack, resolve5) {
|
|
5040
5040
|
const cached2 = recursive.get(inst);
|
|
5041
5041
|
if (cached2 !== void 0)
|
|
5042
5042
|
return cached2 ? PROVEN : NONE;
|
|
@@ -5046,7 +5046,7 @@ function isRecursive(inst, stack, resolve4) {
|
|
|
5046
5046
|
let result = NONE;
|
|
5047
5047
|
const check2 = (child) => {
|
|
5048
5048
|
if (result !== PROVEN && child?._zod) {
|
|
5049
|
-
const answer = isRecursive(child, stack,
|
|
5049
|
+
const answer = isRecursive(child, stack, resolve5);
|
|
5050
5050
|
if (answer > result)
|
|
5051
5051
|
result = answer;
|
|
5052
5052
|
}
|
|
@@ -5057,7 +5057,7 @@ function isRecursive(inst, stack, resolve4) {
|
|
|
5057
5057
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
5058
5058
|
if (spread && !desc.enumerable)
|
|
5059
5059
|
continue;
|
|
5060
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
5060
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve5) : NONE;
|
|
5061
5061
|
if (child > answer)
|
|
5062
5062
|
answer = child;
|
|
5063
5063
|
}
|
|
@@ -5121,7 +5121,7 @@ function isRecursive(inst, stack, resolve4) {
|
|
|
5121
5121
|
break;
|
|
5122
5122
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
5123
5123
|
case "lazy": {
|
|
5124
|
-
const inner = def._cachedInner ?? (
|
|
5124
|
+
const inner = def._cachedInner ?? (resolve5 ? inst._zod.innerType : void 0);
|
|
5125
5125
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
5126
5126
|
break;
|
|
5127
5127
|
}
|
|
@@ -19679,11 +19679,12 @@ function date4(params) {
|
|
|
19679
19679
|
}
|
|
19680
19680
|
|
|
19681
19681
|
// src/shared/errors.ts
|
|
19682
|
+
var cliOutdatedDownloadNext = "Download the current CLI from /cli/artium-axi.mjs on this server, verify it with the SHA-256 checksum at /cli/artium-axi.mjs.sha256, and install it as artium-axi.";
|
|
19682
19683
|
var definitions = {
|
|
19683
19684
|
STORE_SCHEMA_INVALID: { status: 503, message: "The store schema is unsupported by this image.", next: "Use the matching image, or restore the pre-upgrade backup into a new volume with its matching image and key." },
|
|
19684
19685
|
BACKUP_FAILED: { status: 500, message: "Database backup did not complete.", next: "Check the source store and a writable backup directory; choose a new output file." },
|
|
19685
19686
|
RESTORE_FAILED: { status: 500, message: "Database restore did not complete.", next: "Stop the destination server and use an empty new data volume, an intact backup and its matching master key." },
|
|
19686
|
-
CLI_OUTDATED: { status: 426, message: "The CLI version is too old for this server.", next:
|
|
19687
|
+
CLI_OUTDATED: { status: 426, message: "The CLI version is too old for this server.", next: cliOutdatedDownloadNext },
|
|
19687
19688
|
CERTIFICATE_INVALID: { status: 503, message: "The server certificate could not be verified.", next: "Check certificate trust or set ARTIUM_AXI_CA_FILE to the trusted CA file." },
|
|
19688
19689
|
ADMIN_REQUIRED: { status: 403, message: "Administrator capability is required.", next: "Ask an administrator to perform this operation." },
|
|
19689
19690
|
REVISION_CONFLICT: { status: 409, message: "The record changed since it was read.", next: "Read the current record revision and retry your edit." },
|
|
@@ -19719,6 +19720,9 @@ var definitions = {
|
|
|
19719
19720
|
PASSWORD_CHANGE_REQUIRED: { status: 409, message: "Change your temporary password before using tools.", next: "Run artium-axi passwd --password-stdin." },
|
|
19720
19721
|
SERVER_UNAVAILABLE: { status: 503, message: "The CLI could not receive a server response.", next: "Check the server address and certificate trust; confirm the previous call outcome before retrying." },
|
|
19721
19722
|
INVALID_RESPONSE: { status: 500, message: "The server returned an invalid response.", next: "Check the server URL and API version." },
|
|
19723
|
+
KEY_LEVEL_RESTRICTED: { status: 403, message: "HTTP 403: restricted key cannot download.", next: "Request vetted-account download access. Administrator write settings cannot grant upstream entitlement. No other key or route was tried." },
|
|
19724
|
+
PERMISSION_DENIED: { status: 403, message: "HTTP 403: download denied; key level unknown.", next: "Check upstream entitlement and request account vetting where required. Administrator write settings cannot grant upstream entitlement. No other key or route was tried." },
|
|
19725
|
+
ARTIFACT_SAVE_FAILED: { status: 400, message: "The archive was not verified and saved.", next: "Check the dedicated private destination directory. Start a fresh preview and confirmation; interrupted transfers cannot be retried." },
|
|
19722
19726
|
DEV_AUTH_INVALID: { status: 503, message: "Development authentication settings are unsupported.", next: "Remove ARTIUM_AXI_DEV and ARTIUM_AXI_DEV_TOKEN_FILE and use local sign-in." },
|
|
19723
19727
|
PROXY_HEADERS_UNTRUSTED: { status: 400, message: "Forwarding headers came from an untrusted address.", next: "Connect through the configured trusted proxy or remove forwarding headers." },
|
|
19724
19728
|
NOT_FOUND: { status: 404, message: "The endpoint does not exist.", next: "Use a supported API endpoint and tool name." },
|
|
@@ -19781,6 +19785,103 @@ var inputLimits = {
|
|
|
19781
19785
|
totalFileBytes: 4 * 1024 * 1024,
|
|
19782
19786
|
files: 8
|
|
19783
19787
|
};
|
|
19788
|
+
var transferLimits = {
|
|
19789
|
+
artifactBytes: 250 * 1024 * 1024,
|
|
19790
|
+
reservationsPerUser: 1,
|
|
19791
|
+
reservations: 4,
|
|
19792
|
+
reservedBytes: 1024 * 1024 * 1024,
|
|
19793
|
+
lifetimeMs: 10 * 60 * 1e3
|
|
19794
|
+
};
|
|
19795
|
+
var transferWarning = "Live malware: this archive may contain executable malware. Save only; do not extract or execute. Password protection is unverified; bytes are saved exactly as provided.";
|
|
19796
|
+
var sha256Schema = external_exports.string().regex(/^[a-f0-9]{64}$/);
|
|
19797
|
+
var sampleSha256Schema = external_exports.string().regex(/^[a-f0-9]{64}$/i);
|
|
19798
|
+
var reportIdSchema = external_exports.string().regex(/^(?:[A-Za-z0-9_-]{1,256}|[a-f0-9]{64}:\d+)$/i);
|
|
19799
|
+
var transferOwnerIdSchema = external_exports.string().regex(/^[A-Za-z0-9_-]{1,256}$/);
|
|
19800
|
+
var transferSelectionSchema = external_exports.discriminatedUnion("operation", [
|
|
19801
|
+
external_exports.strictObject({ operation: external_exports.literal("hash-download-bin"), selector: sampleSha256Schema, type: external_exports.literal("bin") }),
|
|
19802
|
+
external_exports.strictObject({ operation: external_exports.literal("report-download-bin"), selector: reportIdSchema, type: external_exports.literal("bin") }),
|
|
19803
|
+
external_exports.strictObject({ operation: external_exports.literal("report-download-dropped-files"), selector: reportIdSchema, type: external_exports.literal("dropped-files") }),
|
|
19804
|
+
external_exports.strictObject({ operation: external_exports.literal("report-download-memory"), selector: reportIdSchema, type: external_exports.literal("memory") })
|
|
19805
|
+
]);
|
|
19806
|
+
var transferPrepareSchema = external_exports.strictObject({ selection: transferSelectionSchema, targetDigest: sha256Schema });
|
|
19807
|
+
var transferIdSchema = external_exports.uuid();
|
|
19808
|
+
var transferScopeSchema = external_exports.strictObject({
|
|
19809
|
+
transferId: transferIdSchema,
|
|
19810
|
+
userId: transferOwnerIdSchema,
|
|
19811
|
+
sessionFamilyId: transferOwnerIdSchema,
|
|
19812
|
+
credentialRevision: external_exports.number().int().positive(),
|
|
19813
|
+
selection: transferSelectionSchema,
|
|
19814
|
+
targetDigest: sha256Schema,
|
|
19815
|
+
preparedAt: external_exports.number().int().nonnegative(),
|
|
19816
|
+
expiresAt: external_exports.number().int().nonnegative()
|
|
19817
|
+
}).refine((scope) => scope.expiresAt === scope.preparedAt + transferLimits.lifetimeMs);
|
|
19818
|
+
var transferPreviewSchema = external_exports.strictObject({
|
|
19819
|
+
transferId: transferIdSchema,
|
|
19820
|
+
expiresAt: external_exports.number().int(),
|
|
19821
|
+
confirm: external_exports.string().min(1).max(64 * 1024),
|
|
19822
|
+
warnings: external_exports.array(external_exports.string()),
|
|
19823
|
+
targetDigest: sha256Schema
|
|
19824
|
+
});
|
|
19825
|
+
var transferExecuteSchema = external_exports.strictObject({
|
|
19826
|
+
transferId: transferIdSchema,
|
|
19827
|
+
selection: transferSelectionSchema,
|
|
19828
|
+
targetDigest: sha256Schema,
|
|
19829
|
+
execute: external_exports.literal(true),
|
|
19830
|
+
confirm: external_exports.string().min(1).max(64 * 1024)
|
|
19831
|
+
});
|
|
19832
|
+
var transferRetrieveSchema = transferPrepareSchema.extend({ transferId: transferIdSchema });
|
|
19833
|
+
var transferOutcomeSchema = external_exports.enum([
|
|
19834
|
+
"preview",
|
|
19835
|
+
"denied-not-sent",
|
|
19836
|
+
"native-outcome-unknown",
|
|
19837
|
+
"upstream-failure",
|
|
19838
|
+
"ready",
|
|
19839
|
+
"delivery-completed",
|
|
19840
|
+
"delivery-interrupted",
|
|
19841
|
+
"expired",
|
|
19842
|
+
"deleted",
|
|
19843
|
+
"interrupted"
|
|
19844
|
+
]);
|
|
19845
|
+
var transferSaveOutcomeSchema = external_exports.enum(["unconfirmed", "verified-save", "save-failed"]);
|
|
19846
|
+
var transferArchiveSchema = external_exports.strictObject({
|
|
19847
|
+
archiveBytes: external_exports.number().int().nonnegative().max(transferLimits.artifactBytes),
|
|
19848
|
+
archiveSha256: sha256Schema
|
|
19849
|
+
});
|
|
19850
|
+
var transferReceiptSchema = transferRetrieveSchema.extend({
|
|
19851
|
+
archive: transferArchiveSchema,
|
|
19852
|
+
saveOutcome: external_exports.enum(["verified-save", "save-failed"])
|
|
19853
|
+
});
|
|
19854
|
+
var transferEvidenceSchema = external_exports.strictObject({
|
|
19855
|
+
outcome: transferOutcomeSchema,
|
|
19856
|
+
archive: transferArchiveSchema.nullable(),
|
|
19857
|
+
saveOutcome: transferSaveOutcomeSchema
|
|
19858
|
+
}).refine((evidence) => !["ready", "delivery-completed"].includes(evidence.outcome) || evidence.archive !== null).refine((evidence) => !["preview", "denied-not-sent", "native-outcome-unknown", "upstream-failure"].includes(evidence.outcome) || evidence.archive === null).refine((evidence) => evidence.saveOutcome !== "verified-save" || evidence.archive !== null);
|
|
19859
|
+
var transferStatusSchema = transferEvidenceSchema.safeExtend({ transferId: transferIdSchema, expiresAt: external_exports.number().int() });
|
|
19860
|
+
var transferRoutes = {
|
|
19861
|
+
prepare: { method: "POST", path: "/v1/transfers/hybrid/prepare", input: transferPrepareSchema, response: transferPreviewSchema },
|
|
19862
|
+
execute: { method: "POST", path: "/v1/transfers/hybrid/execute", input: transferExecuteSchema, response: transferStatusSchema },
|
|
19863
|
+
retrieve: { method: "POST", path: "/v1/transfers/hybrid/retrieve", input: transferRetrieveSchema },
|
|
19864
|
+
receipt: { method: "POST", path: "/v1/transfers/hybrid/receipt", input: transferReceiptSchema },
|
|
19865
|
+
cancel: { method: "POST", path: "/v1/transfers/hybrid/cancel", input: transferRetrieveSchema },
|
|
19866
|
+
status: { method: "POST", path: "/v1/transfers/hybrid/status", input: transferRetrieveSchema, response: transferStatusSchema }
|
|
19867
|
+
};
|
|
19868
|
+
var transferAuditSchema = external_exports.strictObject({
|
|
19869
|
+
transfer_id: transferIdSchema,
|
|
19870
|
+
session_family_id: transferOwnerIdSchema,
|
|
19871
|
+
transfer_operation: transferSelectionSchema.options[0].shape.operation.or(transferSelectionSchema.options[1].shape.operation).or(transferSelectionSchema.options[2].shape.operation).or(transferSelectionSchema.options[3].shape.operation),
|
|
19872
|
+
artifact_type: external_exports.enum(["bin", "dropped-files", "memory"]),
|
|
19873
|
+
artifact_selector: sha256Schema.or(reportIdSchema),
|
|
19874
|
+
requested_target_digest: sha256Schema,
|
|
19875
|
+
archive_bytes: external_exports.number().int().nonnegative().max(transferLimits.artifactBytes).nullable(),
|
|
19876
|
+
archive_sha256: sha256Schema.nullable(),
|
|
19877
|
+
native_audit_id: external_exports.uuid().nullable(),
|
|
19878
|
+
native_journal_result: external_exports.enum(["SUCCESS", "FAILED", "NOT_SENT", "OUTCOME_UNKNOWN"]).nullable(),
|
|
19879
|
+
client_save_outcome: transferSaveOutcomeSchema
|
|
19880
|
+
}).refine((fields) => fields.archive_bytes === null === (fields.archive_sha256 === null)).refine((fields) => transferSelectionSchema.safeParse({
|
|
19881
|
+
operation: fields.transfer_operation,
|
|
19882
|
+
type: fields.artifact_type,
|
|
19883
|
+
selector: fields.artifact_selector
|
|
19884
|
+
}).success);
|
|
19784
19885
|
var byteLength = (value) => new TextEncoder().encode(value).length;
|
|
19785
19886
|
var passwordSchema = external_exports.string().min(1).refine((value) => byteLength(value) <= 512, "Expected at most 512 UTF-8 bytes");
|
|
19786
19887
|
var passwordChangeSchema = external_exports.strictObject({ newPassword: external_exports.string(), currentPassword: external_exports.string().optional() });
|
|
@@ -19998,7 +20099,8 @@ var auditFiltersSchema = external_exports.strictObject({
|
|
|
19998
20099
|
event: external_exports.string().min(1).max(100).optional(),
|
|
19999
20100
|
outcome: external_exports.string().min(1).max(100).optional(),
|
|
20000
20101
|
from: external_exports.iso.datetime().optional(),
|
|
20001
|
-
to: external_exports.iso.datetime().optional()
|
|
20102
|
+
to: external_exports.iso.datetime().optional(),
|
|
20103
|
+
errorCode: external_exports.string().min(1).max(100).optional()
|
|
20002
20104
|
});
|
|
20003
20105
|
var orderedAuditRange = (input2) => !input2.from || !input2.to || Date.parse(input2.from) <= Date.parse(input2.to);
|
|
20004
20106
|
var adminAuditQuerySchema = auditFiltersSchema.extend({
|
|
@@ -20036,7 +20138,18 @@ var adminAuditRecordSchema = external_exports.strictObject({
|
|
|
20036
20138
|
error_code: external_exports.string().nullable(),
|
|
20037
20139
|
authentication_method: external_exports.string().nullable(),
|
|
20038
20140
|
provider_id: external_exports.string().nullable(),
|
|
20039
|
-
subject: external_exports.string().nullable()
|
|
20141
|
+
subject: external_exports.string().nullable(),
|
|
20142
|
+
transfer_id: transferIdSchema.nullable(),
|
|
20143
|
+
session_family_id: external_exports.string().nullable(),
|
|
20144
|
+
transfer_operation: external_exports.string().nullable(),
|
|
20145
|
+
artifact_type: external_exports.string().nullable(),
|
|
20146
|
+
artifact_selector: external_exports.string().nullable(),
|
|
20147
|
+
requested_target_digest: sha256Schema.nullable(),
|
|
20148
|
+
archive_bytes: external_exports.number().int().nullable(),
|
|
20149
|
+
archive_sha256: sha256Schema.nullable(),
|
|
20150
|
+
native_audit_id: external_exports.string().nullable(),
|
|
20151
|
+
native_journal_result: external_exports.string().nullable(),
|
|
20152
|
+
client_save_outcome: transferSaveOutcomeSchema.nullable()
|
|
20040
20153
|
});
|
|
20041
20154
|
var adminAuditRoute = {
|
|
20042
20155
|
method: "GET",
|
|
@@ -20117,7 +20230,7 @@ var diagnosticSchema = external_exports.strictObject({
|
|
|
20117
20230
|
credentialRevision: external_exports.number().int().nullable().optional()
|
|
20118
20231
|
});
|
|
20119
20232
|
var healthSchema = external_exports.strictObject({
|
|
20120
|
-
status: external_exports.enum(["unconfigured", "unknown", "ok", "error", "disabled"]),
|
|
20233
|
+
status: external_exports.enum(["unconfigured", "unknown", "checking", "ok", "error", "disabled"]),
|
|
20121
20234
|
diagnostic: diagnosticSchema.optional(),
|
|
20122
20235
|
readOnly: external_exports.boolean().default(true),
|
|
20123
20236
|
checkedAt: external_exports.number().int().nullable(),
|
|
@@ -20575,7 +20688,7 @@ var toolsResponseSchema = external_exports.strictObject({
|
|
|
20575
20688
|
name: toolSchema,
|
|
20576
20689
|
version: external_exports.string(),
|
|
20577
20690
|
readOnly: external_exports.boolean().default(true),
|
|
20578
|
-
status: external_exports.enum(["unconfigured", "unknown", "ok", "error", "disabled"])
|
|
20691
|
+
status: external_exports.enum(["unconfigured", "unknown", "checking", "ok", "error", "disabled"])
|
|
20579
20692
|
}))
|
|
20580
20693
|
});
|
|
20581
20694
|
var inputFileSchema = external_exports.strictObject({
|
|
@@ -20624,7 +20737,6 @@ var runResponseSchema = external_exports.union([runSuccessSchema, errorResponseS
|
|
|
20624
20737
|
|
|
20625
20738
|
// src/cli/http.ts
|
|
20626
20739
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
20627
|
-
import { request as httpRequest } from "node:http";
|
|
20628
20740
|
import { request as httpsRequest } from "node:https";
|
|
20629
20741
|
import { rootCertificates } from "node:tls";
|
|
20630
20742
|
import { resolve } from "node:path";
|
|
@@ -20632,7 +20744,7 @@ import { resolve } from "node:path";
|
|
|
20632
20744
|
// package.json
|
|
20633
20745
|
var package_default = {
|
|
20634
20746
|
name: "artium-axi",
|
|
20635
|
-
version: "0.0.
|
|
20747
|
+
version: "0.0.16",
|
|
20636
20748
|
private: true,
|
|
20637
20749
|
license: "MIT",
|
|
20638
20750
|
type: "module",
|
|
@@ -20821,8 +20933,8 @@ var SessionStore = class {
|
|
|
20821
20933
|
while (true) {
|
|
20822
20934
|
const watcher = watch(this.directory);
|
|
20823
20935
|
let timer;
|
|
20824
|
-
const changed = new Promise((
|
|
20825
|
-
watcher.once("change", () =>
|
|
20936
|
+
const changed = new Promise((resolve5, reject) => {
|
|
20937
|
+
watcher.once("change", () => resolve5());
|
|
20826
20938
|
watcher.once("error", () => reject(new ArtiumError("SESSION_STORAGE_UNAVAILABLE")));
|
|
20827
20939
|
timer = setTimeout(() => reject(new ArtiumError("SESSION_BUSY")), Math.max(0, deadline - Date.now()));
|
|
20828
20940
|
});
|
|
@@ -20848,6 +20960,8 @@ var SessionStore = class {
|
|
|
20848
20960
|
};
|
|
20849
20961
|
|
|
20850
20962
|
// src/cli/http.ts
|
|
20963
|
+
var { request: httpRequest } = process.getBuiltinModule("node:http");
|
|
20964
|
+
var ACCESS_EXPIRY_SKEW_MS = 3e4;
|
|
20851
20965
|
var DEFAULT_REQUEST_DEADLINE_MS = 9e4;
|
|
20852
20966
|
var Client = class {
|
|
20853
20967
|
constructor(environment = process.env, managed2, requestDeadlineMs = DEFAULT_REQUEST_DEADLINE_MS) {
|
|
@@ -20870,6 +20984,10 @@ var Client = class {
|
|
|
20870
20984
|
}
|
|
20871
20985
|
managed;
|
|
20872
20986
|
requestDeadlineMs;
|
|
20987
|
+
cancellation = new AbortController();
|
|
20988
|
+
cancel() {
|
|
20989
|
+
this.cancellation.abort();
|
|
20990
|
+
}
|
|
20873
20991
|
serverUrl;
|
|
20874
20992
|
serverUrlSource;
|
|
20875
20993
|
caFile;
|
|
@@ -20879,7 +20997,7 @@ var Client = class {
|
|
|
20879
20997
|
return this.storedSessions;
|
|
20880
20998
|
}
|
|
20881
20999
|
certificateVerified = false;
|
|
20882
|
-
async request(path, method, input2, token, bytes = false) {
|
|
21000
|
+
async request(path, method, input2, token, bytes = false, headers = {}) {
|
|
20883
21001
|
this.certificateVerified = false;
|
|
20884
21002
|
let ca;
|
|
20885
21003
|
try {
|
|
@@ -20891,13 +21009,13 @@ var Client = class {
|
|
|
20891
21009
|
const controller = new AbortController();
|
|
20892
21010
|
const deadline = setTimeout(() => controller.abort(), this.requestDeadlineMs);
|
|
20893
21011
|
const url2 = new URL(`${this.serverUrl}${path}`);
|
|
20894
|
-
const result = await new Promise((
|
|
21012
|
+
const result = await new Promise((resolve5, reject) => {
|
|
20895
21013
|
const request = (url2.protocol === "https:" ? httpsRequest : httpRequest)(url2, {
|
|
20896
21014
|
method,
|
|
20897
21015
|
ca,
|
|
20898
21016
|
rejectUnauthorized: true,
|
|
20899
|
-
signal: controller.signal,
|
|
20900
|
-
headers: { "x-artium-cli-version": cliVersion, ...token ? { authorization: `Bearer ${token}` } : {}, ...body ? { "content-type": "application/json" } : {} }
|
|
21017
|
+
signal: AbortSignal.any([controller.signal, this.cancellation.signal]),
|
|
21018
|
+
headers: { ...headers, "x-artium-cli-version": cliVersion, ...token ? { authorization: `Bearer ${token}` } : {}, ...body ? { "content-type": "application/json" } : {} }
|
|
20901
21019
|
}, (response) => {
|
|
20902
21020
|
if (response.statusCode >= 300 && response.statusCode < 400) {
|
|
20903
21021
|
response.destroy();
|
|
@@ -20909,7 +21027,7 @@ var Client = class {
|
|
|
20909
21027
|
response.on("error", () => reject(new ArtiumError("SERVER_UNAVAILABLE")));
|
|
20910
21028
|
response.on("end", () => {
|
|
20911
21029
|
try {
|
|
20912
|
-
|
|
21030
|
+
resolve5({
|
|
20913
21031
|
status: response.statusCode,
|
|
20914
21032
|
body: bytes ? Buffer.concat(chunks) : response.statusCode === 204 ? void 0 : JSON.parse(Buffer.concat(chunks).toString("utf8")),
|
|
20915
21033
|
serverVersion: typeof response.headers["x-artium-cli-version"] === "string" ? response.headers["x-artium-cli-version"] : void 0
|
|
@@ -20959,9 +21077,13 @@ var Client = class {
|
|
|
20959
21077
|
(token) => this.request(path, method, input2, token),
|
|
20960
21078
|
(refreshToken) => this.request("/v1/auth/refresh", "POST", { refreshToken })
|
|
20961
21079
|
);
|
|
20962
|
-
|
|
21080
|
+
let session = previous ? this.reload(previous) : this.sessions.read();
|
|
20963
21081
|
if (!session) throw new ArtiumError("TOKEN_INVALID", void 0, "Run artium-axi login --username <username> --password-stdin.");
|
|
20964
21082
|
if (session.status === "password-change-required") throw new ArtiumError("PASSWORD_CHANGE_REQUIRED");
|
|
21083
|
+
if (session.accessExpiresAt <= Date.now() + ACCESS_EXPIRY_SKEW_MS) {
|
|
21084
|
+
const expiring = session;
|
|
21085
|
+
session = await this.sessions.locked(() => this.refresh(expiring));
|
|
21086
|
+
}
|
|
20965
21087
|
let result;
|
|
20966
21088
|
try {
|
|
20967
21089
|
result = await this.request(path, method, input2, session.accessToken);
|
|
@@ -20973,6 +21095,70 @@ var Client = class {
|
|
|
20973
21095
|
if (previous) this.reload(previous);
|
|
20974
21096
|
return result;
|
|
20975
21097
|
}
|
|
21098
|
+
// Transfers never refresh/replay a request, including an ambiguous execute or
|
|
21099
|
+
// a retrieval whose response was interrupted before headers arrived.
|
|
21100
|
+
async transferSession(work) {
|
|
21101
|
+
if (this.managed) return this.managed.once(work);
|
|
21102
|
+
const session = this.sessions.read();
|
|
21103
|
+
if (!session) throw new ArtiumError("TOKEN_INVALID");
|
|
21104
|
+
if (session.status !== "authenticated") throw new ArtiumError("PASSWORD_CHANGE_REQUIRED");
|
|
21105
|
+
return work(session.accessToken);
|
|
21106
|
+
}
|
|
21107
|
+
async artifact(path, input2, token, ticket, expiresAt, consume) {
|
|
21108
|
+
let ca;
|
|
21109
|
+
try {
|
|
21110
|
+
if (this.caFile) ca = [...rootCertificates, readFileSync2(this.caFile, "utf8")];
|
|
21111
|
+
} catch {
|
|
21112
|
+
throw new ArtiumError("CLIENT_CONFIG_INVALID");
|
|
21113
|
+
}
|
|
21114
|
+
const url2 = new URL(`${this.serverUrl}${path}`);
|
|
21115
|
+
const controller = new AbortController();
|
|
21116
|
+
const signal = AbortSignal.any([controller.signal, this.cancellation.signal]);
|
|
21117
|
+
const deadline = setTimeout(() => controller.abort(), Math.max(0, expiresAt - Date.now()));
|
|
21118
|
+
try {
|
|
21119
|
+
await new Promise((resolve5, reject) => {
|
|
21120
|
+
let incoming;
|
|
21121
|
+
const request = (url2.protocol === "https:" ? httpsRequest : httpRequest)(url2, {
|
|
21122
|
+
method: "POST",
|
|
21123
|
+
ca,
|
|
21124
|
+
rejectUnauthorized: true,
|
|
21125
|
+
signal,
|
|
21126
|
+
headers: {
|
|
21127
|
+
authorization: `Bearer ${token}`,
|
|
21128
|
+
"x-artium-cli-version": cliVersion,
|
|
21129
|
+
"x-artium-reauth-ticket": ticket,
|
|
21130
|
+
"accept-encoding": "identity",
|
|
21131
|
+
"content-type": "application/json"
|
|
21132
|
+
}
|
|
21133
|
+
}, (response) => {
|
|
21134
|
+
incoming = response;
|
|
21135
|
+
void (async () => {
|
|
21136
|
+
if (response.statusCode !== 200) {
|
|
21137
|
+
const chunks = [];
|
|
21138
|
+
let size = 0;
|
|
21139
|
+
for await (const chunk of response) {
|
|
21140
|
+
size += chunk.length;
|
|
21141
|
+
if (size > 64 * 1024) throw new ArtiumError("INVALID_RESPONSE");
|
|
21142
|
+
chunks.push(chunk);
|
|
21143
|
+
}
|
|
21144
|
+
const failure2 = errorResponseSchema.safeParse(JSON.parse(Buffer.concat(chunks).toString("utf8")));
|
|
21145
|
+
if (failure2.success) throw new ArtiumError(failure2.data.error.code, failure2.data.error.message, failure2.data.error.next);
|
|
21146
|
+
throw new ArtiumError("INVALID_RESPONSE");
|
|
21147
|
+
}
|
|
21148
|
+
await consume(response, signal);
|
|
21149
|
+
})().then(resolve5, reject).finally(() => response.destroy());
|
|
21150
|
+
});
|
|
21151
|
+
request.on("error", () => {
|
|
21152
|
+
const error62 = new ArtiumError("SERVER_UNAVAILABLE");
|
|
21153
|
+
if (incoming) incoming.destroy(error62);
|
|
21154
|
+
else reject(error62);
|
|
21155
|
+
});
|
|
21156
|
+
request.end(JSON.stringify(input2));
|
|
21157
|
+
});
|
|
21158
|
+
} finally {
|
|
21159
|
+
clearTimeout(deadline);
|
|
21160
|
+
}
|
|
21161
|
+
}
|
|
20976
21162
|
// The caller holds the session lock, including the reload after acquisition.
|
|
20977
21163
|
async refresh(previous) {
|
|
20978
21164
|
const current = this.reload(previous);
|
|
@@ -21021,13 +21207,13 @@ async function readPassword(stdin, environmentVariable) {
|
|
|
21021
21207
|
process.stdin.setRawMode(true);
|
|
21022
21208
|
process.stdin.resume();
|
|
21023
21209
|
try {
|
|
21024
|
-
return await new Promise((
|
|
21210
|
+
return await new Promise((resolve5, reject) => {
|
|
21025
21211
|
let password = "";
|
|
21026
21212
|
const keypress = (text2, key) => {
|
|
21027
21213
|
if (key.name === "return" || key.ctrl && key.name === "c") {
|
|
21028
21214
|
process.stdin.off("keypress", keypress);
|
|
21029
21215
|
if (key.ctrl) reject(new ArtiumError("CANCELLED"));
|
|
21030
|
-
else
|
|
21216
|
+
else resolve5(password);
|
|
21031
21217
|
} else if (key.name === "backspace") password = Array.from(password).slice(0, -1).join("");
|
|
21032
21218
|
else if (text2 && !key.ctrl && !new RegExp("\\p{Cc}", "u").test(text2)) password += text2;
|
|
21033
21219
|
};
|
|
@@ -24835,10 +25021,10 @@ var vectra_axi_default = {
|
|
|
24835
25021
|
var az_axi_default = {
|
|
24836
25022
|
generatedBy: "scripts/upstream-inventory.mjs",
|
|
24837
25023
|
tool: "az-axi",
|
|
24838
|
-
version: "0.1.
|
|
24839
|
-
integrity: "sha512-
|
|
25024
|
+
version: "0.1.11",
|
|
25025
|
+
integrity: "sha512-XiCwLaSh6A6xb9sk7RQ7T3FvkYpkWFIoGUCi7HxYlHF4kssVpF5gun4V7Taw9eKcm0HEWftnLci9l4EBSaFj0w==",
|
|
24840
25026
|
parserEvidence: "Installed pinned catalogue exports, provisional until adapter acceptance",
|
|
24841
|
-
packageManifestSha256: "
|
|
25027
|
+
packageManifestSha256: "8bdf756d4f0b3d006543471320eb14d83f258122752bd1e07c76a2a74868691c",
|
|
24842
25028
|
environment: [
|
|
24843
25029
|
{
|
|
24844
25030
|
name: "AZ_AXI_CONFIG",
|
|
@@ -25014,7 +25200,7 @@ var az_axi_default = {
|
|
|
25014
25200
|
"sub",
|
|
25015
25201
|
"list"
|
|
25016
25202
|
],
|
|
25017
|
-
help: "Command: az-axi sub list\nNative operation: az-axi account list; existing scope, defaults and TOON output apply.\nFlags: --subscription, --management-group, --help, --full, --fields, --limit, --all, --max-rows\nShort flags where accepted: -h help, -s subscription, -g resource-group, -n name, -w workspace, -t timespan.\nLists accept comma-separated, space-separated and repeated values after the leaf path.\nBooleans accept bare flags or true/false. Conflicting scalar values are refused.\n\nLists live ARM subscriptions in selected scope (flags, environment, profile, else all accessible), resolving unambiguous names to IDs. This is not Azure CLI's cached account list. Legacy sub list still lists all visible subscriptions with inScope markers.\nDefault: name, id (subscription GUID), state, tenantId. --full adds ARM metadata and shows all fetched rows; --fields selects metadata. --limit defaults to 50.
|
|
25203
|
+
help: "Command: az-axi sub list\nNative operation: az-axi account list; existing scope, defaults and TOON output apply.\nFlags: --subscription, --management-group, --help, --full, --fields, --limit, --all, --max-rows\nShort flags where accepted: -h help, -s subscription, -g resource-group, -n name, -w workspace, -t timespan.\nLists accept comma-separated, space-separated and repeated values after the leaf path.\nBooleans accept bare flags or true/false. Conflicting scalar values are refused.\n\nLists live ARM subscriptions in selected scope (flags, environment, profile, else all accessible), resolving unambiguous names to IDs. This is not Azure CLI's cached account list. Legacy sub list still lists all visible subscriptions with inScope markers.\nDefault: name, id (subscription GUID), state, tenantId. --full adds ARM metadata and shows all fetched rows; --fields selects metadata. --limit defaults to 50. Lists follow the shared fetch budget (up to 100 pages and the row budget per subscription); incomplete counts are disclosed as lower bounds. Management-group scope is unsupported.\nExamples: az-axi account list; az-axi account list -s <subscription> --full\nFetch budget per subscription or collection (Resource Graph: across selected scope, per exposure check): 1000 rows by default; --all raises it to 10000 (Key Vault: at most 2500 scanned at 25/page). --max-rows <1..100000> overrides either row budget. Every walk stops at 100 pages. Budgets count rows before local filters. --limit controls display only (usually 50; Defender assessments 25, exposure overview 10 per check); --full shows every fetched row and expands display only, never bypassing fetch budgets. Incomplete totals are lower bounds; narrow the scope or raise --max-rows to search further."
|
|
25018
25204
|
},
|
|
25019
25205
|
adapterBoundary: {
|
|
25020
25206
|
unsafeOverrides: [
|
|
@@ -25097,7 +25283,7 @@ var az_axi_default = {
|
|
|
25097
25283
|
tokenResourceSources: [
|
|
25098
25284
|
{
|
|
25099
25285
|
path: "dist/lib/registry.js",
|
|
25100
|
-
sha256: "
|
|
25286
|
+
sha256: "1b0354317f721989465190b4a276fce811d559bcbbd9871129b02dd366a5beb5"
|
|
25101
25287
|
},
|
|
25102
25288
|
{
|
|
25103
25289
|
path: "dist/lib/client.js",
|
|
@@ -25121,7 +25307,7 @@ var az_axi_default = {
|
|
|
25121
25307
|
},
|
|
25122
25308
|
{
|
|
25123
25309
|
path: "dist/commands/rbac.js",
|
|
25124
|
-
sha256: "
|
|
25310
|
+
sha256: "a0b5d0e92d47b78be10ef210b657399b3386ca67d0869d466913b31451dcdcaa"
|
|
25125
25311
|
},
|
|
25126
25312
|
{
|
|
25127
25313
|
path: "dist/commands/logs.js",
|
|
@@ -25826,6 +26012,8 @@ var az_axi_default = {
|
|
|
25826
26012
|
full: "boolean",
|
|
25827
26013
|
fields: "list",
|
|
25828
26014
|
limit: "value",
|
|
26015
|
+
all: "boolean",
|
|
26016
|
+
"max-rows": "value",
|
|
25829
26017
|
"resource-group": "value",
|
|
25830
26018
|
name: "value"
|
|
25831
26019
|
},
|
|
@@ -25890,6 +26078,8 @@ var az_axi_default = {
|
|
|
25890
26078
|
full: "boolean",
|
|
25891
26079
|
fields: "list",
|
|
25892
26080
|
limit: "value",
|
|
26081
|
+
all: "boolean",
|
|
26082
|
+
"max-rows": "value",
|
|
25893
26083
|
"resource-group": "value",
|
|
25894
26084
|
name: "value"
|
|
25895
26085
|
},
|
|
@@ -25953,6 +26143,8 @@ var az_axi_default = {
|
|
|
25953
26143
|
full: "boolean",
|
|
25954
26144
|
fields: "list",
|
|
25955
26145
|
limit: "value",
|
|
26146
|
+
all: "boolean",
|
|
26147
|
+
"max-rows": "value",
|
|
25956
26148
|
"resource-group": "value",
|
|
25957
26149
|
name: "value"
|
|
25958
26150
|
},
|
|
@@ -26016,6 +26208,8 @@ var az_axi_default = {
|
|
|
26016
26208
|
full: "boolean",
|
|
26017
26209
|
fields: "list",
|
|
26018
26210
|
limit: "value",
|
|
26211
|
+
all: "boolean",
|
|
26212
|
+
"max-rows": "value",
|
|
26019
26213
|
resource: "value"
|
|
26020
26214
|
},
|
|
26021
26215
|
flagAliases: {},
|
|
@@ -26075,6 +26269,8 @@ var az_axi_default = {
|
|
|
26075
26269
|
full: "boolean",
|
|
26076
26270
|
fields: "list",
|
|
26077
26271
|
limit: "value",
|
|
26272
|
+
all: "boolean",
|
|
26273
|
+
"max-rows": "value",
|
|
26078
26274
|
resource: "value",
|
|
26079
26275
|
metric: "list",
|
|
26080
26276
|
"start-time": "value",
|
|
@@ -26334,6 +26530,8 @@ var az_axi_default = {
|
|
|
26334
26530
|
full: "boolean",
|
|
26335
26531
|
fields: "list",
|
|
26336
26532
|
limit: "value",
|
|
26533
|
+
all: "boolean",
|
|
26534
|
+
"max-rows": "value",
|
|
26337
26535
|
principal: "value",
|
|
26338
26536
|
role: "value",
|
|
26339
26537
|
scope: "value",
|
|
@@ -26367,6 +26565,8 @@ var az_axi_default = {
|
|
|
26367
26565
|
full: "boolean",
|
|
26368
26566
|
fields: "list",
|
|
26369
26567
|
limit: "value",
|
|
26568
|
+
all: "boolean",
|
|
26569
|
+
"max-rows": "value",
|
|
26370
26570
|
principal: "value",
|
|
26371
26571
|
role: "value",
|
|
26372
26572
|
scope: "value",
|
|
@@ -26401,6 +26601,8 @@ var az_axi_default = {
|
|
|
26401
26601
|
full: "boolean",
|
|
26402
26602
|
fields: "list",
|
|
26403
26603
|
limit: "value",
|
|
26604
|
+
all: "boolean",
|
|
26605
|
+
"max-rows": "value",
|
|
26404
26606
|
since: "value",
|
|
26405
26607
|
caller: "value",
|
|
26406
26608
|
"resource-group": "value",
|
|
@@ -26434,6 +26636,8 @@ var az_axi_default = {
|
|
|
26434
26636
|
full: "boolean",
|
|
26435
26637
|
fields: "list",
|
|
26436
26638
|
limit: "value",
|
|
26639
|
+
all: "boolean",
|
|
26640
|
+
"max-rows": "value",
|
|
26437
26641
|
since: "value",
|
|
26438
26642
|
caller: "value",
|
|
26439
26643
|
"resource-group": "value",
|
|
@@ -26469,6 +26673,8 @@ var az_axi_default = {
|
|
|
26469
26673
|
full: "boolean",
|
|
26470
26674
|
fields: "list",
|
|
26471
26675
|
limit: "value",
|
|
26676
|
+
all: "boolean",
|
|
26677
|
+
"max-rows": "value",
|
|
26472
26678
|
severity: "list",
|
|
26473
26679
|
status: "value",
|
|
26474
26680
|
since: "value"
|
|
@@ -26499,6 +26705,8 @@ var az_axi_default = {
|
|
|
26499
26705
|
full: "boolean",
|
|
26500
26706
|
fields: "list",
|
|
26501
26707
|
limit: "value",
|
|
26708
|
+
all: "boolean",
|
|
26709
|
+
"max-rows": "value",
|
|
26502
26710
|
severity: "list",
|
|
26503
26711
|
status: "value",
|
|
26504
26712
|
since: "value"
|
|
@@ -26556,6 +26764,8 @@ var az_axi_default = {
|
|
|
26556
26764
|
full: "boolean",
|
|
26557
26765
|
fields: "list",
|
|
26558
26766
|
limit: "value",
|
|
26767
|
+
all: "boolean",
|
|
26768
|
+
"max-rows": "value",
|
|
26559
26769
|
name: "value"
|
|
26560
26770
|
},
|
|
26561
26771
|
flagAliases: {},
|
|
@@ -26615,6 +26825,8 @@ var az_axi_default = {
|
|
|
26615
26825
|
full: "boolean",
|
|
26616
26826
|
fields: "list",
|
|
26617
26827
|
limit: "value",
|
|
26828
|
+
all: "boolean",
|
|
26829
|
+
"max-rows": "value",
|
|
26618
26830
|
name: "value",
|
|
26619
26831
|
"assessment-name": "value",
|
|
26620
26832
|
"assessed-resource-id": "value"
|
|
@@ -26754,6 +26966,8 @@ var az_axi_default = {
|
|
|
26754
26966
|
full: "boolean",
|
|
26755
26967
|
fields: "list",
|
|
26756
26968
|
limit: "value",
|
|
26969
|
+
all: "boolean",
|
|
26970
|
+
"max-rows": "value",
|
|
26757
26971
|
severity: "list",
|
|
26758
26972
|
status: "value",
|
|
26759
26973
|
resource: "value",
|
|
@@ -26784,7 +26998,9 @@ var az_axi_default = {
|
|
|
26784
26998
|
help: "boolean",
|
|
26785
26999
|
full: "boolean",
|
|
26786
27000
|
fields: "list",
|
|
26787
|
-
limit: "value"
|
|
27001
|
+
limit: "value",
|
|
27002
|
+
all: "boolean",
|
|
27003
|
+
"max-rows": "value"
|
|
26788
27004
|
},
|
|
26789
27005
|
flagAliases: {},
|
|
26790
27006
|
shortFlags: {
|
|
@@ -26811,7 +27027,9 @@ var az_axi_default = {
|
|
|
26811
27027
|
help: "boolean",
|
|
26812
27028
|
full: "boolean",
|
|
26813
27029
|
fields: "list",
|
|
26814
|
-
limit: "value"
|
|
27030
|
+
limit: "value",
|
|
27031
|
+
all: "boolean",
|
|
27032
|
+
"max-rows": "value"
|
|
26815
27033
|
},
|
|
26816
27034
|
flagAliases: {},
|
|
26817
27035
|
shortFlags: {
|
|
@@ -26913,6 +27131,8 @@ var az_axi_default = {
|
|
|
26913
27131
|
full: "boolean",
|
|
26914
27132
|
fields: "list",
|
|
26915
27133
|
limit: "value",
|
|
27134
|
+
all: "boolean",
|
|
27135
|
+
"max-rows": "value",
|
|
26916
27136
|
"workspace-name": "value",
|
|
26917
27137
|
"resource-group": "value",
|
|
26918
27138
|
workspace: "value",
|
|
@@ -26949,6 +27169,8 @@ var az_axi_default = {
|
|
|
26949
27169
|
full: "boolean",
|
|
26950
27170
|
fields: "list",
|
|
26951
27171
|
limit: "value",
|
|
27172
|
+
all: "boolean",
|
|
27173
|
+
"max-rows": "value",
|
|
26952
27174
|
"workspace-name": "value",
|
|
26953
27175
|
"resource-group": "value",
|
|
26954
27176
|
workspace: "value",
|
|
@@ -27207,6 +27429,8 @@ var az_axi_default = {
|
|
|
27207
27429
|
full: "boolean",
|
|
27208
27430
|
fields: "list",
|
|
27209
27431
|
limit: "value",
|
|
27432
|
+
all: "boolean",
|
|
27433
|
+
"max-rows": "value",
|
|
27210
27434
|
check: "value",
|
|
27211
27435
|
"show-query": "boolean"
|
|
27212
27436
|
},
|
|
@@ -28146,6 +28370,8 @@ var az_axi_default = {
|
|
|
28146
28370
|
full: "boolean",
|
|
28147
28371
|
fields: "list",
|
|
28148
28372
|
limit: "value",
|
|
28373
|
+
all: "boolean",
|
|
28374
|
+
"max-rows": "value",
|
|
28149
28375
|
"resource-group": "value",
|
|
28150
28376
|
name: "value"
|
|
28151
28377
|
},
|
|
@@ -28209,6 +28435,8 @@ var az_axi_default = {
|
|
|
28209
28435
|
full: "boolean",
|
|
28210
28436
|
fields: "list",
|
|
28211
28437
|
limit: "value",
|
|
28438
|
+
all: "boolean",
|
|
28439
|
+
"max-rows": "value",
|
|
28212
28440
|
name: "value"
|
|
28213
28441
|
},
|
|
28214
28442
|
flagAliases: {},
|
|
@@ -28268,6 +28496,8 @@ var az_axi_default = {
|
|
|
28268
28496
|
full: "boolean",
|
|
28269
28497
|
fields: "list",
|
|
28270
28498
|
limit: "value",
|
|
28499
|
+
all: "boolean",
|
|
28500
|
+
"max-rows": "value",
|
|
28271
28501
|
name: "value"
|
|
28272
28502
|
},
|
|
28273
28503
|
flagAliases: {},
|
|
@@ -28327,6 +28557,8 @@ var az_axi_default = {
|
|
|
28327
28557
|
full: "boolean",
|
|
28328
28558
|
fields: "list",
|
|
28329
28559
|
limit: "value",
|
|
28560
|
+
all: "boolean",
|
|
28561
|
+
"max-rows": "value",
|
|
28330
28562
|
"resource-group": "value",
|
|
28331
28563
|
name: "value",
|
|
28332
28564
|
assignment: "value",
|
|
@@ -28360,6 +28592,8 @@ var az_axi_default = {
|
|
|
28360
28592
|
full: "boolean",
|
|
28361
28593
|
fields: "list",
|
|
28362
28594
|
limit: "value",
|
|
28595
|
+
all: "boolean",
|
|
28596
|
+
"max-rows": "value",
|
|
28363
28597
|
"resource-group": "value",
|
|
28364
28598
|
name: "value"
|
|
28365
28599
|
},
|
|
@@ -28423,6 +28657,8 @@ var az_axi_default = {
|
|
|
28423
28657
|
full: "boolean",
|
|
28424
28658
|
fields: "list",
|
|
28425
28659
|
limit: "value",
|
|
28660
|
+
all: "boolean",
|
|
28661
|
+
"max-rows": "value",
|
|
28426
28662
|
"resource-group": "value",
|
|
28427
28663
|
name: "value"
|
|
28428
28664
|
},
|
|
@@ -28486,6 +28722,8 @@ var az_axi_default = {
|
|
|
28486
28722
|
full: "boolean",
|
|
28487
28723
|
fields: "list",
|
|
28488
28724
|
limit: "value",
|
|
28725
|
+
all: "boolean",
|
|
28726
|
+
"max-rows": "value",
|
|
28489
28727
|
"resource-group": "value",
|
|
28490
28728
|
name: "value",
|
|
28491
28729
|
"custom-role-only": "boolean"
|
|
@@ -29501,10 +29739,10 @@ var az_axi_default = {
|
|
|
29501
29739
|
var mg_axi_default = {
|
|
29502
29740
|
generatedBy: "scripts/upstream-inventory.mjs",
|
|
29503
29741
|
tool: "mg-axi",
|
|
29504
|
-
version: "0.1.
|
|
29505
|
-
integrity: "sha512-
|
|
29742
|
+
version: "0.1.12",
|
|
29743
|
+
integrity: "sha512-TBt2y2rpfn8oi4YOq95uIo43RTsV/iOc0xFa3e3YCjhqd/ZL/y2is+7W0+B5/g1sdwb95yJbcU1eqeJEzmKJ5g==",
|
|
29506
29744
|
parserEvidence: "Installed pinned catalogue exports",
|
|
29507
|
-
packageManifestSha256: "
|
|
29745
|
+
packageManifestSha256: "e686938dd356bffe87d9884d656a139b91e7eb6d62370f6aba3b5fd14283fb45",
|
|
29508
29746
|
environment: [
|
|
29509
29747
|
{
|
|
29510
29748
|
name: "MG_AXI_CONFIG"
|
|
@@ -29542,7 +29780,7 @@ var mg_axi_default = {
|
|
|
29542
29780
|
environmentSources: [
|
|
29543
29781
|
{
|
|
29544
29782
|
path: "dist/profiles.js",
|
|
29545
|
-
sha256: "
|
|
29783
|
+
sha256: "5a683251d3427b1642a3d60b5168ae56656506d12aae614ad4469dde6c6d624e"
|
|
29546
29784
|
},
|
|
29547
29785
|
{
|
|
29548
29786
|
path: "dist/mutations.js",
|
|
@@ -29582,7 +29820,7 @@ var mg_axi_default = {
|
|
|
29582
29820
|
sources: [
|
|
29583
29821
|
{
|
|
29584
29822
|
path: "dist/profiles.js",
|
|
29585
|
-
sha256: "
|
|
29823
|
+
sha256: "5a683251d3427b1642a3d60b5168ae56656506d12aae614ad4469dde6c6d624e"
|
|
29586
29824
|
},
|
|
29587
29825
|
{
|
|
29588
29826
|
path: "dist/mutations.js",
|
|
@@ -29661,15 +29899,15 @@ var mg_axi_default = {
|
|
|
29661
29899
|
sources: [
|
|
29662
29900
|
{
|
|
29663
29901
|
path: "dist/catalogue.js",
|
|
29664
|
-
sha256: "
|
|
29902
|
+
sha256: "b6a764b7e50c3f4c84d40dcef1290a2e6a784fe73809977d6b04c06884b7a516"
|
|
29665
29903
|
},
|
|
29666
29904
|
{
|
|
29667
29905
|
path: "dist/cli.js",
|
|
29668
|
-
sha256: "
|
|
29906
|
+
sha256: "613fc3ac4870e5538d2c53b0760244c7e3bb3837fa3d97c1b89b7916c557af44"
|
|
29669
29907
|
},
|
|
29670
29908
|
{
|
|
29671
29909
|
path: "dist/profiles.js",
|
|
29672
|
-
sha256: "
|
|
29910
|
+
sha256: "5a683251d3427b1642a3d60b5168ae56656506d12aae614ad4469dde6c6d624e"
|
|
29673
29911
|
},
|
|
29674
29912
|
{
|
|
29675
29913
|
path: "dist/msal-app-provider.js",
|
|
@@ -29737,11 +29975,11 @@ var mg_axi_default = {
|
|
|
29737
29975
|
parserSources: [
|
|
29738
29976
|
{
|
|
29739
29977
|
path: "dist/catalogue.js",
|
|
29740
|
-
sha256: "
|
|
29978
|
+
sha256: "b6a764b7e50c3f4c84d40dcef1290a2e6a784fe73809977d6b04c06884b7a516"
|
|
29741
29979
|
},
|
|
29742
29980
|
{
|
|
29743
29981
|
path: "dist/cli.js",
|
|
29744
|
-
sha256: "
|
|
29982
|
+
sha256: "613fc3ac4870e5538d2c53b0760244c7e3bb3837fa3d97c1b89b7916c557af44"
|
|
29745
29983
|
}
|
|
29746
29984
|
]
|
|
29747
29985
|
},
|
|
@@ -29842,6 +30080,9 @@ var mg_axi_default = {
|
|
|
29842
30080
|
{
|
|
29843
30081
|
name: "fields"
|
|
29844
30082
|
},
|
|
30083
|
+
{
|
|
30084
|
+
name: "file"
|
|
30085
|
+
},
|
|
29845
30086
|
{
|
|
29846
30087
|
name: "filter"
|
|
29847
30088
|
},
|
|
@@ -29935,6 +30176,9 @@ var mg_axi_default = {
|
|
|
29935
30176
|
{
|
|
29936
30177
|
name: "tenant-id"
|
|
29937
30178
|
},
|
|
30179
|
+
{
|
|
30180
|
+
name: "timespan"
|
|
30181
|
+
},
|
|
29938
30182
|
{
|
|
29939
30183
|
name: "transitive"
|
|
29940
30184
|
},
|
|
@@ -34275,6 +34519,20 @@ var mg_axi_default = {
|
|
|
34275
34519
|
required: true
|
|
34276
34520
|
}
|
|
34277
34521
|
},
|
|
34522
|
+
{
|
|
34523
|
+
command: "security hunting query",
|
|
34524
|
+
flags: {
|
|
34525
|
+
help: "boolean",
|
|
34526
|
+
profile: "value",
|
|
34527
|
+
"api-version": "value",
|
|
34528
|
+
file: "value",
|
|
34529
|
+
timespan: "value",
|
|
34530
|
+
limit: "value",
|
|
34531
|
+
full: "boolean",
|
|
34532
|
+
config: "value"
|
|
34533
|
+
},
|
|
34534
|
+
positionalInput: false
|
|
34535
|
+
},
|
|
34278
34536
|
{
|
|
34279
34537
|
command: "login",
|
|
34280
34538
|
flags: {
|
|
@@ -34858,8 +35116,8 @@ var ldap_axi_default = {
|
|
|
34858
35116
|
var ado_axi_default = {
|
|
34859
35117
|
generatedBy: "scripts/ado-inventory.mjs",
|
|
34860
35118
|
tool: "ado-axi",
|
|
34861
|
-
version: "0.4.
|
|
34862
|
-
integrity: "sha512-
|
|
35119
|
+
version: "0.4.7",
|
|
35120
|
+
integrity: "sha512-qA7qpO0vjlib6r1hOOBfY0+cWn0mVCLBmkFUktJJANPelwbTiZuqgfwgk5D1lGG0q9rgCv+aPJrHOphmWJv0fw==",
|
|
34863
35121
|
parserEvidence: "Reviewed published dispatch switches, aliases and command flag constants",
|
|
34864
35122
|
sources: [
|
|
34865
35123
|
{
|
|
@@ -34920,7 +35178,7 @@ var ado_axi_default = {
|
|
|
34920
35178
|
},
|
|
34921
35179
|
{
|
|
34922
35180
|
path: "dist/commands/pr.js",
|
|
34923
|
-
sha256: "
|
|
35181
|
+
sha256: "b85a81782aa806201facd9fc414a62959bc96db9858fa4ba804015395d001c32"
|
|
34924
35182
|
},
|
|
34925
35183
|
{
|
|
34926
35184
|
path: "dist/commands/ref.js",
|
|
@@ -39787,8 +40045,8 @@ var awx_axi_default = {
|
|
|
39787
40045
|
var tenable_axi_default = {
|
|
39788
40046
|
generatedBy: "scripts/tenable-inventory.mjs",
|
|
39789
40047
|
tool: "tenable-axi",
|
|
39790
|
-
version: "0.1.
|
|
39791
|
-
integrity: "sha512-
|
|
40048
|
+
version: "0.1.2",
|
|
40049
|
+
integrity: "sha512-csjV0urIUbZZlkA9VQpEGbsOWOnLgZTFMi0yRQD3uGlmlyPIxA6gKyvMzifSqcRvfyOaBEv7U5OjcWL1rs5NAw==",
|
|
39792
40050
|
parserEvidence: "Published command catalogue, mutation registry and reviewed native parsers and transport gates",
|
|
39793
40051
|
sources: [
|
|
39794
40052
|
{
|
|
@@ -39809,7 +40067,7 @@ var tenable_axi_default = {
|
|
|
39809
40067
|
},
|
|
39810
40068
|
{
|
|
39811
40069
|
path: "dist/src/catalogue.js",
|
|
39812
|
-
sha256: "
|
|
40070
|
+
sha256: "d99e739f4a9d61cf13c91fd18e69a248f639c33d3e2e5b37efb320f0f50cef16"
|
|
39813
40071
|
},
|
|
39814
40072
|
{
|
|
39815
40073
|
path: "dist/src/cli.js",
|
|
@@ -39825,7 +40083,7 @@ var tenable_axi_default = {
|
|
|
39825
40083
|
},
|
|
39826
40084
|
{
|
|
39827
40085
|
path: "dist/src/exposure.js",
|
|
39828
|
-
sha256: "
|
|
40086
|
+
sha256: "ef5fbe0d3525b741cc14a51b2ab9cc0cbd5289a1ec97fe01312b4d351beaf0b0"
|
|
39829
40087
|
},
|
|
39830
40088
|
{
|
|
39831
40089
|
path: "dist/src/hook-install.js",
|
|
@@ -39833,7 +40091,7 @@ var tenable_axi_default = {
|
|
|
39833
40091
|
},
|
|
39834
40092
|
{
|
|
39835
40093
|
path: "dist/src/inventory-catalogue.js",
|
|
39836
|
-
sha256: "
|
|
40094
|
+
sha256: "a0cc6abc55f11815fbacf4e7f869ce0e70e06f678ebbb012afe7500a26fb4de8"
|
|
39837
40095
|
},
|
|
39838
40096
|
{
|
|
39839
40097
|
path: "dist/src/inventory-export-catalogue.js",
|
|
@@ -39845,7 +40103,7 @@ var tenable_axi_default = {
|
|
|
39845
40103
|
},
|
|
39846
40104
|
{
|
|
39847
40105
|
path: "dist/src/inventory.js",
|
|
39848
|
-
sha256: "
|
|
40106
|
+
sha256: "bc712463ee14db76ff511c4b3ec8d6cadd43b3895e08f1baee785fe3a415916f"
|
|
39849
40107
|
},
|
|
39850
40108
|
{
|
|
39851
40109
|
path: "dist/src/inventory/schema.js",
|
|
@@ -39853,7 +40111,7 @@ var tenable_axi_default = {
|
|
|
39853
40111
|
},
|
|
39854
40112
|
{
|
|
39855
40113
|
path: "dist/src/local-commands.js",
|
|
39856
|
-
sha256: "
|
|
40114
|
+
sha256: "4169d7a4bc6753d202d515b488ca8863b7368e31e8166f9e958c2fd1c6b05d22"
|
|
39857
40115
|
},
|
|
39858
40116
|
{
|
|
39859
40117
|
path: "dist/src/platform-tag-catalogue.js",
|
|
@@ -39865,11 +40123,11 @@ var tenable_axi_default = {
|
|
|
39865
40123
|
},
|
|
39866
40124
|
{
|
|
39867
40125
|
path: "dist/src/private-file.js",
|
|
39868
|
-
sha256: "
|
|
40126
|
+
sha256: "436847d36438fa3d73edfbd45cb14faf9935308230fb8b24573926b7f07b6979"
|
|
39869
40127
|
},
|
|
39870
40128
|
{
|
|
39871
40129
|
path: "dist/src/profiles.js",
|
|
39872
|
-
sha256: "
|
|
40130
|
+
sha256: "b52aa17032f025a81682f0459dcdbed45cf0ed84e10e5aefe31677c31f26414a"
|
|
39873
40131
|
},
|
|
39874
40132
|
{
|
|
39875
40133
|
path: "dist/src/redact.js",
|
|
@@ -40076,14 +40334,14 @@ var tenable_axi_default = {
|
|
|
40076
40334
|
flags: {
|
|
40077
40335
|
config: "Config path; default credential precedence",
|
|
40078
40336
|
profile: "Profile name; default credential precedence",
|
|
40079
|
-
fields: "Comma-separated display or wire properties; default compact view",
|
|
40337
|
+
fields: "Comma-separated display or wire properties; display names: id, name, class, exposureScore; default compact view",
|
|
40080
40338
|
full: "Show full text; default false",
|
|
40081
40339
|
help: "Show help",
|
|
40082
40340
|
limit: "Maximum emitted rows, 1-10000; default 100",
|
|
40083
40341
|
all: "Read up to 10000 rows within invocation budgets; excludes --limit",
|
|
40084
40342
|
cursor: "Opaque resume cursor; retain the original selectors and filters",
|
|
40085
40343
|
query: "Simple query text",
|
|
40086
|
-
filter:
|
|
40344
|
+
filter: 'Repeatable: <property> <operator> <JSON string array>, e.g. asset_class = ["DEVICE"]',
|
|
40087
40345
|
"filter-file": "JSON flat array of {property, operator, value: string[]}; '-' reads stdin; excludes --filter",
|
|
40088
40346
|
sort: "Wire property:asc|desc",
|
|
40089
40347
|
"extra-properties": "Comma-separated extra wire properties",
|
|
@@ -40097,7 +40355,7 @@ var tenable_axi_default = {
|
|
|
40097
40355
|
flags: {
|
|
40098
40356
|
config: "Config path; default credential precedence",
|
|
40099
40357
|
profile: "Profile name; default credential precedence",
|
|
40100
|
-
fields: "Comma-separated
|
|
40358
|
+
fields: "Comma-separated output fields; accepted: key, readable_name, operators, sortable, filterable, control, description; default compact view",
|
|
40101
40359
|
full: "Show full text; default false",
|
|
40102
40360
|
help: "Show help",
|
|
40103
40361
|
limit: "Maximum emitted rows, 1-10000; default 100",
|
|
@@ -40112,7 +40370,7 @@ var tenable_axi_default = {
|
|
|
40112
40370
|
flags: {
|
|
40113
40371
|
config: "Config path; default credential precedence",
|
|
40114
40372
|
profile: "Profile name; default credential precedence",
|
|
40115
|
-
fields: "Comma-separated display or wire properties; default compact view",
|
|
40373
|
+
fields: "Comma-separated display or wire properties; display names: id, name, class, exposureScore; default compact view",
|
|
40116
40374
|
full: "Show full text; default false",
|
|
40117
40375
|
help: "Show help",
|
|
40118
40376
|
id: "Required exact inventory ID",
|
|
@@ -40162,7 +40420,7 @@ var tenable_axi_default = {
|
|
|
40162
40420
|
command: "auth status",
|
|
40163
40421
|
effect: "read",
|
|
40164
40422
|
flags: {
|
|
40165
|
-
config: "Config path; default
|
|
40423
|
+
config: "Config path; default environment override or platform path",
|
|
40166
40424
|
profile: "Profile name; default credential precedence",
|
|
40167
40425
|
fields: "Comma-separated output fields; default all",
|
|
40168
40426
|
full: "Show full text; default false",
|
|
@@ -40505,14 +40763,14 @@ var tenable_axi_default = {
|
|
|
40505
40763
|
flags: {
|
|
40506
40764
|
config: "Config path; default credential precedence",
|
|
40507
40765
|
profile: "Profile name; default credential precedence",
|
|
40508
|
-
fields: "Comma-separated display or wire properties; default compact view",
|
|
40766
|
+
fields: "Comma-separated display or wire properties; display names: id, name, severity, state; default compact view",
|
|
40509
40767
|
full: "Show full text; default false",
|
|
40510
40768
|
help: "Show help",
|
|
40511
40769
|
limit: "Maximum emitted rows, 1-10000; default 100",
|
|
40512
40770
|
all: "Read up to 10000 rows within invocation budgets; excludes --limit",
|
|
40513
40771
|
cursor: "Opaque resume cursor; retain the original selectors and filters",
|
|
40514
40772
|
query: "Simple query text",
|
|
40515
|
-
filter:
|
|
40773
|
+
filter: 'Repeatable: <property> <operator> <JSON string array>, e.g. severity = ["HIGH"]',
|
|
40516
40774
|
"filter-file": "JSON flat array of {property, operator, value: string[]}; '-' reads stdin; excludes --filter",
|
|
40517
40775
|
sort: "Wire property:asc|desc",
|
|
40518
40776
|
"extra-properties": "Comma-separated extra wire properties",
|
|
@@ -40525,7 +40783,7 @@ var tenable_axi_default = {
|
|
|
40525
40783
|
flags: {
|
|
40526
40784
|
config: "Config path; default credential precedence",
|
|
40527
40785
|
profile: "Profile name; default credential precedence",
|
|
40528
|
-
fields: "Comma-separated
|
|
40786
|
+
fields: "Comma-separated output fields; accepted: key, readable_name, operators, sortable, filterable, control, description; default compact view",
|
|
40529
40787
|
full: "Show full text; default false",
|
|
40530
40788
|
help: "Show help",
|
|
40531
40789
|
limit: "Maximum emitted rows, 1-10000; default 100",
|
|
@@ -40539,7 +40797,7 @@ var tenable_axi_default = {
|
|
|
40539
40797
|
flags: {
|
|
40540
40798
|
config: "Config path; default credential precedence",
|
|
40541
40799
|
profile: "Profile name; default credential precedence",
|
|
40542
|
-
fields: "Comma-separated display or wire properties; default compact view",
|
|
40800
|
+
fields: "Comma-separated display or wire properties; display names: id, name, severity, state; default compact view",
|
|
40543
40801
|
full: "Show full text; default false",
|
|
40544
40802
|
help: "Show help",
|
|
40545
40803
|
id: "Required exact inventory ID",
|
|
@@ -40665,14 +40923,14 @@ var tenable_axi_default = {
|
|
|
40665
40923
|
flags: {
|
|
40666
40924
|
config: "Config path; default credential precedence",
|
|
40667
40925
|
profile: "Profile name; default credential precedence",
|
|
40668
|
-
fields: "Comma-separated display or wire properties; default compact view",
|
|
40926
|
+
fields: "Comma-separated display or wire properties; display names: name, version, publisher; default compact view",
|
|
40669
40927
|
full: "Show full text; default false",
|
|
40670
40928
|
help: "Show help",
|
|
40671
40929
|
limit: "Maximum emitted rows, 1-10000; default 100",
|
|
40672
40930
|
all: "Read up to 10000 rows within invocation budgets; excludes --limit",
|
|
40673
40931
|
cursor: "Opaque resume cursor; retain the original selectors and filters",
|
|
40674
40932
|
query: "Simple query text",
|
|
40675
|
-
filter:
|
|
40933
|
+
filter: 'Repeatable: <property> <operator> <JSON string array>, e.g. application = ["example-app"]',
|
|
40676
40934
|
"filter-file": "JSON flat array of {property, operator, value: string[]}; '-' reads stdin; excludes --filter",
|
|
40677
40935
|
sort: "Wire property:asc|desc",
|
|
40678
40936
|
"extra-properties": "Comma-separated extra wire properties",
|
|
@@ -40685,7 +40943,7 @@ var tenable_axi_default = {
|
|
|
40685
40943
|
flags: {
|
|
40686
40944
|
config: "Config path; default credential precedence",
|
|
40687
40945
|
profile: "Profile name; default credential precedence",
|
|
40688
|
-
fields: "Comma-separated
|
|
40946
|
+
fields: "Comma-separated output fields; accepted: key, readable_name, operators, sortable, filterable, control, description; default compact view",
|
|
40689
40947
|
full: "Show full text; default false",
|
|
40690
40948
|
help: "Show help",
|
|
40691
40949
|
limit: "Maximum emitted rows, 1-10000; default 100",
|
|
@@ -40989,8 +41247,8 @@ var tenable_axi_default = {
|
|
|
40989
41247
|
var hybrid_axi_default = {
|
|
40990
41248
|
generatedBy: "scripts/hybrid-inventory.mjs",
|
|
40991
41249
|
tool: "hybrid-axi",
|
|
40992
|
-
version: "0.1.
|
|
40993
|
-
integrity: "sha512-
|
|
41250
|
+
version: "0.1.1",
|
|
41251
|
+
integrity: "sha512-8K39EZadEq302GcuCKrWmdKJ6NvtFegpGWiStTF8T8gn+lbzbYNiBnRMt5lI0o+hCm7glUdOFahZqw62ylpi7w==",
|
|
40994
41252
|
parserEvidence: "Published command catalogue, mutation registry and reviewed native parsers and transport gates",
|
|
40995
41253
|
sources: [
|
|
40996
41254
|
{
|
|
@@ -40999,7 +41257,7 @@ var hybrid_axi_default = {
|
|
|
40999
41257
|
},
|
|
41000
41258
|
{
|
|
41001
41259
|
path: "dist/src/cli.js",
|
|
41002
|
-
sha256: "
|
|
41260
|
+
sha256: "85424239ee66a94aeb77789392277c300d784c9e77297c72a2b40fa22349abc7"
|
|
41003
41261
|
},
|
|
41004
41262
|
{
|
|
41005
41263
|
path: "dist/src/download-catalogue.js",
|
|
@@ -41007,11 +41265,11 @@ var hybrid_axi_default = {
|
|
|
41007
41265
|
},
|
|
41008
41266
|
{
|
|
41009
41267
|
path: "dist/src/hunting-catalogue.js",
|
|
41010
|
-
sha256: "
|
|
41268
|
+
sha256: "f013f3f508b15805cabe58c3c6e8f44088dee6448b08469b1dbe8d9d07fae6df"
|
|
41011
41269
|
},
|
|
41012
41270
|
{
|
|
41013
41271
|
path: "dist/src/hunting.js",
|
|
41014
|
-
sha256: "
|
|
41272
|
+
sha256: "323486f2003b1f97979400028b0350e978c84249700f05fed032eb9a1fe413f4"
|
|
41015
41273
|
},
|
|
41016
41274
|
{
|
|
41017
41275
|
path: "dist/src/key-contracts.js",
|
|
@@ -41019,7 +41277,7 @@ var hybrid_axi_default = {
|
|
|
41019
41277
|
},
|
|
41020
41278
|
{
|
|
41021
41279
|
path: "dist/src/local-commands.js",
|
|
41022
|
-
sha256: "
|
|
41280
|
+
sha256: "c151a3662a623360ef3d4d40d7c268b8a090983ee7949131237a7704d02a63b8"
|
|
41023
41281
|
},
|
|
41024
41282
|
{
|
|
41025
41283
|
path: "dist/src/private-file.js",
|
|
@@ -41027,7 +41285,7 @@ var hybrid_axi_default = {
|
|
|
41027
41285
|
},
|
|
41028
41286
|
{
|
|
41029
41287
|
path: "dist/src/profiles.js",
|
|
41030
|
-
sha256: "
|
|
41288
|
+
sha256: "a2b567d31d3d1f04bc86970fc8b736b3510c1d7b7848f685c347415387f85543"
|
|
41031
41289
|
},
|
|
41032
41290
|
{
|
|
41033
41291
|
path: "dist/src/redact.js",
|
|
@@ -41043,11 +41301,11 @@ var hybrid_axi_default = {
|
|
|
41043
41301
|
},
|
|
41044
41302
|
{
|
|
41045
41303
|
path: "dist/src/reports.js",
|
|
41046
|
-
sha256: "
|
|
41304
|
+
sha256: "be256f71a04c2f19371b6eb862b88caff9f2e481b95551749bca172058d70396"
|
|
41047
41305
|
},
|
|
41048
41306
|
{
|
|
41049
41307
|
path: "dist/src/search-catalogue.js",
|
|
41050
|
-
sha256: "
|
|
41308
|
+
sha256: "e5cba3e769308123a560f7e9bcbb0f0ab36e428ce3631a173298953f063b8f7e"
|
|
41051
41309
|
},
|
|
41052
41310
|
{
|
|
41053
41311
|
path: "dist/src/search-contracts.js",
|
|
@@ -41055,7 +41313,7 @@ var hybrid_axi_default = {
|
|
|
41055
41313
|
},
|
|
41056
41314
|
{
|
|
41057
41315
|
path: "dist/src/search.js",
|
|
41058
|
-
sha256: "
|
|
41316
|
+
sha256: "bd9362c96f6ff2a90c3297308cb7e1ef91469a4b233228abfa3d7a8849d28204"
|
|
41059
41317
|
},
|
|
41060
41318
|
{
|
|
41061
41319
|
path: "dist/src/session.js",
|
|
@@ -41087,7 +41345,7 @@ var hybrid_axi_default = {
|
|
|
41087
41345
|
},
|
|
41088
41346
|
{
|
|
41089
41347
|
path: "dist/src/writes-core.js",
|
|
41090
|
-
sha256: "
|
|
41348
|
+
sha256: "c91ce1b7b8e2735d60565e0cc043bc3aa76d7d31e81fa6745c01fbb42035baa0"
|
|
41091
41349
|
},
|
|
41092
41350
|
{
|
|
41093
41351
|
path: "dist/src/writes.js",
|
|
@@ -41170,11 +41428,15 @@ var hybrid_axi_default = {
|
|
|
41170
41428
|
}
|
|
41171
41429
|
}
|
|
41172
41430
|
},
|
|
41173
|
-
skillSha256: "
|
|
41431
|
+
skillSha256: "1d0266cf0237630d063531b567a6b960dca48a731e7917e72b50fb59f757d384",
|
|
41174
41432
|
nativeWriteSettings: {
|
|
41175
41433
|
supportedOperations: [
|
|
41176
41434
|
"convertQuickScan",
|
|
41435
|
+
"hash-download-bin",
|
|
41177
41436
|
"huntingMatches",
|
|
41437
|
+
"report-download-bin",
|
|
41438
|
+
"report-download-dropped-files",
|
|
41439
|
+
"report-download-memory",
|
|
41178
41440
|
"submitDroppedFile",
|
|
41179
41441
|
"submitFile",
|
|
41180
41442
|
"submitUrl",
|
|
@@ -41206,7 +41468,7 @@ var hybrid_axi_default = {
|
|
|
41206
41468
|
inputs: {
|
|
41207
41469
|
stdin: "body-file - only",
|
|
41208
41470
|
files: "uploaded leaves only",
|
|
41209
|
-
downloads: "
|
|
41471
|
+
downloads: "artium-axi download only; authenticated one-shot CLI verified save"
|
|
41210
41472
|
},
|
|
41211
41473
|
nativeWrites: "native preview, operation allow-list, execute, exact confirm and durable journal"
|
|
41212
41474
|
},
|
|
@@ -41229,7 +41491,7 @@ var hybrid_axi_default = {
|
|
|
41229
41491
|
example: [
|
|
41230
41492
|
"quota"
|
|
41231
41493
|
],
|
|
41232
|
-
help: "hybrid-axi quota\nArtium manages the API key and fixed Hybrid Analysis origin. Submissions, YARA mutations
|
|
41494
|
+
help: "hybrid-axi quota\nArtium manages the API key and fixed Hybrid Analysis origin. Submissions, YARA mutations, consuming matches and the four reviewed archive downloads are off by default and selected independently; administrator-enabled operations still require native preview, --execute, exact --confirm and journal. Quick scans transmit the supplied sample or URL as read exceptions. File flags accept uploaded leaves; body-file also accepts explicit stdin (-). Use artium-axi download --help for authenticated one-shot CLI verified saving and live-malware warnings.\n"
|
|
41233
41495
|
},
|
|
41234
41496
|
suggestionFields: [
|
|
41235
41497
|
"help"
|
|
@@ -41348,7 +41610,8 @@ var hybrid_axi_default = {
|
|
|
41348
41610
|
fields: "Comma-separated response fields; default compact fields",
|
|
41349
41611
|
full: "Include all response fields; default false",
|
|
41350
41612
|
hash: "One MD5/SHA1/SHA256/SHA512; exactly one selector required",
|
|
41351
|
-
"hashes-file": "Newline-separated MD5/SHA1/SHA256 file; deprecated bulk route"
|
|
41613
|
+
"hashes-file": "Newline-separated MD5/SHA1/SHA256 file; deprecated bulk route",
|
|
41614
|
+
limit: "Local row limit; default 100; --full does not change it"
|
|
41352
41615
|
}
|
|
41353
41616
|
},
|
|
41354
41617
|
{
|
|
@@ -41360,7 +41623,8 @@ var hybrid_axi_default = {
|
|
|
41360
41623
|
profile: "Profile name; default profile precedence",
|
|
41361
41624
|
fields: "Comma-separated response fields; default compact fields",
|
|
41362
41625
|
full: "Include all response fields; default false",
|
|
41363
|
-
labs: "Experimental Labs overview; default false"
|
|
41626
|
+
labs: "Experimental Labs overview; default false",
|
|
41627
|
+
limit: "Local row limit; default 100; --full does not change it"
|
|
41364
41628
|
}
|
|
41365
41629
|
},
|
|
41366
41630
|
{
|
|
@@ -43448,7 +43712,7 @@ function managedFlagRanges(command, tool) {
|
|
|
43448
43712
|
function hostedHelp(help, tool, flags, commands2) {
|
|
43449
43713
|
if (tool === "hybrid-axi") {
|
|
43450
43714
|
help = help.split("\n").filter((line) => !/HYBRID_AXI_|SecretRefs|hybrid-axi (?:setup|config|profile)|--(?:config|profile|origin|output)\b/.test(line)).join("\n");
|
|
43451
|
-
const guidance = "Artium manages the API key and fixed origin. Submissions, YARA mutations
|
|
43715
|
+
const guidance = "Artium manages the API key and fixed origin. Submissions, YARA mutations, consuming matches and four reviewed archive downloads require independently selected administrator-enabled operations, native preview, execute, exact confirmation and journal. Quick scans transmit the supplied sample or URL. Use artium-axi download --help for authenticated one-shot CLI verified saving and live-malware warnings.";
|
|
43452
43716
|
if (commands2 && !help.includes(guidance)) help = help.trimEnd() + "\n" + guidance + "\n";
|
|
43453
43717
|
}
|
|
43454
43718
|
if (tool === "tenable-axi") {
|
|
@@ -43700,12 +43964,19 @@ async function doctor(createClient = (deadline) => new Client(process.env, void
|
|
|
43700
43964
|
try {
|
|
43701
43965
|
const parsed = toolsResponseSchema.safeParse(await client.authenticated("/v1/tools", "GET"));
|
|
43702
43966
|
if (!parsed.success) throw new ArtiumError("INVALID_RESPONSE");
|
|
43703
|
-
for (const tool of parsed.data.tools)
|
|
43704
|
-
tool.
|
|
43705
|
-
|
|
43706
|
-
|
|
43707
|
-
|
|
43708
|
-
|
|
43967
|
+
for (const tool of parsed.data.tools) {
|
|
43968
|
+
if (tool.status === "checking") {
|
|
43969
|
+
write(`pass: ${tool.name} (checking)
|
|
43970
|
+
`);
|
|
43971
|
+
continue;
|
|
43972
|
+
}
|
|
43973
|
+
line(
|
|
43974
|
+
tool.name,
|
|
43975
|
+
tool.status === "ok",
|
|
43976
|
+
tool.status,
|
|
43977
|
+
new ArtiumError(tool.status === "unconfigured" ? "CREDENTIAL_NOT_CONFIGURED" : tool.status === "error" ? "TOOL_FAILED" : tool.status === "disabled" ? "TOOL_DISABLED" : "SERVER_UNAVAILABLE")
|
|
43978
|
+
);
|
|
43979
|
+
}
|
|
43709
43980
|
} catch (error62) {
|
|
43710
43981
|
const cause = error62 instanceof ArtiumError ? error62 : new ArtiumError("INVALID_RESPONSE");
|
|
43711
43982
|
line("tools", false, cause.code, cause);
|
|
@@ -43716,7 +43987,7 @@ async function doctor(createClient = (deadline) => new Client(process.env, void
|
|
|
43716
43987
|
|
|
43717
43988
|
// src/cli/help.ts
|
|
43718
43989
|
var commands = {
|
|
43719
|
-
home: { usage: "artium-axi [tools [show <tool>]|whoami|login|passwd|logout|doctor|setup|update|<tool> <args>]", purpose: "Show your identity, roles and available tools.", flags: ["--version (default false; print the client package version and exit)"], example: "artium-axi" },
|
|
43990
|
+
home: { usage: "artium-axi [tools [show <tool>]|whoami|login|passwd|logout|doctor|setup|update|download|<tool> <args>]", purpose: "Show your identity, roles and available tools.", flags: ["--version (default false; print the client package version and exit)"], example: "artium-axi" },
|
|
43720
43991
|
setup: {
|
|
43721
43992
|
usage: "artium-axi setup --host <claude|codex|opencode|pi> [--hook] [--force]",
|
|
43722
43993
|
purpose: "Install skills for your signed-in account\u2019s granted tools and an optional Claude Code session hook.",
|
|
@@ -43741,6 +44012,24 @@ var commands = {
|
|
|
43741
44012
|
logout: { usage: "artium-axi logout", purpose: "Remove local tokens and revoke the server session.", flags: [], example: "artium-axi logout" },
|
|
43742
44013
|
doctor: { usage: "artium-axi doctor", purpose: "Check the server, certificate, token, CLI version and cached tool health.", flags: [], example: "artium-axi doctor" },
|
|
43743
44014
|
update: { usage: "artium-axi update", purpose: "Download and verify the server\u2019s client, replace this file and keep a .bak backup. npm installations must use npm install -g @knowttl/artium-axi.", flags: [], example: "artium-axi update" },
|
|
44015
|
+
download: {
|
|
44016
|
+
usage: "artium-axi download --operation <operation> --selector <hash|report-id> --type <bin|dropped-files|memory> --destination <absolute-new-path> [--transfer <id> --execute --confirm <exact-confirm>] [--password-stdin|--sso]",
|
|
44017
|
+
purpose: "Preview or explicitly save a hosted Hybrid Analysis archive. Operations remain unavailable until adapter enablement.",
|
|
44018
|
+
flags: [
|
|
44019
|
+
"--operation <hash-download-bin|report-download-bin|report-download-dropped-files|report-download-memory> (required)",
|
|
44020
|
+
"--selector <hash|report-id> (required)",
|
|
44021
|
+
"--type <bin|dropped-files|memory> (required)",
|
|
44022
|
+
"--destination <absolute-new-path> (required; Linux private 0700 directory, no symlink components or overwrite)",
|
|
44023
|
+
"--transfer <id> (required for execution; preview transfer ID)",
|
|
44024
|
+
"--execute (default false)",
|
|
44025
|
+
"--confirm <exact-confirm> (required for execution; unchanged native preview string)",
|
|
44026
|
+
"--password-stdin (default false; otherwise terminal password)",
|
|
44027
|
+
"--sso (default false; browser identity confirmation)",
|
|
44028
|
+
transferWarning,
|
|
44029
|
+
`Limit ${transferLimits.artifactBytes / 1024 ** 2} MiB; ${transferLimits.reservationsPerUser} reservation per user, ${transferLimits.reservations} globally, ${transferLimits.reservedBytes / 1024 ** 3} GiB total artifact capacity; absolute expiry ${transferLimits.lifetimeMs / 6e4} minutes after preview preparation, including generation and retrieval. No resume or automatic retry. Missing receipt is unconfirmed.`
|
|
44030
|
+
],
|
|
44031
|
+
example: "artium-axi download --operation report-download-bin --selector synthetic-report --type bin --destination /controlled/artifacts/new-archive.bin --sso"
|
|
44032
|
+
},
|
|
43744
44033
|
"falcon-axi": {
|
|
43745
44034
|
usage: "artium-axi falcon-axi [<args>]",
|
|
43746
44035
|
purpose: "Run Falcon commands with your managed credentials.",
|
|
@@ -43780,7 +44069,7 @@ var commands = {
|
|
|
43780
44069
|
"hybrid-axi": {
|
|
43781
44070
|
usage: "artium-axi hybrid-axi [<args>]",
|
|
43782
44071
|
purpose: "Investigate Hybrid Analysis with a managed API key.",
|
|
43783
|
-
flags: ["Submissions, YARA mutations
|
|
44072
|
+
flags: ["Submissions, YARA mutations, consuming matches and four reviewed archive downloads are off by default and selected independently by an administrator. Native preview, --execute and exact --confirm remain required. Use artium-axi download --help for authenticated CLI verified saving.", transferWarning],
|
|
43784
44073
|
example: "artium-axi hybrid-axi quota"
|
|
43785
44074
|
},
|
|
43786
44075
|
"az-axi": {
|
|
@@ -43853,7 +44142,7 @@ function validateArguments(args, prefixHelp) {
|
|
|
43853
44142
|
start = 2;
|
|
43854
44143
|
}
|
|
43855
44144
|
const entry = commands[level];
|
|
43856
|
-
const validFlags = ["--help", ...entry.flags.map((flag) => flag.split(" ")[0])];
|
|
44145
|
+
const validFlags = ["--help", ...entry.flags.filter((flag) => flag.startsWith("--")).map((flag) => flag.split(" ")[0])];
|
|
43857
44146
|
const choices = `Valid flags for ${level}: ${validFlags.join(", ")}.` + (level === "tools" ? " Valid subcommands: show <tool>." : level === "tools show" ? ` Valid tools: ${toolSchema.options.join(", ")}.` : "");
|
|
43858
44147
|
let tool = false;
|
|
43859
44148
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -43865,8 +44154,9 @@ function validateArguments(args, prefixHelp) {
|
|
|
43865
44154
|
} else {
|
|
43866
44155
|
if (!validFlags.includes(token) || seen.has(token)) fail(token, level, choices);
|
|
43867
44156
|
seen.add(token);
|
|
43868
|
-
if (token === "--username" || token === "--host") {
|
|
44157
|
+
if (token === "--username" || token === "--host" || command === "download" && ["--operation", "--selector", "--type", "--destination", "--transfer", "--confirm"].includes(token)) {
|
|
43869
44158
|
const value = args[index + 1];
|
|
44159
|
+
if (!value && command === "download") fail(value, `${level} ${token}`, `Supply a value for ${token}. Use ${entry.usage}. ${choices}`);
|
|
43870
44160
|
if (!value) fail(value, `${level} ${token}`, `Supply ${token} ${token === "--host" ? "<claude|codex|opencode|pi>" : "<username>"}. ${choices}`);
|
|
43871
44161
|
if (token === "--host" && !["claude", "codex", "opencode", "pi"].includes(value)) fail(value, `${level} --host`, `Valid hosts: claude, codex, opencode, pi. Use ${entry.usage}.`);
|
|
43872
44162
|
index++;
|
|
@@ -43876,6 +44166,7 @@ function validateArguments(args, prefixHelp) {
|
|
|
43876
44166
|
if (level === "tools show" && !tool && !seen.has("--help") && !prefixHelp) fail(void 0, level, choices);
|
|
43877
44167
|
}
|
|
43878
44168
|
function helpCommand(args, prefixHelp = false) {
|
|
44169
|
+
if (args[0] === "download" && args.includes("--help")) return "download";
|
|
43879
44170
|
if (args[0] === "setup" && args.includes("--help")) {
|
|
43880
44171
|
const path2 = args.filter((arg) => arg !== "--help");
|
|
43881
44172
|
for (let index = 1; index < path2.length; index++) {
|
|
@@ -44240,6 +44531,7 @@ var ManagedSession = class _ManagedSession {
|
|
|
44240
44531
|
}
|
|
44241
44532
|
channel;
|
|
44242
44533
|
session;
|
|
44534
|
+
refreshing;
|
|
44243
44535
|
secrets = [];
|
|
44244
44536
|
output = { stdout: "", stderr: "" };
|
|
44245
44537
|
static async read(signIn = false) {
|
|
@@ -44279,19 +44571,31 @@ var ManagedSession = class _ManagedSession {
|
|
|
44279
44571
|
checkServer(serverUrl) {
|
|
44280
44572
|
if (this.session && this.session.serverUrl.replace(/\/$/, "") !== serverUrl) throw new ArtiumError("SESSION_SERVER_MISMATCH");
|
|
44281
44573
|
}
|
|
44574
|
+
async once(request) {
|
|
44575
|
+
if (!this.session) throw new ArtiumError("TOKEN_INVALID");
|
|
44576
|
+
return request(this.session.accessToken);
|
|
44577
|
+
}
|
|
44282
44578
|
async authenticated(request, refresh) {
|
|
44283
44579
|
if (!this.session) throw new ArtiumError("TOKEN_INVALID");
|
|
44580
|
+
const session = this.session;
|
|
44284
44581
|
try {
|
|
44285
|
-
return await request(
|
|
44582
|
+
return await request(session.accessToken);
|
|
44286
44583
|
} catch (error62) {
|
|
44287
44584
|
if (!(error62 instanceof ArtiumError) || error62.code !== "TOKEN_EXPIRED" || !this.session.refreshToken) throw error62;
|
|
44288
44585
|
}
|
|
44289
|
-
|
|
44290
|
-
|
|
44291
|
-
|
|
44586
|
+
if (!this.refreshing && this.session.accessToken === session.accessToken) {
|
|
44587
|
+
this.refreshing = (async () => {
|
|
44588
|
+
const parsed = loginResponseSchema.safeParse(await refresh(session.refreshToken));
|
|
44589
|
+
if (!parsed.success || parsed.data.status !== "authenticated" || !parsed.data.accessToken || !parsed.data.refreshToken) {
|
|
44590
|
+
throw new ArtiumError("INVALID_RESPONSE");
|
|
44591
|
+
}
|
|
44592
|
+
await this.emit(session.serverUrl, parsed.data);
|
|
44593
|
+
this.session = { serverUrl: session.serverUrl, ...parsed.data };
|
|
44594
|
+
})().finally(() => {
|
|
44595
|
+
this.refreshing = void 0;
|
|
44596
|
+
});
|
|
44292
44597
|
}
|
|
44293
|
-
await this.
|
|
44294
|
-
this.session = { serverUrl: this.session.serverUrl, ...parsed.data };
|
|
44598
|
+
await this.refreshing;
|
|
44295
44599
|
return request(this.session.accessToken);
|
|
44296
44600
|
}
|
|
44297
44601
|
protect(...secrets) {
|
|
@@ -44301,9 +44605,9 @@ var ManagedSession = class _ManagedSession {
|
|
|
44301
44605
|
if (session.status === "authenticated") this.protect(session.accessToken, session.refreshToken);
|
|
44302
44606
|
else this.protect(session.passwordChangeToken);
|
|
44303
44607
|
try {
|
|
44304
|
-
await new Promise((
|
|
44608
|
+
await new Promise((resolve5, reject) => {
|
|
44305
44609
|
this.channel.write(`${JSON.stringify({ serverUrl, ...session })}
|
|
44306
|
-
`, (error62) => error62 ? reject(error62) :
|
|
44610
|
+
`, (error62) => error62 ? reject(error62) : resolve5());
|
|
44307
44611
|
});
|
|
44308
44612
|
} catch {
|
|
44309
44613
|
throw new ArtiumError(
|
|
@@ -44316,6 +44620,12 @@ var ManagedSession = class _ManagedSession {
|
|
|
44316
44620
|
write(stream, text2) {
|
|
44317
44621
|
this.output[stream] += text2;
|
|
44318
44622
|
}
|
|
44623
|
+
// Identity approval and pre-execution notices must reach the caller before
|
|
44624
|
+
// the pending operation. Tool output retains the buffered flush contract.
|
|
44625
|
+
notice(text2) {
|
|
44626
|
+
if (new SecretScanner(this.secrets).scan("stdout", Buffer.from(text2))) throw new ArtiumError("SECRET_IN_OUTPUT");
|
|
44627
|
+
process.stdout.write(text2);
|
|
44628
|
+
}
|
|
44319
44629
|
flush() {
|
|
44320
44630
|
this.channel.destroy();
|
|
44321
44631
|
const scanner = new SecretScanner(this.secrets);
|
|
@@ -44357,6 +44667,255 @@ async function update() {
|
|
|
44357
44667
|
return "status: updated\nnext: artium-axi --version\n";
|
|
44358
44668
|
}
|
|
44359
44669
|
|
|
44670
|
+
// src/cli/download.ts
|
|
44671
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
44672
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
44673
|
+
|
|
44674
|
+
// src/cli/artifact-save.ts
|
|
44675
|
+
import { createHash as createHash3, randomUUID as randomUUID4 } from "node:crypto";
|
|
44676
|
+
import { constants } from "node:fs";
|
|
44677
|
+
import { link, open as open2, unlink } from "node:fs/promises";
|
|
44678
|
+
import { basename as basename2, dirname as dirname4, isAbsolute, resolve as resolve3 } from "node:path";
|
|
44679
|
+
async function privateParent(destination) {
|
|
44680
|
+
let parent = await open2("/", constants.O_RDONLY | constants.O_DIRECTORY | constants.O_NOFOLLOW);
|
|
44681
|
+
try {
|
|
44682
|
+
for (const component of dirname4(destination).split("/").filter(Boolean)) {
|
|
44683
|
+
const child = await open2(`/proc/self/fd/${parent.fd}/${component}`, constants.O_RDONLY | constants.O_DIRECTORY | constants.O_NOFOLLOW);
|
|
44684
|
+
await parent.close();
|
|
44685
|
+
parent = child;
|
|
44686
|
+
}
|
|
44687
|
+
const info = await parent.stat();
|
|
44688
|
+
if (info.uid !== process.getuid?.() || (info.mode & 511) !== 448) throw new ArtiumError("ARTIFACT_SAVE_FAILED");
|
|
44689
|
+
return parent;
|
|
44690
|
+
} catch (error62) {
|
|
44691
|
+
await parent.close();
|
|
44692
|
+
throw error62;
|
|
44693
|
+
}
|
|
44694
|
+
}
|
|
44695
|
+
async function artifactDestination(destination) {
|
|
44696
|
+
if (process.platform !== "linux" || !isAbsolute(destination) || resolve3(destination) !== destination || basename2(destination) === "") {
|
|
44697
|
+
throw new ArtiumError("ARTIFACT_SAVE_FAILED");
|
|
44698
|
+
}
|
|
44699
|
+
let parent;
|
|
44700
|
+
try {
|
|
44701
|
+
parent = await privateParent(destination);
|
|
44702
|
+
} catch {
|
|
44703
|
+
throw new ArtiumError("ARTIFACT_SAVE_FAILED");
|
|
44704
|
+
}
|
|
44705
|
+
let temporary;
|
|
44706
|
+
let file2;
|
|
44707
|
+
let closed = false;
|
|
44708
|
+
try {
|
|
44709
|
+
const info = await parent.stat();
|
|
44710
|
+
const target = `/proc/self/fd/${parent.fd}/${basename2(destination)}`;
|
|
44711
|
+
try {
|
|
44712
|
+
const existing = await open2(target, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
44713
|
+
await existing.close();
|
|
44714
|
+
throw new ArtiumError("ARTIFACT_SAVE_FAILED");
|
|
44715
|
+
} catch (error62) {
|
|
44716
|
+
if (error62.code !== "ENOENT") throw error62;
|
|
44717
|
+
}
|
|
44718
|
+
return {
|
|
44719
|
+
async save(response, archive, signal) {
|
|
44720
|
+
signal.throwIfAborted();
|
|
44721
|
+
if (response.headers["content-type"] !== "application/octet-stream" || response.headers["content-length"] !== String(archive.archiveBytes) || response.headers["x-artium-archive-sha256"] !== archive.archiveSha256 || response.headers["content-encoding"] || response.headers["content-range"]) throw new ArtiumError("INVALID_RESPONSE");
|
|
44722
|
+
temporary = `/proc/self/fd/${parent.fd}/.artium-${randomUUID4()}.tmp`;
|
|
44723
|
+
file2 = await open2(temporary, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 384);
|
|
44724
|
+
const hash2 = createHash3("sha256");
|
|
44725
|
+
let size = 0;
|
|
44726
|
+
for await (const chunk of response) {
|
|
44727
|
+
signal.throwIfAborted();
|
|
44728
|
+
size += chunk.length;
|
|
44729
|
+
if (size > archive.archiveBytes) throw new ArtiumError("INVALID_RESPONSE");
|
|
44730
|
+
hash2.update(chunk);
|
|
44731
|
+
await file2.writeFile(chunk);
|
|
44732
|
+
}
|
|
44733
|
+
if (size !== archive.archiveBytes || hash2.digest("hex") !== archive.archiveSha256) throw new ArtiumError("INVALID_RESPONSE");
|
|
44734
|
+
await file2.sync();
|
|
44735
|
+
await file2.close();
|
|
44736
|
+
file2 = void 0;
|
|
44737
|
+
const current = await privateParent(destination);
|
|
44738
|
+
try {
|
|
44739
|
+
const actual = await current.stat();
|
|
44740
|
+
if (info.dev !== actual.dev || info.ino !== actual.ino) throw new ArtiumError("ARTIFACT_SAVE_FAILED");
|
|
44741
|
+
} finally {
|
|
44742
|
+
await current.close();
|
|
44743
|
+
}
|
|
44744
|
+
signal.throwIfAborted();
|
|
44745
|
+
await link(temporary, target);
|
|
44746
|
+
},
|
|
44747
|
+
async close() {
|
|
44748
|
+
if (closed) return;
|
|
44749
|
+
closed = true;
|
|
44750
|
+
try {
|
|
44751
|
+
await file2?.close();
|
|
44752
|
+
} finally {
|
|
44753
|
+
try {
|
|
44754
|
+
if (temporary) await unlink(temporary);
|
|
44755
|
+
} finally {
|
|
44756
|
+
await parent.close();
|
|
44757
|
+
}
|
|
44758
|
+
}
|
|
44759
|
+
}
|
|
44760
|
+
};
|
|
44761
|
+
} catch {
|
|
44762
|
+
await parent.close();
|
|
44763
|
+
throw new ArtiumError("ARTIFACT_SAVE_FAILED");
|
|
44764
|
+
}
|
|
44765
|
+
}
|
|
44766
|
+
|
|
44767
|
+
// src/cli/download.ts
|
|
44768
|
+
async function download(args, output3, managed2) {
|
|
44769
|
+
const announce = (value) => {
|
|
44770
|
+
const text2 = encode3(value) + "\n";
|
|
44771
|
+
if (managed2) managed2.notice(text2);
|
|
44772
|
+
else output3(text2);
|
|
44773
|
+
};
|
|
44774
|
+
announce({ warning: transferWarning });
|
|
44775
|
+
const flags = /* @__PURE__ */ new Map();
|
|
44776
|
+
for (let index = 0; index < args.length; index++) {
|
|
44777
|
+
const name = args[index];
|
|
44778
|
+
if (["--execute", "--password-stdin", "--sso"].includes(name)) flags.set(name, "true");
|
|
44779
|
+
else flags.set(name, args[++index]);
|
|
44780
|
+
}
|
|
44781
|
+
const destination = flags.get("--destination") ?? "";
|
|
44782
|
+
const input2 = transferPrepareSchema.safeParse({
|
|
44783
|
+
selection: {
|
|
44784
|
+
operation: flags.get("--operation"),
|
|
44785
|
+
selector: flags.get("--selector"),
|
|
44786
|
+
type: flags.get("--type")
|
|
44787
|
+
},
|
|
44788
|
+
targetDigest: createHash4("sha256").update(destination).digest("hex")
|
|
44789
|
+
});
|
|
44790
|
+
if (!input2.success || !destination || flags.has("--sso") && flags.has("--password-stdin")) throw new ArtiumError("INVALID_INPUT");
|
|
44791
|
+
const execute = flags.has("--execute");
|
|
44792
|
+
if (execute !== flags.has("--transfer") || execute !== flags.has("--confirm")) throw new ArtiumError("INVALID_INPUT");
|
|
44793
|
+
let execution;
|
|
44794
|
+
if (execute) {
|
|
44795
|
+
const parsed = transferExecuteSchema.safeParse({
|
|
44796
|
+
...input2.data,
|
|
44797
|
+
transferId: flags.get("--transfer"),
|
|
44798
|
+
execute: true,
|
|
44799
|
+
confirm: flags.get("--confirm")
|
|
44800
|
+
});
|
|
44801
|
+
if (!parsed.success) throw new ArtiumError("INVALID_INPUT");
|
|
44802
|
+
execution = parsed.data;
|
|
44803
|
+
}
|
|
44804
|
+
const client = new Client(process.env, managed2);
|
|
44805
|
+
const local = await artifactDestination(destination);
|
|
44806
|
+
const interrupt = () => client.cancel();
|
|
44807
|
+
process.once("SIGINT", interrupt);
|
|
44808
|
+
process.once("SIGTERM", interrupt);
|
|
44809
|
+
try {
|
|
44810
|
+
await client.transferSession(async (token) => {
|
|
44811
|
+
let proof;
|
|
44812
|
+
if (flags.has("--sso")) {
|
|
44813
|
+
const start = deviceStartResponseSchema.parse(await client.request("/v1/auth/reauth", "POST", {}, token));
|
|
44814
|
+
if (start.verificationUri !== client.serverUrl + "/device") throw new ArtiumError("INVALID_RESPONSE");
|
|
44815
|
+
managed2?.protect(start.deviceCode);
|
|
44816
|
+
announce({ status: "approval-required", open: start.verificationUri, code: start.userCode, expiresAt: start.expiresAt });
|
|
44817
|
+
while (Date.now() < start.expiresAt) {
|
|
44818
|
+
try {
|
|
44819
|
+
proof = ssoReauthResponseSchema.parse(await client.request("/v1/auth/reauth", "POST", { deviceCode: start.deviceCode }, token));
|
|
44820
|
+
if (reauthResponseSchema.safeParse(proof).success) break;
|
|
44821
|
+
} catch (error62) {
|
|
44822
|
+
if (!(error62 instanceof ArtiumError) || error62.code !== "DEVICE_POLL_LIMITED") throw error62;
|
|
44823
|
+
}
|
|
44824
|
+
await delay(Math.min(start.intervalMs, Math.max(0, start.expiresAt - Date.now())));
|
|
44825
|
+
}
|
|
44826
|
+
} else {
|
|
44827
|
+
const password = await readPassword(flags.has("--password-stdin"));
|
|
44828
|
+
managed2?.protect(password);
|
|
44829
|
+
proof = await client.request("/v1/auth/reauth", "POST", { password }, token);
|
|
44830
|
+
}
|
|
44831
|
+
const { ticket } = reauthResponseSchema.parse(proof);
|
|
44832
|
+
managed2?.protect(ticket);
|
|
44833
|
+
const request = (path, body) => client.request(
|
|
44834
|
+
path,
|
|
44835
|
+
"POST",
|
|
44836
|
+
body,
|
|
44837
|
+
token,
|
|
44838
|
+
false,
|
|
44839
|
+
{ "x-artium-reauth-ticket": ticket }
|
|
44840
|
+
);
|
|
44841
|
+
if (!execution) {
|
|
44842
|
+
const preview = transferPreviewSchema.parse(await request(transferRoutes.prepare.path, input2.data));
|
|
44843
|
+
if (preview.targetDigest !== input2.data.targetDigest) throw new ArtiumError("INVALID_RESPONSE");
|
|
44844
|
+
announce({
|
|
44845
|
+
...input2.data.selection,
|
|
44846
|
+
destination,
|
|
44847
|
+
limits: transferLimits,
|
|
44848
|
+
...preview,
|
|
44849
|
+
saveOutcome: "unconfirmed",
|
|
44850
|
+
next: "Repeat this exact selection and destination with --transfer <transferId> --execute --confirm <exact confirm> and recent identity confirmation. No automatic retries."
|
|
44851
|
+
});
|
|
44852
|
+
return;
|
|
44853
|
+
}
|
|
44854
|
+
const retrieval = { ...input2.data, transferId: execution.transferId };
|
|
44855
|
+
let archive;
|
|
44856
|
+
let saved = false;
|
|
44857
|
+
let receipt = "unconfirmed";
|
|
44858
|
+
try {
|
|
44859
|
+
const pending = transferStatusSchema.parse(await request(transferRoutes.status.path, retrieval));
|
|
44860
|
+
if (pending.transferId !== execution.transferId || pending.outcome !== "preview" || pending.archive !== null) throw new ArtiumError("INVALID_RESPONSE");
|
|
44861
|
+
announce({
|
|
44862
|
+
...input2.data.selection,
|
|
44863
|
+
destination,
|
|
44864
|
+
limits: transferLimits,
|
|
44865
|
+
expiresAt: pending.expiresAt,
|
|
44866
|
+
saveOutcome: "unconfirmed"
|
|
44867
|
+
});
|
|
44868
|
+
const status = transferStatusSchema.parse(await request(transferRoutes.execute.path, execution));
|
|
44869
|
+
if (status.transferId !== execution.transferId || status.expiresAt !== pending.expiresAt || status.outcome !== "ready" || !status.archive) throw new ArtiumError("INVALID_RESPONSE");
|
|
44870
|
+
archive = status.archive;
|
|
44871
|
+
await client.artifact(
|
|
44872
|
+
transferRoutes.retrieve.path,
|
|
44873
|
+
retrieval,
|
|
44874
|
+
token,
|
|
44875
|
+
ticket,
|
|
44876
|
+
status.expiresAt,
|
|
44877
|
+
(response, signal) => local.save(response, archive, signal)
|
|
44878
|
+
);
|
|
44879
|
+
saved = true;
|
|
44880
|
+
await local.close();
|
|
44881
|
+
try {
|
|
44882
|
+
await request(transferRoutes.receipt.path, { ...retrieval, archive, saveOutcome: "verified-save" });
|
|
44883
|
+
receipt = "confirmed";
|
|
44884
|
+
} catch {
|
|
44885
|
+
}
|
|
44886
|
+
} catch (error62) {
|
|
44887
|
+
if (archive && !saved) {
|
|
44888
|
+
try {
|
|
44889
|
+
await request(transferRoutes.receipt.path, { ...retrieval, archive, saveOutcome: "save-failed" });
|
|
44890
|
+
} catch {
|
|
44891
|
+
}
|
|
44892
|
+
}
|
|
44893
|
+
try {
|
|
44894
|
+
await request(transferRoutes.cancel.path, retrieval);
|
|
44895
|
+
} catch {
|
|
44896
|
+
}
|
|
44897
|
+
throw error62;
|
|
44898
|
+
} finally {
|
|
44899
|
+
output3(encode3({
|
|
44900
|
+
...input2.data.selection,
|
|
44901
|
+
destination,
|
|
44902
|
+
archiveBytes: archive?.archiveBytes ?? null,
|
|
44903
|
+
archiveSha256: archive?.archiveSha256 ?? null,
|
|
44904
|
+
saveOutcome: saved ? "verified-save" : "save-failed",
|
|
44905
|
+
receipt
|
|
44906
|
+
}) + "\n");
|
|
44907
|
+
}
|
|
44908
|
+
});
|
|
44909
|
+
} catch (error62) {
|
|
44910
|
+
if (error62 instanceof ZodError) throw new ArtiumError("INVALID_RESPONSE");
|
|
44911
|
+
throw error62;
|
|
44912
|
+
} finally {
|
|
44913
|
+
process.off("SIGINT", interrupt);
|
|
44914
|
+
process.off("SIGTERM", interrupt);
|
|
44915
|
+
await local.close();
|
|
44916
|
+
}
|
|
44917
|
+
}
|
|
44918
|
+
|
|
44360
44919
|
// src/cli/main.ts
|
|
44361
44920
|
var managed;
|
|
44362
44921
|
for (const stream of [process.stdout, process.stderr]) {
|
|
@@ -44406,6 +44965,10 @@ async function main(args) {
|
|
|
44406
44965
|
output2("stdout", await update());
|
|
44407
44966
|
return;
|
|
44408
44967
|
}
|
|
44968
|
+
if (command === "download") {
|
|
44969
|
+
await download(args.slice(1), (text2) => output2("stdout", text2), managed);
|
|
44970
|
+
return;
|
|
44971
|
+
}
|
|
44409
44972
|
if (command === "setup") {
|
|
44410
44973
|
output2("stdout", await setup(args.slice(1)));
|
|
44411
44974
|
return;
|
|
@@ -44517,17 +45080,23 @@ remoteRevocation: ${verified ? "verified" : "unverified"}
|
|
|
44517
45080
|
const client = new Client(process.env, managed);
|
|
44518
45081
|
const homeSession = home && !managed ? client.sessions.read() : void 0;
|
|
44519
45082
|
if (home && !managed && !homeSession) throw new ArtiumError("TOKEN_INVALID", void 0, "Run artium-axi login --username <username> --password-stdin.");
|
|
44520
|
-
const result = await
|
|
45083
|
+
const [result, homeTools] = (await Promise.allSettled([
|
|
45084
|
+
client.authenticated(home || whoami ? "/v1/me" : `/v1/tools${listing ? "" : `/${command}/run`}`, home || listing || whoami ? "GET" : "POST", input2, homeSession),
|
|
45085
|
+
home ? client.authenticated("/v1/tools", "GET", void 0, homeSession) : void 0
|
|
45086
|
+
])).map((response) => {
|
|
45087
|
+
if (response.status === "rejected") throw response.reason;
|
|
45088
|
+
return response.value;
|
|
45089
|
+
});
|
|
44521
45090
|
if (home || whoami) {
|
|
44522
45091
|
const parsed = meResponseSchema.safeParse(result);
|
|
44523
45092
|
if (!parsed.success) throw new ArtiumError("INVALID_RESPONSE");
|
|
44524
45093
|
let view = identityView(parsed.data, client.serverUrl);
|
|
44525
45094
|
if (home) {
|
|
44526
|
-
const tools = toolsResponseSchema.safeParse(
|
|
45095
|
+
const tools = toolsResponseSchema.safeParse(homeTools);
|
|
44527
45096
|
if (!tools.success) throw new ArtiumError("INVALID_RESPONSE");
|
|
44528
|
-
const executable =
|
|
45097
|
+
const executable = resolve4(process.argv[1]);
|
|
44529
45098
|
const local = relative(homedir3(), executable);
|
|
44530
|
-
const bin = local && !
|
|
45099
|
+
const bin = local && !isAbsolute2(local) && !local.startsWith(`..${sep}`) && local !== ".." ? `~${sep}${local}` : executable;
|
|
44531
45100
|
view = `bin: ${JSON.stringify(bin)}
|
|
44532
45101
|
description: Run managed upstream tools through one local sign-in.
|
|
44533
45102
|
${view}${toolsView(tools.data.tools)}`;
|
|
@@ -44554,16 +45123,20 @@ ${view}${toolsView(tools.data.tools)}`;
|
|
|
44554
45123
|
}
|
|
44555
45124
|
}
|
|
44556
45125
|
function printError(response) {
|
|
45126
|
+
if (process.argv[2] === "download" || process.argv[2] === "--managed-session" && process.argv[3] === "download") {
|
|
45127
|
+
output2("stdout", `warning: ${JSON.stringify(transferWarning)}
|
|
45128
|
+
`);
|
|
45129
|
+
}
|
|
44557
45130
|
output2("stdout", `error:
|
|
44558
45131
|
${Object.entries(response.error).map(([key, value]) => ` ${key}: ${JSON.stringify(value)}`).join("\n")}
|
|
44559
45132
|
`);
|
|
44560
45133
|
process.exitCode = errors[response.error.code].exitCode;
|
|
44561
45134
|
}
|
|
44562
|
-
main(process.argv.slice(2)).catch((error62) => printError(errorResponse(error62 instanceof ArtiumError ? error62 : new ArtiumError("INTERNAL_ERROR"),
|
|
45135
|
+
main(process.argv.slice(2)).catch((error62) => printError(errorResponse(error62 instanceof ArtiumError ? error62 : new ArtiumError("INTERNAL_ERROR"), randomUUID5()))).then(() => {
|
|
44563
45136
|
try {
|
|
44564
45137
|
managed?.flush();
|
|
44565
45138
|
} catch {
|
|
44566
45139
|
managed = void 0;
|
|
44567
|
-
printError(errorResponse(new ArtiumError("SECRET_IN_OUTPUT"),
|
|
45140
|
+
printError(errorResponse(new ArtiumError("SECRET_IN_OUTPUT"), randomUUID5()));
|
|
44568
45141
|
}
|
|
44569
45142
|
});
|