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
|
|
@ -613,13 +613,15 @@ mod tests {
|
|||
.into_inner();
|
||||
assert_eq!(prov.status, PbStatus::Ok as i32);
|
||||
|
||||
// Backfill is safe to re-run: an existing account isn't clobbered.
|
||||
// Re-provisioning an existing account SETS its verifier (the migration
|
||||
// case: an imported account with no credential gets one) — and is safe to
|
||||
// re-run with the same verifier.
|
||||
let dup = svc
|
||||
.provision(authed(ProvisionRequest { name: "heidi".into(), scram256: creds.scram256.clone(), scram512: String::new(), email: String::new() }, "t"))
|
||||
.await
|
||||
.unwrap()
|
||||
.into_inner();
|
||||
assert_eq!(dup.status, PbStatus::AlreadyExists as i32);
|
||||
assert_eq!(dup.status, PbStatus::Ok as i32);
|
||||
|
||||
// A missing scram256 is rejected, and a bad bearer never gets in.
|
||||
let invalid = svc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue