feat: show node PATH and bootstrap node host env
This commit is contained in:
@@ -53,6 +53,7 @@ export type GatewayClientOptions = {
|
||||
caps?: string[];
|
||||
commands?: string[];
|
||||
permissions?: Record<string, boolean>;
|
||||
pathEnv?: string;
|
||||
deviceIdentity?: DeviceIdentity;
|
||||
minProtocol?: number;
|
||||
maxProtocol?: number;
|
||||
@@ -232,6 +233,7 @@ export class GatewayClient {
|
||||
this.opts.permissions && typeof this.opts.permissions === "object"
|
||||
? this.opts.permissions
|
||||
: undefined,
|
||||
pathEnv: this.opts.pathEnv,
|
||||
auth,
|
||||
role,
|
||||
scopes,
|
||||
|
||||
@@ -17,6 +17,7 @@ export type NodeSession = {
|
||||
caps: string[];
|
||||
commands: string[];
|
||||
permissions?: Record<string, boolean>;
|
||||
pathEnv?: string;
|
||||
connectedAtMs: number;
|
||||
};
|
||||
|
||||
@@ -51,6 +52,10 @@ export class NodeRegistry {
|
||||
typeof (connect as { permissions?: Record<string, boolean> }).permissions === "object"
|
||||
? ((connect as { permissions?: Record<string, boolean> }).permissions ?? undefined)
|
||||
: undefined;
|
||||
const pathEnv =
|
||||
typeof (connect as { pathEnv?: string }).pathEnv === "string"
|
||||
? (connect as { pathEnv?: string }).pathEnv
|
||||
: undefined;
|
||||
const session: NodeSession = {
|
||||
nodeId,
|
||||
connId: client.connId,
|
||||
@@ -66,6 +71,7 @@ export class NodeRegistry {
|
||||
caps,
|
||||
commands,
|
||||
permissions,
|
||||
pathEnv,
|
||||
connectedAtMs: Date.now(),
|
||||
};
|
||||
this.nodesById.set(nodeId, session);
|
||||
|
||||
@@ -37,6 +37,7 @@ export const ConnectParamsSchema = Type.Object(
|
||||
caps: Type.Optional(Type.Array(NonEmptyString, { default: [] })),
|
||||
commands: Type.Optional(Type.Array(NonEmptyString)),
|
||||
permissions: Type.Optional(Type.Record(NonEmptyString, Type.Boolean())),
|
||||
pathEnv: Type.Optional(Type.String()),
|
||||
role: Type.Optional(NonEmptyString),
|
||||
scopes: Type.Optional(Type.Array(NonEmptyString)),
|
||||
device: Type.Optional(
|
||||
|
||||
@@ -275,6 +275,7 @@ export const nodeHandlers: GatewayRequestHandlers = {
|
||||
remoteIp: live?.remoteIp ?? paired?.remoteIp,
|
||||
caps,
|
||||
commands,
|
||||
pathEnv: live?.pathEnv,
|
||||
permissions: live?.permissions ?? paired?.permissions,
|
||||
connectedAtMs: live?.connectedAtMs,
|
||||
paired: Boolean(paired),
|
||||
@@ -338,6 +339,7 @@ export const nodeHandlers: GatewayRequestHandlers = {
|
||||
remoteIp: live?.remoteIp ?? paired?.remoteIp,
|
||||
caps,
|
||||
commands,
|
||||
pathEnv: live?.pathEnv,
|
||||
permissions: live?.permissions,
|
||||
connectedAtMs: live?.connectedAtMs,
|
||||
paired: Boolean(paired),
|
||||
|
||||
Reference in New Issue
Block a user