Implement PLAIN auth for gst-meet

Cette révision appartient à :
Jasper Hugo 2022-03-09 19:36:29 +07:00 révisé par Jasper
Parent b89e1cde87
révision 1518fbe8e2
1 fichiers modifiés avec 16 ajouts et 1 suppressions

Voir le fichier

@ -47,6 +47,15 @@ struct Opt {
)]
focus_jid: Option<String>,
#[structopt(
long,
help = "If not specified, anonymous auth is used."
)]
xmpp_username: Option<String>,
#[structopt(long)]
xmpp_password: Option<String>,
#[structopt(
long,
default_value = "vp9",
@ -223,7 +232,13 @@ async fn main_inner() -> Result<()> {
let (connection, background) = Connection::new(
&opt.web_socket_url,
xmpp_domain,
Authentication::Anonymous,
match opt.xmpp_username {
Some(username) => Authentication::Plain {
username,
password: opt.xmpp_password.context("if xmpp-username is provided, xmpp-password must also be provided")?,
},
None => Authentication::Anonymous,
},
#[cfg(feature = "tls-insecure")]
opt.tls_insecure,
#[cfg(not(feature = "tls-insecure"))]