opertypes: oper classes + types — reusable capability classes and named roles (WHOIS title, auto usermodes/snomasks/vhost + level on oper-up, per-type command enforcement via on_pre_command); ships 5 built-in (helpop/globop/admin/servadmin/netadmin); oper blocks gain type=<id>; a typeless oper keeps full access
This commit is contained in:
parent
f3ce0e61ef
commit
01516d5fdc
6 changed files with 509 additions and 5 deletions
|
|
@ -40,6 +40,7 @@ pub struct OperBlock {
|
|||
pub password: String,
|
||||
pub level: u32,
|
||||
pub fingerprint: Option<String>,
|
||||
pub oper_type: Option<String>,
|
||||
}
|
||||
|
||||
/// A trusted WEBIRC gateway: after presenting `password` it may rewrite a client's
|
||||
|
|
@ -233,14 +234,18 @@ impl Config {
|
|||
password: p.to_string(),
|
||||
level: 0,
|
||||
fingerprint: None,
|
||||
oper_type: None,
|
||||
};
|
||||
// trailing tokens (any order): a number is the operlevel, a
|
||||
// `fp=`/`certfp=` token is the required TLS cert fingerprint.
|
||||
// `fp=`/`certfp=` token is the required TLS cert fingerprint,
|
||||
// a `type=` token names the oper type (see modules::opertypes).
|
||||
for tok in it {
|
||||
if let Some(fp) =
|
||||
tok.strip_prefix("fp=").or_else(|| tok.strip_prefix("certfp="))
|
||||
{
|
||||
b.fingerprint = Some(fp.to_ascii_lowercase());
|
||||
} else if let Some(t) = tok.strip_prefix("type=") {
|
||||
b.oper_type = Some(t.to_string());
|
||||
} else if let Ok(l) = tok.parse::<u32>() {
|
||||
b.level = l;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue