Skip to content

Commit 799e03c

Browse files
authored
[NR-358334] support signatures arrays (#998)
1 parent e5cdc64 commit 799e03c

File tree

2 files changed

+236
-45
lines changed

2 files changed

+236
-45
lines changed

agent-control/src/opamp/callbacks.rs

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,15 @@ pub(crate) mod tests {
492492
custom_message: Some(CustomMessage {
493493
capability: SIGNATURE_CUSTOM_CAPABILITY.to_string(),
494494
r#type: SIGNATURE_CUSTOM_MESSAGE_TYPE.to_string(),
495-
data: serde_json::to_vec(&Signatures::new_unique(
496-
"fake config",
497-
ED25519,
498-
"fake keyid",
499-
))
500-
.unwrap(),
495+
data: r#"{
496+
"unique": [{
497+
"signature": "fake config",
498+
"signingAlgorithm": "ED25519",
499+
"keyID": "fake keyid"
500+
}]
501+
}"#
502+
.as_bytes()
503+
.to_vec(),
501504
}),
502505
..Default::default()
503506
}),
@@ -519,12 +522,15 @@ pub(crate) mod tests {
519522
custom_message: Some(CustomMessage {
520523
capability: SIGNATURE_CUSTOM_CAPABILITY.to_string(),
521524
r#type: "unsupported_type".to_string(),
522-
data: serde_json::to_vec(&Signatures::new_unique(
523-
"fake config",
524-
ED25519,
525-
"fake keyid",
526-
))
527-
.unwrap(),
525+
data: r#"{
526+
"unique": [{
527+
"signature": "fake config",
528+
"signingAlgorithm": "ED25519",
529+
"keyID": "fake keyid"
530+
}]
531+
}"#
532+
.as_bytes()
533+
.to_vec(),
528534
}),
529535
..Default::default()
530536
}),
@@ -542,12 +548,15 @@ pub(crate) mod tests {
542548
custom_message: Some(CustomMessage {
543549
capability: "unsupported.capability".to_string(),
544550
r#type: SIGNATURE_CUSTOM_MESSAGE_TYPE.to_string(),
545-
data: serde_json::to_vec(&Signatures::new_unique(
546-
"fake config",
547-
ED25519,
548-
"fake keyid",
549-
))
550-
.unwrap(),
551+
data: r#"{
552+
"unique": [{
553+
"signature": "fake config",
554+
"signingAlgorithm": "ED25519",
555+
"keyID": "fake keyid"
556+
}]
557+
}"#
558+
.as_bytes()
559+
.to_vec(),
551560
}),
552561
..Default::default()
553562
}),

0 commit comments

Comments
 (0)