(&self, token: &str)
| 219 | } |
| 220 | |
| 221 | fn ensure_admin(&self, token: &str) -> Result<()> { |
| 222 | let token_hash = sha2::Sha256::new_with_prefix(token).finalize(); |
| 223 | if token_hash.as_slice() != self.state.config.admin_token_hash.as_slice() { |
| 224 | bail!("Invalid token"); |
| 225 | } |
| 226 | Ok(()) |
| 227 | } |
| 228 | |
| 229 | async fn verify_os_image_hash( |
| 230 | &self, |