Commit graph

2164 commits

Author SHA1 Message Date
Jonas Schäfer
b931af3c25 parsers: provide stub FromXml/AsXml implementations on Iq 2024-08-12 12:32:12 +02:00
Jonas Schäfer
5c990a553c xso: enable rxml macros when enabling xso_proc
We build syn then anyway, so we can build rxml macros, too.
2024-08-12 12:32:12 +02:00
Jonas Schäfer
6b4886857e xso: offer is_xml_whitespace function 2024-08-12 12:32:12 +02:00
xmppftw
c63b554e9e Fix broken link 2024-08-11 20:06:39 +02:00
xmppftw
38baf53de5 Absolute document link 2024-08-11 17:42:58 +00:00
xmppftw
e153468117 Link is link, remove doc warning 2024-08-11 17:22:31 +00:00
Jonas Schäfer
cbc4648b3c parsers: port SASL over to derive macros
You may note that I removed the `exhaustive` flag on the
DefinedCondition enum. This is because other elements in the same
namespace may occur as siblings of that enum, hence using `exhaustive`
may cause incorrect parse errors.

(If parsing attempts to process the `<text/>` child as DefinedCondition
first, DefinedCondition will return a fatal parser error if it is set as
exhaustive because no condition matches `text`.)
2024-08-11 07:58:13 +02:00
Jonas Schäfer
1ecb95881c xso: add support for extracting tuples 2024-08-11 07:58:12 +02:00
Jonas Schäfer
ad2c79cbe7 xso: document some specific trait implementations 2024-08-11 07:45:05 +02:00
Jonas Schäfer
2ff81b3923 xso: add support for fallible parsing and serialisation 2024-08-11 07:45:05 +02:00
Jonas Schäfer
02a928a47c xso: add some tests 2024-08-11 07:45:05 +02:00
Jonas Schäfer
f1ab857c6e xso: move helper iterators and builders into separate module
This declutters the main `xso` namespace. In addition, if (when) we
introduce more complex generic implementations, we might want to have
tests for these, and those can then live there, too, without making the
main `lib.rs` file gigantic (or moving the tests too far away from the
tested code).
2024-08-11 07:45:05 +02:00
xmppftw
9f4af1625d Component is now behind insecure-tcp feature flag 2024-08-10 18:09:12 +02:00
xmppftw
16a78d3bb5 More documentation for tokio_xmpp 2024-08-10 16:57:51 +02:00
xmppftw
0b58561003 Rename AsyncClient to Client 2024-08-10 16:57:51 +02:00
xmppftw
311e7406f0 Make Client and Component more unified, and connectors too 2024-08-10 16:57:49 +02:00
xmppftw
fde4c2b640 Move XmppCodec and XmppStream to proto module 2024-08-10 16:49:26 +02:00
xmppftw
ec3c7694a7 Moved starttls connector to tokio_xmpp::connect::starttls module 2024-08-10 16:49:26 +02:00
xmppftw
9151461b10 TCP connector is now in connect module 2024-08-10 16:49:26 +02:00
xmppftw
a3fbd77050 Remove tokio_xmpp::SimpleClient 2024-08-10 16:49:24 +02:00
xmppftw
97698b4d1e Add dns feature for DNS stuff (not just in starttls) 2024-08-10 16:48:47 +02:00
Emmanuel Gil Peyrot
d706b318c3 xmpp-parsers: Remove the generate_element!() macro
The last users have now been converted to xso.
2024-08-09 16:08:26 +02:00
Emmanuel Gil Peyrot
4f81411410 xmpp-parsers: Convert Jingle to xso 2024-08-09 16:08:26 +02:00
Emmanuel Gil Peyrot
cb2c4133fe xmpp-parsers: Convert Forwarded to xso 2024-08-09 16:08:26 +02:00
Emmanuel Gil Peyrot
6b167ed677 xmpp-parsers: Convert disco#info identity to xso 2024-08-09 16:08:26 +02:00
Emmanuel Gil Peyrot
2690e62060 xmpp-parsers: Convert roster item to xso 2024-08-09 16:08:26 +02:00
Emmanuel Gil Peyrot
d4f6812386 xmpp-parsers: Convert cert_management to xso
This introduces a breaking change by moving from a bool to an
Option<NoCertManagement>, which will be reverted eventually once we add
support for #[xml(flag)] types of children.
2024-08-09 16:08:26 +02:00
Jonas Schäfer
230b72b052 xso: add ToC to FromXml docs 2024-08-08 15:25:40 +00:00
Jonas Schäfer
fb80bb7532 xso: add support for dynamic enums 2024-08-08 15:25:40 +00:00
Jonas Schäfer
b36d1d0d4c xso-proc: refactor enum handling
This will allow other kinds of enumerations in the future more
easily.
2024-08-08 15:25:40 +00:00
Emmanuel Gil Peyrot
8e16ae1cbb xmpp-parsers: Integrate sasl2 and sasl_cb into stream:features 2024-08-08 13:52:01 +00:00
Emmanuel Gil Peyrot
7238ebc35e xmpp-parsers: Integrate bind2 and sm into sasl2 2024-08-08 13:52:01 +00:00
Emmanuel Gil Peyrot
27e4499153 xmpp-parsers: Simplify SASL mechanisms type
These can be a simple String for now.
2024-08-08 13:52:01 +00:00
xmppftw
23e943825f xmpp::Agent::wait_for_events cannot error 2024-08-08 15:43:52 +02:00
xmppftw
2fc8e1c1dd AsyncClient::new reconnects by default, fixes disconnect logic 2024-08-08 15:33:17 +02:00
Emmanuel Gil Peyrot
d8e08df464 xmpp-parsers: Implement XEP-0478: Stream Limits Advertisement
This allows servers to communicate their maximum stanza limit, as well
as idle time limit.
2024-08-07 20:59:30 +02:00
Emmanuel Gil Peyrot
9960cfd965 jid: Make Debug more readable on Jid
Jid("foo@bar/baz") instead of Jid { normalized: "foo@bar/baz", at:
Some(3), slash: Some(7) }, which I find much more readable.

