Skip to content

Commit

Permalink
Merge pull request #51 from w6d-io/develop
Browse files Browse the repository at this point in the history
[ADD] opa feature
  • Loading branch information
nhaquet-w6d authored Dec 7, 2023
2 parents c451ddf + 144e602 commit e71b7c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
1 change: 1 addition & 0 deletions src/controller/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pub async fn update_controller(
let mut object_identity: Option<Arc<Identity>> = 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!"))?;
}
Expand Down

0 comments on commit e71b7c9

Please sign in to comment.