#[derive(Debug,Clone)]
pub struct InstanceConfig {
// Exceptional settings
- #[special(special_link, SKL::ServerName)] pub link: LinkName,
+ #[special(special_link, SKL::None)] pub link: LinkName,
pub secret: Secret,
#[special(special_ipif, SKL::PerClient)] pub ipif: String,
let sn = sn.parse().dcontext(&sn)?;
for key in vars.keys() {
- let skl = self.keys_allowed.get(key.as_str()).ok_or_else(
- || anyhow!("unknown configuration key {:?}", key)
- )?;
+ let skl = if key == "server" {
+ SKL::ServerName
+ } else {
+ *self.keys_allowed.get(key.as_str()).ok_or_else(
+ || anyhow!("unknown configuration key {:?}", key)
+ )?
+ };
if ! skl.contains(&sn) {
throw!(anyhow!("configuration key {:?} not applicable \
in this kind of section: {}", key, &sn))
}
#[throws(AE)]
- pub fn special_link(&self, _key: &'static str, _skl: SKL) -> LinkName {
+ pub fn special_link(&self, _key: &'static str, skl: SKL) -> LinkName {
+ assert_eq!(skl, SKL::None);
self.link.clone()
}
}