Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
var should = require("should");
var assert = require("node-opcua-assert").assert;
var endpoints_service = require("node-opcua-service-endpoints");
var GetEndpointsResponse = endpoints_service.GetEndpointsResponse;
var EndpointDescription = require("node-opcua-service-endpoints").EndpointDescription;
var ApplicationType = require("node-opcua-service-endpoints").ApplicationType;
var UserTokenType = require("node-opcua-service-endpoints").UserTokenType;
var MessageSecurityMode = require("node-opcua-service-secure-channel").MessageSecurityMode;
exports.fixture1 = (function () {
// empty GetEndpointsResponse
return new GetEndpointsResponse();
})();
exports.makeEndPoint = function () {
var data = {
endpointUrl: "toto",
server: {
// try one level up
filename = path.join(__dirname, p);
if(!fs.existsSync(filename)) {
throw new Error("Cannot find filename " + filename + " ( __dirname = " + __dirname);
}
}
return filename;
}
const debugLog = require("node-opcua-debug").make_debugLog(__filename);
const StatusCodes = require("node-opcua-status-code").StatusCodes;
const endpoints_service = require("node-opcua-service-endpoints");
const GetEndpointsResponse = endpoints_service.GetEndpointsResponse;
const ApplicationType = endpoints_service.ApplicationType;
const OPCUASecureObject = require("node-opcua-common").OPCUASecureObject;
const discovery_service = require("node-opcua-service-discovery");
const FindServersRequest = discovery_service.FindServersRequest;
const FindServersResponse = discovery_service.FindServersResponse;
const LocalizedText = require("node-opcua-data-model").LocalizedText;
const default_server_info = {
// The globally unique identifier for the application instance. This URI is used as
// ServerUri in Services if the application is a Server.
applicationUri: "urn:NodeOPCUA-Server-default",
// The globally unique identifier for the product.
// services
module.exports.browse_service = require("node-opcua-service-browse");
module.exports.read_service = require("node-opcua-service-read");
module.exports.write_service = require("node-opcua-service-write");
module.exports.call_service = require("node-opcua-service-call");
module.exports.session_service = require("node-opcua-service-session");
module.exports.AnonymousIdentityToken = module.exports.session_service.AnonymousIdentityToken;
module.exports.UserNameIdentityToken = module.exports.session_service.UserNameIdentityToken;
module.exports.register_node_service = require("node-opcua-service-register-node");
module.exports.get_endpoints_service = require("node-opcua-service-endpoints");
module.exports.EndpointDescription = require("node-opcua-service-endpoints").EndpointDescription;
module.exports.ApplicationType = require("node-opcua-service-endpoints").ApplicationType;
module.exports.UserTokenPolicy = require("node-opcua-service-endpoints").UserTokenPolicy;
module.exports.UserIdentityTokenType = require("node-opcua-service-endpoints").UserIdentityTokenType;
module.exports.subscription_service = require("node-opcua-service-subscription");
module.exports.historizing_service = require("node-opcua-service-history");
module.exports.discovery_service = require("node-opcua-service-discovery");
module.exports.secure_channel_service = require("node-opcua-service-secure-channel");
module.exports.translate_browse_paths_to_node_ids_service = require("node-opcua-service-translate-browse-path");
module.exports.BrowsePath = require("node-opcua-service-translate-browse-path").BrowsePath;
module.exports.makeRelativePath = require("node-opcua-service-translate-browse-path").makeRelativePath;
module.exports.makeBrowsePath = require("node-opcua-service-translate-browse-path").makeBrowsePath;
module.exports.query_service = require("node-opcua-service-query");
module.exports.node_managment_service = require("node-opcua-service-node-management");
const OPCUABaseServer = require("node-opcua-server").OPCUABaseServer;
const OPCUAServerEndPoint = require("node-opcua-server").OPCUAServerEndPoint;
const StatusCodes = require("node-opcua-status-code").StatusCodes;
const discovery_service = require("node-opcua-service-discovery");
const RegisterServerRequest = discovery_service.RegisterServerRequest;
const RegisterServerResponse = discovery_service.RegisterServerResponse;
const RegisterServer2Request = discovery_service.RegisterServer2Request;
const RegisterServer2Response = discovery_service.RegisterServer2Response;
const FindServersOnNetworkRequest = discovery_service.FindServersOnNetworkRequest;
const FindServersOnNetworkResponse = discovery_service.FindServersOnNetworkResponse;
const endpoints_service = require("node-opcua-service-endpoints");
const ApplicationType = endpoints_service.ApplicationType;
const get_fully_qualified_domain_name = require("node-opcua-hostname").get_fully_qualified_domain_name;
const debugLog = require("node-opcua-debug").make_debugLog(__filename);
const doDebug = false;
const _announcedOnMulticastSubnet = require("node-opcua-service-discovery")._announcedOnMulticastSubnet;
const _stop_announcedOnMulticastSubnet = require("node-opcua-service-discovery")._stop_announcedOnMulticastSubnet;
const _announceServerOnMulticastSubnet = require("node-opcua-service-discovery")._announceServerOnMulticastSubnet;
function constructFilename(p) {
const filename = path.join(__dirname, "..", p);
//xx console.log("fi = ",filename);
return filename;
}
const async = require("async");
const chalk = require("chalk");
const StatusCodes = require("node-opcua-status-code").StatusCodes;
const session_service = require("node-opcua-service-session");
const AnonymousIdentityToken = session_service.AnonymousIdentityToken;
const CreateSessionRequest = session_service.CreateSessionRequest;
const CreateSessionResponse = session_service.CreateSessionResponse;
const ActivateSessionRequest = session_service.ActivateSessionRequest;
const ActivateSessionResponse = session_service.ActivateSessionResponse;
const CloseSessionRequest = session_service.CloseSessionRequest;
const endpoints_service = require("node-opcua-service-endpoints");
const ApplicationDescription = endpoints_service.ApplicationDescription;
const ApplicationType = endpoints_service.ApplicationType;
const EndpointDescription = endpoints_service.EndpointDescription;
const MessageSecurityMode = require("node-opcua-service-secure-channel").MessageSecurityMode;
const SecurityPolicy = require("node-opcua-secure-channel").SecurityPolicy;
const getCryptoFactory = require("node-opcua-secure-channel").getCryptoFactory;
const fromURI = require("node-opcua-secure-channel").fromURI;
const crypto_utils = require("node-opcua-crypto");
const UserNameIdentityToken = session_service.UserNameIdentityToken;
const buffer_utils = require("node-opcua-buffer-utils");
const createFastUninitializedBuffer = buffer_utils.createFastUninitializedBuffer;
const UserIdentityTokenType = require("node-opcua-service-endpoints").UserIdentityTokenType;
"use strict";
/*global: require Buffer*/
/**
* @module opcua.server
*/
const assert = require("node-opcua-assert").assert;
const async = require("async");
const util = require("util");
const fs = require("fs");
const _ = require("underscore");
const ApplicationType = require("node-opcua-service-endpoints").ApplicationType;
const StatusCodes = require("node-opcua-status-code").StatusCodes;
const SessionContext = require("node-opcua-address-space").SessionContext;
const fromURI = require("node-opcua-secure-channel").fromURI;
const SecurityPolicy = require("node-opcua-secure-channel").SecurityPolicy;
const MessageSecurityMode = require("node-opcua-service-secure-channel").MessageSecurityMode;
const utils = require("node-opcua-utils");
const debugLog = require("node-opcua-debug").make_debugLog(__filename);
const forceGarbageCollectionOnSessionClose = false;
const ServerEngine = require("./server_engine").ServerEngine;
const browse_service = require("node-opcua-service-browse");