Skip to content

Commit

Permalink
CI: fix e2e ci error
Browse files Browse the repository at this point in the history
  • Loading branch information
jialez0 committed Mar 19, 2024
1 parent b382e40 commit ccdb6b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kbs/src/api/src/policy_engine/opa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl PolicyEngineInterface for Opa {
}

async fn set_policy(&mut self, policy: String) -> Result<()> {
let policy_bytes = base64::engine::general_purpose::URL_SAFE_NO_PAD
let policy_bytes = base64::engine::general_purpose::STANDARD
.decode(policy)
.map_err(|e| anyhow!("Base64 decode OPA policy string failed: {:?}", e))?;

Expand All @@ -109,7 +109,7 @@ impl PolicyEngineInterface for Opa {
#[cfg(test)]
mod tests {
use super::*;
use base64::engine::general_purpose::URL_SAFE_NO_PAD;
use base64::engine::general_purpose::STANDARD;
use serde_json::json;

fn dummy_input(product_id: &str, svn: u64) -> String {
Expand Down Expand Up @@ -148,7 +148,7 @@ mod tests {
let policy_bytes = b"package policy
default allow = true";

let policy = URL_SAFE_NO_PAD.encode(policy_bytes);
let policy = STANDARD.encode(policy_bytes);

assert!(opa.set_policy(policy).await.is_ok());
}
Expand Down

0 comments on commit ccdb6b5

Please sign in to comment.