Component is now behind insecure-tcp feature flag
This commit is contained in:
parent
16a78d3bb5
commit
9f4af1625d
4 changed files with 11 additions and 19 deletions
|
@ -19,10 +19,12 @@ XXXX-YY-ZZ RELEASER <admin@example.com>
|
||||||
- `XmppCodec` was moved to proto module and is now published as `tokio_xmpp::proto::XmppCodec` (!428)
|
- `XmppCodec` was moved to proto module and is now published as `tokio_xmpp::proto::XmppCodec` (!428)
|
||||||
- `Component::new` and `Client::new only require jid/password argument (!428)
|
- `Component::new` and `Client::new only require jid/password argument (!428)
|
||||||
- `ServerConfig` and `Client::new_with_config` have been removed (!428)
|
- `ServerConfig` and `Client::new_with_config` have been removed (!428)
|
||||||
- `Component` and `Client` now have `new_plaintext`, `new_starttls` and `new_with_connector` methods with same signature (!428)
|
- ``Client` now has `new_plaintext`, `new_starttls` and `new_with_connector` method (!428)
|
||||||
`new_plaintext` and `new_starttls` take a DnsConfig struct for SRV/DNS resolution strategy, while `new_with_connector` takes
|
`new_plaintext` and `new_starttls` take a DnsConfig struct for SRV/DNS resolution strategy, while `new_with_connector` takes
|
||||||
anything that implements ServerConnector
|
anything that implements ServerConnector
|
||||||
|
- `Component` now has `new_plaintext` and `new_with_connector` constructors, just like `Client` but without StartTLS (!428)
|
||||||
- `tokio_xmpp::AsyncClient` has been renamed `tokio_xmpp::Client` (!428)
|
- `tokio_xmpp::AsyncClient` has been renamed `tokio_xmpp::Client` (!428)
|
||||||
|
- `Component` is now gated behind `insecure-tcp` feature flag
|
||||||
|
|
||||||
Version 4.0.0:
|
Version 4.0.0:
|
||||||
2024-07-26 Maxime “pep” Buquet <pep@bouah.net>
|
2024-07-26 Maxime “pep” Buquet <pep@bouah.net>
|
||||||
|
|
|
@ -16,8 +16,6 @@ use crate::Error;
|
||||||
|
|
||||||
#[cfg(any(feature = "starttls", feature = "insecure-tcp"))]
|
#[cfg(any(feature = "starttls", feature = "insecure-tcp"))]
|
||||||
use crate::connect::DnsConfig;
|
use crate::connect::DnsConfig;
|
||||||
#[cfg(feature = "starttls")]
|
|
||||||
use crate::connect::StartTlsServerConnector;
|
|
||||||
#[cfg(feature = "insecure-tcp")]
|
#[cfg(feature = "insecure-tcp")]
|
||||||
use crate::connect::TcpServerConnector;
|
use crate::connect::TcpServerConnector;
|
||||||
|
|
||||||
|
@ -52,20 +50,11 @@ impl Component<TcpServerConnector> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "starttls")]
|
|
||||||
impl Component<StartTlsServerConnector> {
|
|
||||||
/// Start a new XMPP component over StartTLS
|
|
||||||
pub async fn new_starttls(
|
|
||||||
jid: &str,
|
|
||||||
password: &str,
|
|
||||||
dns_config: DnsConfig,
|
|
||||||
) -> Result<Self, Error> {
|
|
||||||
Self::new_with_connector(jid, password, StartTlsServerConnector::from(dns_config)).await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<C: ServerConnector> Component<C> {
|
impl<C: ServerConnector> Component<C> {
|
||||||
/// Start a new XMPP component
|
/// Start a new XMPP component.
|
||||||
|
///
|
||||||
|
/// Unfortunately [`StartTlsConnector`] is not supported yet. The tracking issue is
|
||||||
|
/// [#143](https://gitlab.com/xmpp-rs/xmpp-rs/-/issues/143).
|
||||||
pub async fn new_with_connector(
|
pub async fn new_with_connector(
|
||||||
jid: &str,
|
jid: &str,
|
||||||
password: &str,
|
password: &str,
|
||||||
|
|
|
@ -40,13 +40,11 @@ use crate::{
|
||||||
connect::{DnsConfig, ServerConnector, ServerConnectorError},
|
connect::{DnsConfig, ServerConnector, ServerConnectorError},
|
||||||
error::{Error, ProtocolError},
|
error::{Error, ProtocolError},
|
||||||
proto::{Packet, XmppStream},
|
proto::{Packet, XmppStream},
|
||||||
Client, Component,
|
Client,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Client that connects over StartTls
|
/// Client that connects over StartTls
|
||||||
pub type StartTlsClient = Client<StartTlsServerConnector>;
|
pub type StartTlsClient = Client<StartTlsServerConnector>;
|
||||||
/// Component that connects over StartTls
|
|
||||||
pub type StartTlsComponent = Component<StartTlsServerConnector>;
|
|
||||||
|
|
||||||
/// Connect via TCP+StartTLS to an XMPP server
|
/// Connect via TCP+StartTLS to an XMPP server
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
|
@ -53,7 +53,10 @@ pub mod connect;
|
||||||
pub mod proto;
|
pub mod proto;
|
||||||
|
|
||||||
pub use client::async_client::Client;
|
pub use client::async_client::Client;
|
||||||
|
|
||||||
|
#[cfg(feature = "insecure-tcp")]
|
||||||
mod component;
|
mod component;
|
||||||
|
#[cfg(feature = "insecure-tcp")]
|
||||||
pub use crate::component::Component;
|
pub use crate::component::Component;
|
||||||
/// Detailed error types
|
/// Detailed error types
|
||||||
pub mod error;
|
pub mod error;
|
||||||
|
|
Loading…
Reference in a new issue