grpc: provision sets the verifier on an already-existing account
All checks were successful
CI / check (push) Successful in 3m50s
All checks were successful
CI / check (push) Successful in 3m50s
An Anope import creates accounts (channel ownership, vhosts, certs) but can't carry the one-way password hash, so they exist without a verifier. provision then refused them as AlreadyExists, so the website's backfill could never give migrated members a credential — every one was locked out of password login. Make provision update the verifier in place on an existing account (logged as AccountPasswordSet), and treat an empty scram512 as absent consistently in apply(). Keyed by name, so imported channel/vhost/ban data stays attached.
This commit is contained in:
parent
d1685f7e53
commit
34bc7d69f0
5 changed files with 54 additions and 7 deletions
|
|
@ -333,7 +333,9 @@ pub(crate) fn apply(accounts: &mut HashMap<String, Account>, channels: &mut Hash
|
|||
Event::AccountPasswordSet { account, scram256, scram512 } => {
|
||||
if let Some(a) = accounts.get_mut(&key(&account)) {
|
||||
a.scram256 = Some(scram256);
|
||||
a.scram512 = Some(scram512);
|
||||
// Empty = not provided (e.g. a verifier-only backfill sets SHA-256
|
||||
// alone); keep this in step with the live provision update.
|
||||
a.scram512 = (!scram512.is_empty()).then_some(scram512);
|
||||
}
|
||||
}
|
||||
Event::AccountDropped { account } => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue