From bba0b9cc5d0920b1d5546645f67bb476349a3467 Mon Sep 17 00:00:00 2001 From: Mikko Ylinen Date: Thu, 8 Aug 2024 15:06:19 +0300 Subject: [PATCH] kbs: make token verifier initialization async This is useful if any token verifier needs initialization data pulled remotely. Signed-off-by: Mikko Ylinen --- kbs/src/lib.rs | 2 +- kbs/src/token/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kbs/src/lib.rs b/kbs/src/lib.rs index 5d5177598..b46abf82f 100644 --- a/kbs/src/lib.rs +++ b/kbs/src/lib.rs @@ -240,7 +240,7 @@ impl ApiServer { #[cfg(feature = "resource")] let token_verifier = - crate::token::create_token_verifier(self.attestation_token_config.clone())?; + crate::token::create_token_verifier(self.attestation_token_config.clone()).await?; #[cfg(feature = "policy")] let policy_engine = PolicyEngine::new(&self.policy_engine_config).await?; diff --git a/kbs/src/token/mod.rs b/kbs/src/token/mod.rs index b0160ded3..19afed5b9 100644 --- a/kbs/src/token/mod.rs +++ b/kbs/src/token/mod.rs @@ -34,7 +34,7 @@ pub struct AttestationTokenVerifierConfig { pub trusted_certs_paths: Vec, } -pub fn create_token_verifier( +pub async fn create_token_verifier( config: AttestationTokenVerifierConfig, ) -> Result>> { match config.attestation_token_type {