Same for BareJid and FullJid.
2024-08-06 16:53:58 +02:00
Emmanuel Gil Peyrot
3f61050944 xmpp-parsers: Implement XEP-0388: Extensible SASL Profile 2024-08-06 16:36:11 +02:00
Emmanuel Gil Peyrot
de2ba97f79 xmpp-parsers: Implement XEP-0440: SASL Channel-Binding Type Capability 2024-08-06 16:36:10 +02:00
Emmanuel Gil Peyrot
f16fb6a6ef xmpp-parsers: Convert the remaining bind2 elements to xso 2024-08-06 16:36:10 +02:00
Emmanuel Gil Peyrot
f0f4299b02 xmpp-parsers: Parse the bind feature in its module, with required
This is different from the bind query or the bind response, despite all
three having the same element namespace and name…  Annoying!
2024-08-06 16:14:42 +02:00
Emmanuel Gil Peyrot
35932268af tokio-xmpp: Error out when the stream:features couldn’t be parsed
This is nicer than sleeping forever with no debug info whatsoever.
2024-08-06 16:14:42 +02:00
xmppftw
ba6a7c4744 Use tokio::sync::RwLock instead of std 2024-08-06 16:04:04 +02:00
xmppftw
8aca413fc3 Collect unknown stream features in StreamFeatures.others 2024-08-05 21:38:29 +02:00
Jonas Schäfer
fda4a9ff29 xso: implement transparent structs 2024-08-05 15:13:39 +00:00
Emmanuel Gil Peyrot
fea915daf1 xmpp-parsers: Make MAM metadata children pub
This had been forgotten when I converted it to xso.
2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
e1da3410ba xmpp-parsers: Convert MAM prefs to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
0d3e73ec74 xmpp-parsers: Convert bind2 to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
f37b7b4dfd xmpp-parsers: Convert bind to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
2df243966f xmpp-parsers: Convert blocking to xso 2024-08-05 15:02:25 +00:00