fn authenticate()

in identity/aziot-identityd/src/lib.rs [852:866]


    fn authenticate(&self, credentials: config::Uid) -> Result<auth::AuthId, Self::Error> {
        //DEVNOTE: The authentication logic is ordered to lookup the principals first
        //         so that a host process can be configured to run as root.
        if let Some(p) = self.allowed_users.get(&credentials) {
            if p.id_type.is_some() {
                Ok(auth::AuthId::HostProcess(p.clone()))
            } else {
                Ok(auth::AuthId::Daemon)
            }
        } else if credentials == config::Uid(0) {
            Ok(auth::AuthId::LocalRoot)
        } else {
            Ok(auth::AuthId::Unknown)
        }
    }