feat: add modern client lifecycle modes (SEP-2575) (#995)
* feat: add modern client lifecycle modes * refactor: drop modern naming and dead cleanup * fix: gate request metadata on inline lifecycle only
This commit is contained in:
parent
81745f1375
commit
2e2c79173c
1 changed files with 1525 additions and 306 deletions
|
|
@ -30,6 +30,29 @@ fn meta_setters_store_sep_2575_values() {
|
|||
assert_eq!(meta.get(META_KEY_LOG_LEVEL), Some(&json!("warning")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn with_client_context_sets_all_required_sep_2575_fields() {
|
||||
let meta = RequestMetaObject::with_client_context(
|
||||
ProtocolVersion::V_2026_07_28,
|
||||
Implementation::new("test-client", "1.0.0"),
|
||||
ClientCapabilities::default(),
|
||||
);
|
||||
|
||||
assert!(
|
||||
meta.missing_required_keys(&ProtocolVersion::V_2026_07_28)
|
||||
.is_empty()
|
||||
);
|
||||
assert_eq!(meta.protocol_version(), Some(ProtocolVersion::V_2026_07_28));
|
||||
assert_eq!(
|
||||
meta.client_info(),
|
||||
Some(Implementation::new("test-client", "1.0.0"))
|
||||
);
|
||||
assert_eq!(
|
||||
meta.client_capabilities(),
|
||||
Some(ClientCapabilities::default())
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn meta_accessors_decode_wire_values() {
|
||||
let meta: RequestMetaObject = serde_json::from_value(json!({
|
||||
|
|
|
|||
Loading…
Reference in a new issue