diff --git a/Cargo.toml b/Cargo.toml index fa68357..0663a9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,3 +41,7 @@ tonic-build = "0.10.*" mime = "0.3.17" mockito = "1.0.0" uuid = { version = "1.3.1", features = ["v4"] } + +[features] +default = [] +opa = [] diff --git a/src/controller/update.rs b/src/controller/update.rs index 27f0fac..6c579a6 100644 --- a/src/controller/update.rs +++ b/src/controller/update.rs @@ -96,6 +96,7 @@ pub async fn update_controller( let mut object_identity: Option> = None; let uri = "api/iam/".to_owned() + endpoint; for data in payload.iter() { + #[cfg(feature = "opa")] if !validate_roles(&config, &identity, &data.ressource_id, request_id, &uri).await? { Err(anyhow!("Invalid role!"))?; }