Add persisted account store with NickServ REGISTER/IDENTIFY
Accounts are an append-only JSONL event log (state is the fold of the log) with argon2id-hashed passwords. NickServ gains REGISTER <password> [email] and IDENTIFY <password>; the engine tracks UID->nick from the burst so a command resolves to the sender's current nick. Classic and ircd-agnostic — the cap-based account-registration forward is the next step.
This commit is contained in:
parent
7929f5f9f4
commit
9285105afd
11 changed files with 348 additions and 41 deletions
|
|
@ -69,6 +69,17 @@ impl Protocol for InspIrcd {
|
|||
text: trailing(rest),
|
||||
}]
|
||||
}
|
||||
// UID <uuid> <nickts> <nick> … — track who's online so services can
|
||||
// resolve a sender's current nick.
|
||||
"UID" => {
|
||||
let a: Vec<&str> = tokens.collect();
|
||||
match (a.first(), a.get(2)) {
|
||||
(Some(uid), Some(nick)) => {
|
||||
vec![NetEvent::UserConnect { uid: uid.to_string(), nick: nick.to_string() }]
|
||||
}
|
||||
_ => vec![],
|
||||
}
|
||||
}
|
||||
"QUIT" => vec![NetEvent::Quit { uid: source.unwrap_or_default() }],
|
||||
_ => vec![NetEvent::Unknown { line: line.to_string() }],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ pub enum NetEvent {
|
|||
EndBurst,
|
||||
Ping { token: String, from: Option<String> },
|
||||
Privmsg { from: String, to: String, text: String },
|
||||
UserConnect { uid: String, nick: String },
|
||||
Quit { uid: String },
|
||||
Unknown { line: String },
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue