Skip to content

Commit 30eef2d

Browse files
authored
Fix inserting empty applied path policies (#196)
* do not insert applied path policies and allowed actions * bump up nebula version into 0.0.5
1 parent 9a1a944 commit 30eef2d

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

Cargo.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resolver = "2"
33
members = ["crates/*"]
44

55
[workspace.package]
6-
version = "0.0.4"
6+
version = "0.0.5"
77
edition = "2021"
88
authors = ["John Choi <john@cremit.io>", "Boris Im <boris@cremit.io>"]
99
repository = "https://github.com/cremithq/nebula"

crates/nebula-backbone/src/domain/secret/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,14 @@ impl Persistable for Path {
562562
}
563563
}
564564

565-
applied_path_policy::Entity::insert_many(applied_path_policy_models).exec(transaction).await?;
566-
applied_path_policy_allowed_action::Entity::insert_many(allowed_action_models).exec(transaction).await?;
565+
if !applied_path_policy_models.is_empty() {
566+
applied_path_policy::Entity::insert_many(applied_path_policy_models).exec(transaction).await?;
567+
}
568+
if !allowed_action_models.is_empty() {
569+
applied_path_policy_allowed_action::Entity::insert_many(allowed_action_models)
570+
.exec(transaction)
571+
.await?;
572+
}
567573
}
568574

569575
Ok(())

0 commit comments

Comments
 (0)