1616// node-wot implementation of W3C WoT Servient
1717
1818import { expect } from "chai" ;
19- import path , { resolve } from "path" ;
19+ import path from "path" ;
2020import {
2121 OPCUACUserNameAuthenticationScheme ,
2222 OPCUACertificateAuthenticationScheme ,
@@ -26,14 +26,7 @@ import {
2626} from "@node-wot/core" ;
2727import { InteractionOptions } from "wot-typescript-definitions" ;
2828
29- import {
30- IBasicSessionCallAsync ,
31- MessageSecurityMode ,
32- ObjectIds ,
33- OPCUAClient ,
34- OPCUAServer ,
35- SecurityPolicy ,
36- } from "node-opcua" ;
29+ import { MessageSecurityMode , OPCUAClient , OPCUAServer , SecurityPolicy } from "node-opcua" ;
3730import { coercePrivateKeyPem , readCertificate , readCertificatePEM , readPrivateKey } from "node-opcua-crypto" ;
3831import { OPCUAClientFactory , OPCUAProtocolClient } from "../src" ;
3932import { startServer } from "./fixture/basic-opcua-server" ;
@@ -57,52 +50,52 @@ const thingDescription: WoT.ThingDescription = {
5750 } ,
5851 // OPCUAChannelSecurityScheme
5952 "c:sign-encrypt_basic256Sha256" : < OPCUAChannelSecurityScheme > {
60- scheme : "opcua- channel-security" ,
53+ scheme : "uav: channel-security" ,
6154 messageMode : "sign_encrypt" ,
6255 policy : "Basic256Sha256" , // deprecated
6356 } ,
6457 // Aes128_Sha256_RsaOaep
6558 "c:sign-encrypt_aes128Sha256RsaOaep" : < OPCUAChannelSecurityScheme > {
66- scheme : "opcua- channel-security" ,
59+ scheme : "uav: channel-security" ,
6760 messageMode : "sign_encrypt" ,
6861 policy : "Aes128_Sha256_RsaOaep" ,
6962 } ,
7063
7164 "c:sign_basic256Sha256" : < OPCUAChannelSecurityScheme > {
72- scheme : "opcua- channel-security" ,
65+ scheme : "uav: channel-security" ,
7366 messageMode : "sign" ,
7467 policy : "Basic256Sha256" ,
7568 } ,
7669 "c:invalid-sign" : < OPCUAChannelSecurityScheme > {
77- scheme : "opcua- channel-security" ,
70+ scheme : "uav: channel-security" ,
7871 messageMode : "sign" ,
7972 policy : "Basic192Rsa15" , // Basic192Rsa15 valid policy but unsupported by server
8073 } ,
8174 "c:no_security" : < OPCUAChannelSecurityScheme > {
82- scheme : "opcua- channel-security" ,
75+ scheme : "uav: channel-security" ,
8376 messageMode : "none" ,
8477 } ,
8578 //
8679 "a:username-password" : < OPCUACUserNameAuthenticationScheme > {
87- scheme : "opcua- authentication" ,
80+ scheme : "uav: authentication" ,
8881 tokenType : "username" ,
8982 userName : "joe" ,
9083 password : "password_for_joe" ,
9184 } ,
9285 "a:username-invalid-password" : < OPCUACUserNameAuthenticationScheme > {
93- scheme : "opcua- authentication" ,
86+ scheme : "uav: authentication" ,
9487 tokenType : "username" ,
9588 userName : "joe" ,
9689 password : "**INVALID**password_for_joe" ,
9790 } ,
9891 "a:x509-certificate" : < OPCUACertificateAuthenticationScheme > {
99- scheme : "opcua- authentication" ,
92+ scheme : "uav: authentication" ,
10093 tokenType : "certificate" ,
10194 certificate : "...." ,
10295 privateKey : "...." ,
10396 } ,
10497 "a:x509-certificate-no-private-key" : < OPCUACertificateAuthenticationScheme > {
105- scheme : "opcua- authentication" ,
98+ scheme : "uav: authentication" ,
10699 tokenType : "certificate" ,
107100 certificate : "...." ,
108101 privateKey : undefined ,
@@ -297,12 +290,12 @@ describe("verify test securityDefinitions", () => {
297290 for ( const subKey of comboDef . allOf ) {
298291 expect ( definitions ) . to . have . property ( subKey ) ;
299292 }
300- } else if ( def . scheme === "opcua- channel-security" ) {
293+ } else if ( def . scheme === "uav: channel-security" ) {
301294 const channelDef = def as OPCUAChannelSecurityScheme ;
302295 expect ( channelDef ) . to . have . property ( "messageMode" ) ;
303296 expect ( [ "none" , "sign" , "sign_encrypt" ] ) . to . include ( channelDef . messageMode ) ;
304297 // policy is optional
305- } else if ( def . scheme === "opcua- authentication" ) {
298+ } else if ( def . scheme === "uav: authentication" ) {
306299 const authDef = def as OPCUACertificateAuthenticationScheme | OPCUACUserNameAuthenticationScheme ;
307300 expect ( authDef ) . to . have . property ( "tokenType" ) ;
308301 if ( authDef . tokenType === "username" ) {
0 commit comments