Skip to content

Commit

Permalink
kbs: make token verifier initialization async
Browse files Browse the repository at this point in the history
This is useful if any token verifier needs initialization data
pulled remotely.

Signed-off-by: Mikko Ylinen <[email protected]>
  • Loading branch information
mythi authored and Xynnn007 committed Aug 30, 2024
1 parent 721c167 commit bba0b9c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kbs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down
2 changes: 1 addition & 1 deletion kbs/src/token/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct AttestationTokenVerifierConfig {
pub trusted_certs_paths: Vec<String>,
}

pub fn create_token_verifier(
pub async fn create_token_verifier(
config: AttestationTokenVerifierConfig,
) -> Result<Arc<RwLock<dyn AttestationTokenVerifier + Send + Sync>>> {
match config.attestation_token_type {
Expand Down

0 comments on commit bba0b9c

Please sign in to comment.