cat_gateway/settings/admin.rs
1//! Helpers related to the Admin Role.
2
3use ed25519_dalek::VerifyingKey;
4
5use crate::settings::ENV_VARS;
6
7/// Returns the Admin's role0 public key if the given Catalyst ID matches with the
8/// assigned Admin Catalyst ID.
9pub(crate) fn get_admin_key(cat_id: &catalyst_signed_doc::CatalystId) -> Option<VerifyingKey> {
10 let admin_key = ENV_VARS.signed_doc.admin_key();
11 if let Some(admin_key) = admin_key
12 && cat_id == admin_key
13 {
14 return Some(admin_key.role0_pk());
15 }
16
17 None
18}