node-opcua-server 2.163.1 → 2.165.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addressSpace_accessor.js +7 -5
- package/dist/addressSpace_accessor.js.map +1 -1
- package/dist/base_server.d.ts +95 -18
- package/dist/base_server.js +217 -69
- package/dist/base_server.js.map +1 -1
- package/dist/monitored_item.js +32 -32
- package/dist/monitored_item.js.map +1 -1
- package/dist/node_sampler.js +1 -1
- package/dist/node_sampler.js.map +1 -1
- package/dist/opcua_server.d.ts +171 -123
- package/dist/opcua_server.js +466 -223
- package/dist/opcua_server.js.map +1 -1
- package/dist/register_server_manager.d.ts +2 -2
- package/dist/register_server_manager.js +12 -6
- package/dist/register_server_manager.js.map +1 -1
- package/dist/register_server_manager_mdns_only.js +1 -1
- package/dist/register_server_manager_mdns_only.js.map +1 -1
- package/dist/server_end_point.d.ts +108 -12
- package/dist/server_end_point.js +157 -57
- package/dist/server_end_point.js.map +1 -1
- package/dist/server_engine.d.ts +32 -14
- package/dist/server_engine.js +160 -59
- package/dist/server_engine.js.map +1 -1
- package/dist/server_publish_engine.js +5 -5
- package/dist/server_publish_engine.js.map +1 -1
- package/dist/server_session.js +4 -4
- package/dist/server_session.js.map +1 -1
- package/dist/server_subscription.js +18 -18
- package/dist/server_subscription.js.map +1 -1
- package/dist/sessions_compatible_for_transfer.js +1 -1
- package/dist/sessions_compatible_for_transfer.js.map +1 -1
- package/package.json +47 -47
- package/source/addressSpace_accessor.ts +6 -3
- package/source/base_server.ts +252 -90
- package/source/monitored_item.ts +32 -32
- package/source/node_sampler.ts +1 -1
- package/source/opcua_server.ts +674 -489
- package/source/register_server_manager.ts +11 -5
- package/source/register_server_manager_mdns_only.ts +1 -1
- package/source/server_end_point.ts +278 -94
- package/source/server_engine.ts +246 -135
- package/source/server_publish_engine.ts +5 -5
- package/source/server_session.ts +4 -4
- package/source/server_subscription.ts +18 -18
- package/source/sessions_compatible_for_transfer.ts +4 -2
|
@@ -10,10 +10,12 @@ const node_opcua_assert_1 = __importDefault(require("node-opcua-assert"));
|
|
|
10
10
|
const node_opcua_data_value_1 = require("node-opcua-data-value");
|
|
11
11
|
const node_opcua_date_time_1 = require("node-opcua-date-time");
|
|
12
12
|
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
13
|
-
const node_opcua_pki_1 = require("node-opcua-pki");
|
|
14
13
|
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
15
14
|
const node_opcua_types_1 = require("node-opcua-types");
|
|
16
15
|
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
16
|
+
const node_opcua_debug_1 = require("node-opcua-debug");
|
|
17
|
+
const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
|
|
18
|
+
const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
|
|
17
19
|
function checkReadProcessedDetails(historyReadDetails) {
|
|
18
20
|
if (!historyReadDetails.aggregateConfiguration) {
|
|
19
21
|
historyReadDetails.aggregateConfiguration = new node_opcua_types_1.AggregateConfiguration({
|
|
@@ -272,7 +274,7 @@ class AddressSpaceAccessor {
|
|
|
272
274
|
return new node_opcua_types_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadNodeIdUnknown });
|
|
273
275
|
}
|
|
274
276
|
else {
|
|
275
|
-
//
|
|
277
|
+
// c8 ignore next
|
|
276
278
|
if (!obj.historyRead) {
|
|
277
279
|
// note : Object and View may also support historyRead to provide Event historical data
|
|
278
280
|
// todo implement historyRead for Object and View
|
|
@@ -286,9 +288,9 @@ class AddressSpaceAccessor {
|
|
|
286
288
|
"\n" +
|
|
287
289
|
"HistoryReadDetails " +
|
|
288
290
|
historyReadDetails.toString();
|
|
289
|
-
//
|
|
290
|
-
if (
|
|
291
|
-
|
|
291
|
+
// c8 ignore next
|
|
292
|
+
if (doDebug) {
|
|
293
|
+
debugLog(chalk_1.default.cyan("ServerEngine#_historyReadNode "), chalk_1.default.white.bold(msg));
|
|
292
294
|
}
|
|
293
295
|
throw new Error(msg);
|
|
294
296
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addressSpace_accessor.js","sourceRoot":"","sources":["../source/addressSpace_accessor.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,uEAMkC;AAElC,0EAAuC;AAEvC,iEAA0H;AAC1H,+DAAkE;AAClE,yDAAwE;AAExE,
|
|
1
|
+
{"version":3,"file":"addressSpace_accessor.js","sourceRoot":"","sources":["../source/addressSpace_accessor.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,uEAMkC;AAElC,0EAAuC;AAEvC,iEAA0H;AAC1H,+DAAkE;AAClE,yDAAwE;AAExE,mEAAiE;AACjE,uDAe0B;AAC1B,2DAA6C;AAE7C,uDAAiE;AAEjE,MAAM,OAAO,GAAG,IAAA,iCAAc,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAE3C,SAAS,yBAAyB,CAAC,kBAAwC;IACvE,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;QAC7C,kBAAkB,CAAC,sBAAsB,GAAG,IAAI,yCAAsB,CAAC;YACnE,6BAA6B,EAAE,IAAI;SACtC,CAAC,CAAC;IACP,CAAC;IACD,IAAI,kBAAkB,CAAC,sBAAsB,CAAC,6BAA6B,EAAE,CAAC;QAC1E,OAAO,oCAAW,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,iFAAiF;IACjF,qDAAqD;IACrD,2EAA2E;IAC3E,oGAAoG;IACpG,8FAA8F;IAC9F,IACI,kBAAkB,CAAC,sBAAsB,CAAC,eAAe;QACzD,GAAG,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,cAAc,EAChE,CAAC;QACC,OAAO,oCAAW,CAAC,yBAAyB,CAAC;IACjD,CAAC;IACD,6FAA6F;IAC7F,gCAAgC;IAChC,IACI,kBAAkB,CAA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,uFAAuF;gBACvF,wDAAwD;gBACxD,MAAM,GAAG,GACL,sEAAsE;oBACtE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE;oBACrB,GAAG;oBACH,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE;oBACzB,IAAI;oBACJ,OAAO;oBACP,UAAU,CAAC,QAAQ,EAAE;oBACrB,IAAI;oBACJ,qBAAqB;oBACrB,kBAAkB,CAAC,QAAQ,EAAE,CAAC;gBAClC,iBAAiB;gBACjB,IAAI,OAAO,EAAE,CAAC;oBACV,QAAQ,CAAC,eAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC,EAAE,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;gBAClF,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;YACzB,CAAC;YACD,eAAe;YACf,yBAAyB;YACzB,oBAAoB;YACpB,mDAAmD;YACnD,+CAA+C;YAC/C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC;YAE9G,IAAA,2BAAM,EAAC,MAAO,CAAC,OAAO,EAAE,CAAC,CAAC;YAC1B,OAAO,MAAM,CAAC;QAClB,CAAC;IACL,CAAC;CACJ;AAtTD,oDAsTC"}
|
package/dist/base_server.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-server
|
|
3
|
+
*/
|
|
4
|
+
import { type OPCUACertificateManager } from "node-opcua-certificate-manager";
|
|
5
|
+
import { type IOPCUASecureObjectOptions, OPCUASecureObject } from "node-opcua-common";
|
|
6
|
+
import type { Message, ServerSecureChannelLayer } from "node-opcua-secure-channel";
|
|
7
|
+
import { ApplicationDescription, ApplicationType } from "node-opcua-service-endpoints";
|
|
6
8
|
import { ServiceFault } from "node-opcua-service-secure-channel";
|
|
7
|
-
import { StatusCode } from "node-opcua-status-code";
|
|
8
|
-
import { ApplicationDescriptionOptions } from "node-opcua-types";
|
|
9
|
-
import {
|
|
10
|
-
import { OPCUAServerEndPoint } from "./server_end_point";
|
|
9
|
+
import { type StatusCode } from "node-opcua-status-code";
|
|
10
|
+
import type { ApplicationDescriptionOptions, EndpointDescription } from "node-opcua-types";
|
|
11
|
+
import type { OPCUAServerEndPoint } from "./server_end_point";
|
|
11
12
|
/**
|
|
12
13
|
*
|
|
13
14
|
*/
|
|
@@ -31,21 +32,88 @@ export declare class OPCUABaseServer extends OPCUASecureObject {
|
|
|
31
32
|
endpoints: OPCUAServerEndPoint[];
|
|
32
33
|
readonly serverCertificateManager: OPCUACertificateManager;
|
|
33
34
|
capabilitiesForMDNS: string[];
|
|
34
|
-
protected _preInitTask:
|
|
35
|
+
protected _preInitTask: (() => Promise<void>)[];
|
|
35
36
|
protected options: OPCUABaseServerOptions;
|
|
36
37
|
constructor(options?: OPCUABaseServerOptions);
|
|
38
|
+
/**
|
|
39
|
+
* Return additional DNS hostnames to include in the self-signed
|
|
40
|
+
* certificate's SubjectAlternativeName (SAN).
|
|
41
|
+
*
|
|
42
|
+
* The base implementation returns an empty array. Subclasses
|
|
43
|
+
* (e.g. `OPCUAServer`) override this to include hostnames from
|
|
44
|
+
* `alternateHostname` and `advertisedEndpoints`.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
protected getConfiguredHostnames(): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Return additional IP addresses to include in the self-signed
|
|
51
|
+
* certificate's SubjectAlternativeName (SAN) iPAddress entries.
|
|
52
|
+
*
|
|
53
|
+
* The base implementation returns an empty array. Subclasses
|
|
54
|
+
* (e.g. `OPCUAServer`) override this to include IP literals
|
|
55
|
+
* found in `alternateHostname` and `advertisedEndpoints`.
|
|
56
|
+
*
|
|
57
|
+
* These IPs are considered **explicitly configured** by the
|
|
58
|
+
* user and are therefore checked by `checkCertificateSAN()`.
|
|
59
|
+
* In contrast, auto-detected IPs from `getIpAddresses()` are
|
|
60
|
+
* included in the certificate at creation time but are NOT
|
|
61
|
+
* checked later — see `checkCertificateSAN()` for rationale.
|
|
62
|
+
*
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
protected getConfiguredIPs(): string[];
|
|
37
66
|
protected createDefaultCertificate(): Promise<void>;
|
|
38
67
|
initializeCM(): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Compare the current certificate's SAN entries against all
|
|
70
|
+
* explicitly configured hostnames and IPs, and return any
|
|
71
|
+
* that are missing.
|
|
72
|
+
*
|
|
73
|
+
* Returns an empty array when the certificate covers every
|
|
74
|
+
* configured hostname and IP.
|
|
75
|
+
*
|
|
76
|
+
* **Important — ephemeral IP mitigation:**
|
|
77
|
+
* Auto-detected IPs (from `getIpAddresses()`) are deliberately
|
|
78
|
+
* NOT included in this check. Network interfaces are transient
|
|
79
|
+
* — WiFi IPs change on reconnect, tethering IPs appear/disappear,
|
|
80
|
+
* VPN adapters come and go. Including them would cause the
|
|
81
|
+
* `[NODE-OPCUA-W26]` warning to fire on every server restart
|
|
82
|
+
* whenever the network state differs from when the certificate
|
|
83
|
+
* was originally created.
|
|
84
|
+
*
|
|
85
|
+
* Only **explicitly configured** values are checked:
|
|
86
|
+
* - Hostnames: FQDN, os.hostname(), `alternateHostname` (non-IP),
|
|
87
|
+
* hostnames from `advertisedEndpoints` URLs
|
|
88
|
+
* - IPs: IP literals from `alternateHostname`, IP literals
|
|
89
|
+
* from `advertisedEndpoints` URLs
|
|
90
|
+
*
|
|
91
|
+
* The certificate itself still includes auto-detected IPs at
|
|
92
|
+
* creation time — this is fine because it captures the network
|
|
93
|
+
* state at that moment. But the *mismatch warning* only fires
|
|
94
|
+
* for things the user explicitly asked for.
|
|
95
|
+
*/
|
|
96
|
+
checkCertificateSAN(): string[];
|
|
97
|
+
/**
|
|
98
|
+
* Delete the existing self-signed certificate and create a new
|
|
99
|
+
* one that includes all currently configured hostnames.
|
|
100
|
+
*
|
|
101
|
+
* @throws if the current certificate was NOT self-signed
|
|
102
|
+
* (i.e. issued by a CA or GDS)
|
|
103
|
+
*/
|
|
104
|
+
regenerateSelfSignedCertificate(): Promise<void>;
|
|
105
|
+
private _checkCertificateSanMismatch;
|
|
39
106
|
/**
|
|
40
107
|
* start all registered endPoint, in parallel, and call done when all endPoints are listening.
|
|
41
108
|
*/
|
|
42
|
-
start(
|
|
109
|
+
start(): Promise<void>;
|
|
110
|
+
start(done: () => void): void;
|
|
43
111
|
protected performPreInitialization(): Promise<void>;
|
|
44
112
|
protected startAsync(): Promise<void>;
|
|
45
113
|
/**
|
|
46
114
|
* shutdown all server endPoints
|
|
47
115
|
*/
|
|
48
|
-
shutdown(done: (err?: Error) => void): void;
|
|
116
|
+
shutdown(done: (err?: Error | null) => void): void;
|
|
49
117
|
shutdownChannels(): Promise<void>;
|
|
50
118
|
shutdownChannels(callback: (err?: Error | null) => void): void;
|
|
51
119
|
/**
|
|
@@ -53,15 +121,24 @@ export declare class OPCUABaseServer extends OPCUASecureObject {
|
|
|
53
121
|
*/
|
|
54
122
|
on_request(message: Message, channel: ServerSecureChannelLayer): void;
|
|
55
123
|
/**
|
|
56
|
-
*
|
|
124
|
+
* Find endpoint descriptions matching a given endpoint URL.
|
|
125
|
+
*
|
|
126
|
+
* When `endpointUrl` is provided, only endpoints whose URL matches
|
|
127
|
+
* (case-insensitive) are returned. When `null` or omitted, all
|
|
128
|
+
* endpoints from every `OPCUAServerEndPoint` are returned.
|
|
129
|
+
*
|
|
130
|
+
* This is the shared resolution path used by both `GetEndpoints`
|
|
131
|
+
* and `CreateSession` (`validate_security_endpoint`).
|
|
132
|
+
*
|
|
133
|
+
* @internal (was _get_endpoints)
|
|
57
134
|
*/
|
|
58
|
-
|
|
135
|
+
findMatchingEndpoints(endpointUrl?: string | null): EndpointDescription[];
|
|
59
136
|
/**
|
|
60
137
|
* get one of the possible endpointUrl
|
|
61
138
|
*/
|
|
62
139
|
getEndpointUrl(): string;
|
|
63
140
|
getDiscoveryUrls(): string[];
|
|
64
|
-
getServers(
|
|
141
|
+
getServers(_channel: ServerSecureChannelLayer): ApplicationDescription[];
|
|
65
142
|
/**
|
|
66
143
|
* set all the end point into a state where they do not accept further connections
|
|
67
144
|
*
|
|
@@ -70,15 +147,15 @@ export declare class OPCUABaseServer extends OPCUASecureObject {
|
|
|
70
147
|
*
|
|
71
148
|
*/
|
|
72
149
|
suspendEndPoints(): Promise<void>;
|
|
73
|
-
suspendEndPoints(callback: (err?: Error) => void): void;
|
|
150
|
+
suspendEndPoints(callback: (err?: Error | null) => void): void;
|
|
74
151
|
/**
|
|
75
152
|
* set all the end point into a state where they do accept connections
|
|
76
153
|
* note:
|
|
77
154
|
* this method is useful for testing purpose
|
|
78
155
|
*/
|
|
79
156
|
resumeEndPoints(): Promise<void>;
|
|
80
|
-
resumeEndPoints(callback: (err?: Error) => void): void;
|
|
81
|
-
protected prepare(
|
|
157
|
+
resumeEndPoints(callback: (err?: Error | null) => void): void;
|
|
158
|
+
protected prepare(_message: Message, _channel: ServerSecureChannelLayer): void;
|
|
82
159
|
/**
|
|
83
160
|
* @private
|
|
84
161
|
*/
|