From 89de7545e0f3ee6cbb2b343c60a6eaafbe3a93e6 Mon Sep 17 00:00:00 2001 From: Rudi Floren Date: Fri, 29 May 2026 16:45:51 +0200 Subject: [PATCH] fix: rename of NoAccess NoAccess was renamed to `noAccess` but should be `none`. --- src/hello.rs | 27 +++++++++- .../resources/response/greeting_dcp_none.xml | 54 +++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 tests/resources/response/greeting_dcp_none.xml diff --git a/src/hello.rs b/src/hello.rs index 4d98241..59c364b 100644 --- a/src/hello.rs +++ b/src/hello.rs @@ -75,7 +75,7 @@ pub struct All; /// Type corresponding to `` in the EPP greeting XML #[derive(Debug, Eq, FromXml, PartialEq)] -#[xml(rename = "noAccess", ns(EPP_XMLNS))] +#[xml(rename = "none", ns(EPP_XMLNS))] pub struct NoAccess; /// Type corresponding to `` in the EPP greeting XML @@ -348,4 +348,29 @@ mod tests { ExpiryType::Relative(Relative("P1M".into())) ); } + + #[test] + fn greeting_no_access() { + let xml = get_xml("response/greeting_dcp_none.xml").unwrap(); + let object = xml::deserialize::(xml.as_str()).unwrap(); + + assert_eq!(object.service_id, "ISPAPI EPP Server"); + assert_eq!( + object.service_date, + Utc.with_ymd_and_hms(2021, 7, 25, 14, 51, 17).unwrap() + ); + assert_eq!(object.svc_menu.options.version, "1.0"); + assert_eq!(object.svc_menu.options.lang, "en"); + assert_eq!(object.svc_menu.services.obj_uris.len(), 4); + assert_eq!(object.svc_menu.services.svc_ext.unwrap().ext_uris.len(), 5); + assert_eq!(object.dcp.statement.len(), 2); + assert!(matches!( + object.dcp.access.inner, + super::AccessType::NoAccess(_) + )); + assert_eq!( + object.dcp.expiry.unwrap().inner, + ExpiryType::Relative(Relative("P1M".into())) + ); + } } diff --git a/tests/resources/response/greeting_dcp_none.xml b/tests/resources/response/greeting_dcp_none.xml new file mode 100644 index 0000000..0519592 --- /dev/null +++ b/tests/resources/response/greeting_dcp_none.xml @@ -0,0 +1,54 @@ + + + + ISPAPI EPP Server + 2021-07-25T14:51:17.0Z + + 1.0 + en + urn:ietf:params:xml:ns:host-1.0 + urn:ietf:params:xml:ns:domain-1.0 + urn:ietf:params:xml:ns:contact-1.0 + http://schema.ispapi.net/epp/xml/keyvalue-1.0 + + urn:ietf:params:xml:ns:secDNS-1.1 + urn:ietf:params:xml:ns:secDNS-1.0 + urn:ietf:params:xml:ns:rgp-1.0 + urn:ietf:params:xml:ns:fee-0.7 + http://schema.ispapi.net/epp/xml/keyvalue-1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + P1M + + + + \ No newline at end of file