oper: TLS client-cert fingerprint login — oper block gains an optional fp=<sha256>; password=* means cert-only. Named OperBlock struct replaces the (name,pass,level) tuple. (Password login was never broken — verified live.)
This commit is contained in:
parent
853be58d18
commit
c4456cf002
6 changed files with 66 additions and 15 deletions
|
|
@ -25,9 +25,9 @@ pub fn handle(s: &mut Server, method: &str, _params: &str) -> Result<String, Rpc
|
|||
let opers: Vec<String> = s
|
||||
.opers
|
||||
.iter()
|
||||
.map(|(name, _pass, _lvl)| {
|
||||
.map(|o| {
|
||||
obj(&[
|
||||
("name", qstr(name)),
|
||||
("name", qstr(&o.name)),
|
||||
("type", qstr("")),
|
||||
("online", "0".into()),
|
||||
])
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ pub fn handle(s: &mut Server, action: &str, params: &str) -> Result<String, RpcE
|
|||
Some(name) if !name.is_empty() => {
|
||||
// apply the named oper block's level; reject an unknown name rather
|
||||
// than silently opering with defaults
|
||||
match s.opers.iter().find(|o| o.0 == name).map(|o| o.2) {
|
||||
match s.opers.iter().find(|o| o.name == name).map(|o| o.level) {
|
||||
Some(level) => {
|
||||
s.oper_up(uid);
|
||||
crate::modules::operlevels::set(s, uid, level);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue