Skip to content

Commit 8daee36

Browse files
khietajv-garciajuanvgarcia
authored
Prep for v2.5.0 release (#1189)
Signed-off-by: Juan Vicente Garcia Orozco <juano@amazon.com> Co-authored-by: Juan V. García <111006213+jv-garcia@users.noreply.github.com> Co-authored-by: Juan Vicente Garcia Orozco <juano@amazon.com>
1 parent c16d4e3 commit 8daee36

File tree

6 files changed

+25
-13
lines changed

6 files changed

+25
-13
lines changed

cedar-policy-cli/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "cedar-policy-cli"
33
edition = "2021"
44

5-
version = "2.4.7"
5+
version = "2.5.0"
66
license = "Apache-2.0"
77
categories = ["compilers", "config"]
88
description = "CLI interface for the Cedar Policy language."
@@ -11,8 +11,8 @@ homepage = "https://cedarpolicy.com"
1111
repository = "https://github.com/cedar-policy/cedar"
1212

1313
[dependencies]
14-
cedar-policy = { version = "=2.4.7", path = "../cedar-policy" }
15-
cedar-policy-formatter = { version = "=2.4.7", path = "../cedar-policy-formatter" }
14+
cedar-policy = { version = "=2.5.0", path = "../cedar-policy" }
15+
cedar-policy-formatter = { version = "=2.5.0", path = "../cedar-policy-formatter" }
1616
clap = { version = "4", features = ["derive", "env"] }
1717
serde = { version = "1.0", features = ["derive"] }
1818
serde_json = "1.0"

cedar-policy-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "cedar-policy-core"
33
edition = "2021"
44
build = "build.rs"
55

6-
version = "2.4.7"
6+
version = "2.5.0"
77
license = "Apache-2.0"
88
categories = ["compilers", "config"]
99
description = "Core implemenation of the Cedar Policy language."

cedar-policy-formatter/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cedar-policy-formatter"
3-
version = "2.4.7"
3+
version = "2.5.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
categories = ["compilers", "config"]
@@ -10,7 +10,7 @@ homepage = "https://cedarpolicy.com"
1010
repository = "https://github.com/cedar-policy/cedar"
1111

1212
[dependencies]
13-
cedar-policy-core = { version = "=2.4.7", path = "../cedar-policy-core" }
13+
cedar-policy-core = { version = "=2.5.0", path = "../cedar-policy-core" }
1414
pretty = "0.12.1"
1515
logos = "0.13.0"
1616
itertools = "0.10"

cedar-policy-validator/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "cedar-policy-validator"
33
edition = "2021"
44

5-
version = "2.4.7"
5+
version = "2.5.0"
66
license = "Apache-2.0"
77
categories = ["compilers", "config"]
88
description = "Validator for the Cedar Policy language."
@@ -11,7 +11,7 @@ homepage = "https://cedarpolicy.com"
1111
repository = "https://github.com/cedar-policy/cedar"
1212

1313
[dependencies]
14-
cedar-policy-core = { version = "=2.4.7", path = "../cedar-policy-core" }
14+
cedar-policy-core = { version = "=2.5.0", path = "../cedar-policy-core" }
1515
serde = { version = "=1.0.193", features = ["derive"] }
1616
serde_json = { version = "=1.0.108", features = ["preserve_order"] }
1717
serde_with = "=3.4.0"

cedar-policy/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "cedar-policy"
33
edition = "2021"
44

5-
version = "2.4.7"
5+
version = "2.5.0"
66
license = "Apache-2.0"
77
categories = ["compilers", "config"]
88
description = "Cedar is a language for defining permissions as policies, which describe who should have access to what."
@@ -11,8 +11,8 @@ homepage = "https://cedarpolicy.com"
1111
repository = "https://github.com/cedar-policy/cedar"
1212

1313
[dependencies]
14-
cedar-policy-core = { version = "=2.4.7", path = "../cedar-policy-core" }
15-
cedar-policy-validator = { version = "=2.4.7", path = "../cedar-policy-validator" }
14+
cedar-policy-core = { version = "=2.5.0", path = "../cedar-policy-core" }
15+
cedar-policy-validator = { version = "=2.5.0", path = "../cedar-policy-validator" }
1616
ref-cast = "1.0"
1717
serde = { version = "1.0", features = ["derive", "rc"] }
1818
serde_json = "1.0"

cedar-policy/src/api.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,18 @@ impl PolicySet {
16391639
self.ast.is_empty()
16401640
}
16411641

1642+
/// Returns the number of `Policy`s in the `PolicySet`.
1643+
///
1644+
/// This will include both static and template-linked policies.
1645+
pub fn num_of_policies(&self) -> usize {
1646+
self.policies.len()
1647+
}
1648+
1649+
/// Returns the number of `Template`s in the `PolicySet`.
1650+
pub fn num_of_templates(&self) -> usize {
1651+
self.templates.len()
1652+
}
1653+
16421654
/// Attempt to link a template and add the new template-linked policy to the policy set.
16431655
/// If link fails, the `PolicySet` is not modified.
16441656
/// Failure can happen for three reasons
@@ -3605,8 +3617,8 @@ mod policy_set_tests {
36053617
)
36063618
.expect("Link failure");
36073619

3608-
assert_eq!(pset.templates().count(), 1);
3609-
assert_eq!(pset.policies().count(), 2);
3620+
assert_eq!(pset.num_of_templates(), 1);
3621+
assert_eq!(pset.num_of_policies(), 2);
36103622
assert_eq!(pset.policies().filter(|p| p.is_static()).count(), 1);
36113623

36123624
assert_eq!(

0 commit comments

Comments
 (0)