Commit graph

2153 commits

Author SHA1 Message Date
34b50d32c9 tokio-xmpp: Update tls-rust feature for jid changes
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-10-24 16:51:08 +00:00
5338d2f99a tokio-xmpp: Replace deprecated rustls method (add_server_trust_anchors)
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-10-24 16:51:08 +00:00
25c319b2db tokio-xmpp: Update for webpki_roots release in tls-rust feature
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-10-24 16:51:08 +00:00
a16f670ee6 tokio-xmpp: Error out when both tls-native and tls-rust features are enabled
If the user enables the tls-rust feature and forgets to disable
default-features (which includes tls-native), tell them and bail out.

The code was made to work anyway when both are enabled, and here it
defaults to tls-native. It does seem better to have one explicitely
choose one though hence the compile_error! message.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-10-24 16:51:08 +00:00
Guus der Kinderen
fc16b7919b fix: typo in AsyncConfig comment 2023-10-10 19:15:55 +02:00
Emmanuel Gil Peyrot
4460a59bc8 xmpp-parsers: XEP-0257: Correctly serialise no-cert-management
This element was previously always put in the generated element.
2023-09-05 17:08:30 +02:00
Kristoffer Andersson
5a1ef42369 fix: make eq num nodes is unequal
fixes #99
2023-09-05 14:19:35 +02:00
edf4347a5a
xmpp: version 0.5.0
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-21 11:00:27 +02:00
e2ef506418
xmpp: Re-export jid structs, minidom::Element, and parsers module
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-21 10:57:33 +02:00
21c9fa2df4 xmpp: Update to tokio-xmpp 3.4
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:34:04 +02:00
68a8c043a2 tokio-xmpp: bump to 3.4.0
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:34:04 +02:00
6c8855a6d5 tokio-xmpp: Update Changelog
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:34:04 +02:00
96f6de787f tokio-xmpp: Re-export jid structs, minidom::Element, and parsers module
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:34:04 +02:00
a13f05037c tokio-xmpp: update dependencies (jid, webpki-roots)
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:34:04 +02:00
7f1b98db8f parsers: Bump to 0.20
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:34:04 +02:00
3c10a09091 parsers: Update jid dependency
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:34:04 +02:00
d44457eb3f parsers: Update changelog
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:34:04 +02:00
d0a8ea3178 jid: bump to 0.10
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:34:04 +02:00
63b2e6d176 jid: Update changelog
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:34:04 +02:00
c6bd89776b xmpp: Use correct feature name for hello_bot example
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:34:04 +02:00
5c312476c2
sasl: 0.5.1 release
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:29:51 +02:00
75bcd51026
sasl: Update LICENSE file to reflect changes for 0.5.0
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:28:59 +02:00
0100909a28 sasl: Update pbkdf2 dep to 0.12
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:24:04 +02:00
6efc67a198 sasl: Update base64 to 0.21
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-20 21:24:04 +02:00
2e3004f89e CI: Add a test with no-default-features and ensure it passes
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-17 23:45:57 +02:00
34467dd4a6 sasl: update crate metadata
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-17 23:45:57 +02:00
ff19e25ed8 Add sasl crate to the workspace
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-17 23:32:27 +02:00
b81c7e23df Merge remote-tracking branch 'foo/master' into sasl-foo 2023-08-17 23:31:04 +02:00
8de14336f5
jid: Add test for Jid::Full ser/de
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-14 21:59:27 +02:00
e9066c353d
jid: Replace serde_json with serde_test in tests
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-08-14 21:59:09 +02:00
mb
2f808f161f chore: Rename User struct to JidContainer 2023-08-14 12:17:51 +00:00
mb
fc23f987cd style: Run cargo fmt 2023-08-14 12:17:51 +00:00
xmppftw
b09c540080 Add tests for serde features of jid crate 2023-08-14 12:17:51 +00:00
mb
997303900b fix(jid): Fix JID serialization with serde; address oversight in commit cdf4486e 2023-08-14 12:17:51 +00:00
Emmanuel Gil Peyrot
2ad0dd66dd Replace format!("{}", jid) with jid.to_string()
This is more readable I think, and expresses better our intent.
2023-08-10 19:35:53 +00:00
Emmanuel Gil Peyrot
6fc3a46bd2 jid: Fix tests 2023-08-10 19:31:10 +00:00
Emmanuel Gil Peyrot
b28c843eff xmpp: Use the new FullJid::resource_str() method 2023-08-10 19:31:10 +00:00
Emmanuel Gil Peyrot
e6595762f6 Use the parts/str split in FullJid and BareJid too
Since 199b3ae7ae we allow typed parts to
be reused without stringprep being reapplied.  This extends it from just
Jid to FullJid and BareJid too.
2023-08-10 19:31:10 +00:00
Emmanuel Gil Peyrot
6ccee76621 Add a test for an invalid resource
This one uses unassigned codepoints in Unicode 3.2.
2023-08-05 16:53:22 +02:00
Raman Hafiyatulin
fd26d04635 macro impl_validator_using_provider!: use $crate::server::ValidatorError instead of ValidatorError 2023-07-30 17:17:26 +03:00
Emmanuel Gil Peyrot
11087d64f7 Add *Jid::into_inner() returning the inner String
Thanks pep. for the suggestion!
2023-07-30 15:23:02 +02:00
Emmanuel Gil Peyrot
6f304d197d jid: Optimise for no-transform JIDs
stringprep can make transformations to a JID, the most well-known one is
making the nodepart and domainpart lowercase but it does much more than
that.

It is extremely common to have to validate already-normalised JIDs
though, and since https://github.com/sfackler/rust-stringprep/pull/4
this is exactly what the stringprep crate does, by returning
Cow::Borrowed() for common ASCII-only cases.

This commit further reduces time spent by an additional -15%..-58% when
already using this stringprep improvement, in addition to the
89.5%..98.5% change brought by this improvement (and +1.3% total when
the JID isn’t normalised yet).

For instance, my own full JID parses in 1.83 µs before these changes,
132 ns with just the stringprep optimisation, and 46 ns with also this
commit, on an i7-8700K.
2023-07-16 19:50:12 +02:00
b3da75d0a7
parsers/doap: Add supported platforms
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-06-27 01:56:01 +02:00
xmppftw
76b68e932a Update CHANGELOG for jid crate 2023-06-21 18:41:32 +02:00
xmppftw
4266368a98 JIDs now have typed and stringy methods for node/domain/resource access
Jid now has typed with_resource and stringy with_resource_str
Jid now has is_full, is_bare
2023-06-21 18:30:25 +02:00
xmppftw
199b3ae7ae Introduce typed Parts for the JID to enable unfallible JID construction 2023-06-21 14:15:03 +02:00
Emmanuel Gil Peyrot
85bdcdb131 tokio-xmpp: Bump idna dependency 2023-06-21 12:05:33 +00:00
Emmanuel Gil Peyrot
6ccc5ccace tokio-xmpp: Poll packets in a loop
This needs to be a loop in order to ignore packets we don’t care about,
or those we want to handle elsewhere.  Returning something isn’t correct
in those two cases because it would signal to tokio that the XMPPStream
is also done, while there could be additional packets waiting for us.

The proper solution is thus a loop which we exit once we have something
to return.

Fixes a deadlock when we ignore some packets.
2023-06-21 11:55:42 +00:00
ac22765f21 tokio-xmpp: Remove newline after stream:stream
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-06-21 12:21:52 +02:00
e9cbeb1863 tokio-xmpp: debug print stream:stream too
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-06-21 12:21:52 +02:00