Skip to content

Commit 250be6e

Browse files
committed
chore(core): #1401 use uav: prefix for new opcua security schemes used in tests
1 parent 8158bb8 commit 250be6e

2 files changed

Lines changed: 27 additions & 27 deletions

File tree

packages/core/src/thing-description.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export interface AllOfSecurityScheme extends SecurityScheme {
197197
export type ComboSecurityScheme = AllOfSecurityScheme | OneOfSecurityScheme;
198198

199199
export interface OPCUASecuritySchemeBase extends SecurityScheme, TDT.AdditionalSecurityScheme {
200-
scheme: "opcua-channel-security" | "opcua-authentication";
200+
scheme: "uav:channel-security" | "uav:authentication";
201201
}
202202

203203
export type ValidOPCUASecurityPolicy =
@@ -226,30 +226,30 @@ export type ValidOPCUASecurityPolicy =
226226
*
227227
*/
228228
export interface OPCUASecureSecurityScheme extends OPCUASecuritySchemeBase {
229-
scheme: "opcua-channel-security";
229+
scheme: "uav:channel-security";
230230
policy: ValidOPCUASecurityPolicy;
231231
messageMode: "sign" | "sign_encrypt";
232232
}
233233
export interface OPCUAUnsecureChannelScheme extends OPCUASecuritySchemeBase {
234-
scheme: "opcua-channel-security";
234+
scheme: "uav:channel-security";
235235
policy: never;
236236
messageMode: "none";
237237
}
238238

239239
export type OPCUAChannelSecurityScheme = OPCUASecureSecurityScheme | OPCUAUnsecureChannelScheme;
240240
export interface OPCUACAuthenticationSchemeBase extends OPCUASecuritySchemeBase {
241-
scheme: "opcua-authentication";
241+
scheme: "uav:authentication";
242242
tokenType: "username" | "certificate" | "anonymous";
243243
}
244244

245245
export interface OPCUACUserNameAuthenticationScheme extends OPCUACAuthenticationSchemeBase {
246-
scheme: "opcua-authentication";
246+
scheme: "uav:authentication";
247247
tokenType: "username";
248248
userName: string;
249249
password?: string;
250250
}
251251
export interface OPCUACertificateAuthenticationScheme extends OPCUACAuthenticationSchemeBase {
252-
scheme: "opcua-authentication";
252+
scheme: "uav:authentication";
253253
tokenType: "certificate";
254254
// the certificate in PEM format
255255
// -----BEGIN CERTIFICATE----
@@ -264,7 +264,7 @@ export interface OPCUACertificateAuthenticationScheme extends OPCUACAuthenticati
264264
privateKey?: string;
265265
}
266266
export interface OPCUAAnonymousAuthenticationScheme extends OPCUACAuthenticationSchemeBase {
267-
scheme: "opcua-authentication";
267+
scheme: "uav:authentication";
268268
tokenType: "anonymous";
269269
}
270270
export type OPCUACAuthenticationScheme =

packages/core/test/ClientTest.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -813,14 +813,14 @@ class WoTClientTest {
813813
scheme: "basic",
814814
},
815815
opcua_secure_channel_sc: {
816-
scheme: "opcua-channel-security",
816+
scheme: "uav:channel-security",
817817
},
818-
opcua_authetication_sc: {
819-
scheme: "opcua-authentication",
818+
opcua_authentication_sc: {
819+
scheme: "uav:authentication",
820820
},
821821
combo_sc: {
822822
scheme: "combo",
823-
allOf: ["opcua_secure_channel_sc", "opcua_authetication_sc"],
823+
allOf: ["opcua_secure_channel_sc", "opcua_authentication_sc"],
824824
},
825825
};
826826
ct.security = ["combo_sc"];
@@ -835,8 +835,8 @@ class WoTClientTest {
835835
const comboScheme = pc.securitySchemes[0] as AllOfSecurityScheme;
836836
expect(comboScheme.allOf).instanceOf(Array);
837837
expect(comboScheme.allOf.length).equal(2);
838-
expect(comboScheme.allOf[0].scheme).equals("opcua-channel-security");
839-
expect(comboScheme.allOf[1].scheme).equals("opcua-authentication");
838+
expect(comboScheme.allOf[0].scheme).equals("uav:channel-security");
839+
expect(comboScheme.allOf[1].scheme).equals("uav:authentication");
840840
}
841841

842842
@test "ensure combo security - oneOf"() {
@@ -846,23 +846,23 @@ class WoTClientTest {
846846
scheme: "basic",
847847
},
848848
opcua_secure_channel_encrypt_sc: {
849-
scheme: "opcua-channel-security",
849+
scheme: "uav:channel-security",
850850
mode: "encrypt",
851851
},
852852
opcua_secure_channel_sign_sc: {
853-
scheme: "opcua-channel-security",
853+
scheme: "uav:channel-security",
854854
mode: "sign",
855855
},
856-
opcua_authetication_sc: {
857-
scheme: "opcua-authentication",
856+
opcua_authentication_sc: {
857+
scheme: "uav:authentication",
858858
},
859859
comob_opcua_secure_channel: {
860860
scheme: "combo",
861861
oneOf: ["opcua_secure_channel_encrypt_sc", "opcua_secure_channel_sign_sc"],
862862
},
863863
combo_sc: {
864864
scheme: "combo",
865-
allOf: ["comob_opcua_secure_channel", "opcua_authetication_sc"],
865+
allOf: ["comob_opcua_secure_channel", "opcua_authentication_sc"],
866866
},
867867
};
868868
ct.security = ["combo_sc"];
@@ -879,16 +879,16 @@ class WoTClientTest {
879879
expect(comboScheme.allOf).instanceOf(Array);
880880
expect(comboScheme.allOf.length).equal(2);
881881
expect(comboScheme.allOf[0].scheme).equals("combo");
882-
expect(comboScheme.allOf[1].scheme).equals("opcua-authentication");
882+
expect(comboScheme.allOf[1].scheme).equals("uav:authentication");
883883

884884
//
885885
const firstScheme = comboScheme.allOf[0] as OneOfSecurityScheme;
886886
expect(firstScheme.scheme).equal("combo");
887887
expect(firstScheme.oneOf).instanceOf(Array);
888888

889889
expect(firstScheme.oneOf.length).equal(2);
890-
expect(firstScheme.oneOf[0].scheme).equal("opcua-channel-security");
891-
expect(firstScheme.oneOf[0].scheme).equal("opcua-channel-security");
890+
expect(firstScheme.oneOf[0].scheme).equal("uav:channel-security");
891+
expect(firstScheme.oneOf[1].scheme).equal("uav:channel-security");
892892
}
893893

894894
@test "ensure combo security in form - allOf"() {
@@ -898,14 +898,14 @@ class WoTClientTest {
898898
scheme: "basic",
899899
},
900900
opcua_secure_channel_sc: {
901-
scheme: "opcua-channel-security",
901+
scheme: "uav:channel-security",
902902
},
903-
opcua_authetication_sc: {
904-
scheme: "opcua-authentication",
903+
opcua_authentication_sc: {
904+
scheme: "uav:authentication",
905905
},
906906
combo_sc: {
907907
scheme: "combo",
908-
allOf: ["opcua_secure_channel_sc", "opcua_authetication_sc"],
908+
allOf: ["opcua_secure_channel_sc", "opcua_authentication_sc"],
909909
},
910910
};
911911
ct.security = "basic";
@@ -918,8 +918,8 @@ class WoTClientTest {
918918
expect(pc.securitySchemes.length).equals(1);
919919
const comboScheme = pc.securitySchemes[0] as AllOfSecurityScheme;
920920

921-
expect(comboScheme.allOf[0].scheme).equals("opcua-channel-security");
922-
expect(comboScheme.allOf[1].scheme).equals("opcua-authentication");
921+
expect(comboScheme.allOf[0].scheme).equals("uav:channel-security");
922+
expect(comboScheme.allOf[1].scheme).equals("uav:authentication");
923923
}
924924

925925
@test "ensure no infinite loop with recursive combo security"() {

0 commit comments

Comments
 (0)