Skip to content

Commit 8d82041

Browse files
committed
More PR Feedback
1 parent b371dc6 commit 8d82041

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

crates/libtiny_client/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ pub struct ServerInfo {
6464
}
6565

6666
/// SASL authentication mechanisms
67-
/// https://ircv3.net/docs/sasl-mechs
68-
/// https://www.alphachat.net/sasl.xhtml
67+
/// - <https://ircv3.net/docs/sasl-mechs>
68+
/// - <https://www.alphachat.net/sasl.xhtml>
6969
#[derive(Debug, Clone)]
7070
pub enum SASLAuth {
7171
Plain { username: String, password: String },

crates/libtiny_client/src/state.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ impl StateInner {
648648
}
649649
}
650650

651+
// https://ircv3.net/specs/extensions/sasl-3.1.html
651652
AUTHENTICATE { ref param } => {
652653
if param.as_str() == "+" {
653654
// Empty AUTHENTICATE response; server accepted the specified SASL mechanism
@@ -657,6 +658,7 @@ impl StateInner {
657658
let msg = format!("{}\x00{}\x00{}", username, username, password);
658659
base64::encode(&msg)
659660
}
661+
// Reply with an empty response (Empty responses are sent as "AUTHENTICATE +")
660662
SASLAuth::External { .. } => "+".to_string(),
661663
};
662664
snd_irc_msg.try_send(wire::authenticate(&msg)).unwrap();

crates/tiny/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ servers:
3232
# username: 'tiny_user'
3333
# password: 'hunter2'
3434
# OR
35-
# pem: "/home/.config/tiny/oftc.pem"
35+
# pem: "/home/user/.config/tiny/oftc.pem"
3636

3737
# Identify nick by sending a message to NickServ:
3838
# (useful when `pass` or `sasl` fields above are not used)

crates/tiny/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ fn sasl_from_config(tls: bool, sasl_config: &config::SASLAuth) -> Result<SASLAut
204204
config::SASLAuth::External { pem } => {
205205
// TLS must be on for EXTERNAL
206206
if !tls {
207-
Err("TLS is not enabled for this server, but SASL EXTERNAL authentication requires SASL. Please enable SASL for this server in the config file.".to_string())
207+
Err("TLS is not enabled for this server, but SASL EXTERNAL authentication requires SASL. \
208+
Please enable SASL for this server in the config file.".to_string())
208209
} else {
209210
// load in a cert and private key for TLS client auth
210211
match File::open(pem) {

0 commit comments

Comments
 (0)