From 1db71d93650129ad820d7402f436ae81e0758e08 Mon Sep 17 00:00:00 2001 From: Amy Yan Date: Mon, 22 Jul 2024 10:39:41 +1000 Subject: [PATCH] wip --- src/nodes/NodeConnection.ts | 1 + .../handlers/NodesNetworkAuthenticate.ts | 35 +++++++++++++++++++ src/nodes/agent/types.ts | 5 +++ 3 files changed, 41 insertions(+) create mode 100644 src/nodes/agent/handlers/NodesNetworkAuthenticate.ts diff --git a/src/nodes/NodeConnection.ts b/src/nodes/NodeConnection.ts index 095379c06..8b059f511 100644 --- a/src/nodes/NodeConnection.ts +++ b/src/nodes/NodeConnection.ts @@ -25,6 +25,7 @@ import * as nodesUtils from '../nodes/utils'; import { never } from '../utils'; import config from '../config'; import * as networkUtils from '../network/utils'; +import * as keysUtils from '../keys/utils'; type AgentClientManifest = typeof agentClientManifest; diff --git a/src/nodes/agent/handlers/NodesNetworkAuthenticate.ts b/src/nodes/agent/handlers/NodesNetworkAuthenticate.ts new file mode 100644 index 000000000..fd12bcded --- /dev/null +++ b/src/nodes/agent/handlers/NodesNetworkAuthenticate.ts @@ -0,0 +1,35 @@ +import type { + AgentRPCRequestParams, + AgentRPCResponseResult, + HolePunchSignalMessage, + AddressMessage, + CertificateSigningRequestMessage, +} from '../types'; +import type NodeConnectionManager from '../../../nodes/NodeConnectionManager'; +import type { Host, Port } from '../../../network/types'; +import type { JSONValue } from '../../../types'; +import { UnaryHandler } from '@matrixai/rpc'; +import * as agentErrors from '../errors'; +import * as agentUtils from '../utils'; +import { never } from '../../../utils'; +import * as keysUtils from '../../../keys/utils'; +import * as ids from '../../../ids'; +import * as x509 from '@peculiar/x509'; + +class NodesNetworkAuthenticate extends UnaryHandler< + { + nodeConnectionManager: NodeConnectionManager; + }, + AgentRPCRequestParams, + AgentRPCResponseResult<{}> +> { + public handle = async ( + input: AgentRPCRequestParams, + _cancel, + meta: Record | undefined, + ): Promise> => { + return {}; + }; +} + +export default NodesNetworkAuthenticate; diff --git a/src/nodes/agent/types.ts b/src/nodes/agent/types.ts index abec3d5a4..60ed56a83 100644 --- a/src/nodes/agent/types.ts +++ b/src/nodes/agent/types.ts @@ -64,6 +64,10 @@ type HolePunchSignalMessage = { signature: string; }; +type CertificateSigningRequestMessage = { + +}; + type SignedNotificationEncoded = { signedNotificationEncoded: SignedNotification; }; @@ -88,6 +92,7 @@ export type { ActiveConnectionDataMessage, HolePunchRequestMessage, HolePunchSignalMessage, + CertificateSigningRequestMessage, SignedNotificationEncoded, VaultInfo, VaultsScanMessage,