Skip to content

Commit

Permalink
fix cherry-pick errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shaobo-he-aws committed Aug 15, 2023
1 parent 1eb7a74 commit 2cb6357
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cedar-drt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ env_logger = "0.10"
log = "0.4"
libfuzzer-sys = "0.4"
cedar-policy = { path = "../cedar/cedar-policy", version = "2.3", features = ["integration_testing"] }
cedar-policy-core = { path = "../cedar/cedar-policy-core", version = "2.3" }
cedar-policy-validator = { path = "../cedar/cedar-policy-validator", version = "2.3" }
cedar-policy-core = { path = "../cedar/cedar-policy-core", version = "2.3", features = ["arbitrary"] }
cedar-policy-validator = { path = "../cedar/cedar-policy-validator", version = "2.3", features = ["arbitrary"] }
cedar-policy-formatter = { path = "../cedar/cedar-policy-formatter", version = "2.3" }
jni = { version = "0.19.0", features = ["invocation"] }
serde = { version = "1.0", features = ["derive"] }
Expand Down
5 changes: 3 additions & 2 deletions cedar-drt/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ libfuzzer-sys = "0.4"
serde = { version = "1.0", feature = ["derive"] }
serde_json = "1.0"
cedar-drt = { version = "2.0.0", path = ".." }
cedar-policy-core = { path = "../../cedar/cedar-policy-core", version = "2.3" }
cedar-policy-validator = { path = "../../cedar/cedar-policy-validator", version = "2.3" }
cedar-policy = { path = "../../cedar/cedar-policy", version = "2.3" }
cedar-policy-core = { path = "../../cedar/cedar-policy-core", version = "2.3", features = ["arbitrary"] }
cedar-policy-validator = { path = "../../cedar/cedar-policy-validator", version = "2.3", features = ["arbitrary"] }
cedar-policy-formatter = { path = "../../cedar/cedar-policy-formatter", version = "2.3" }
cedar-policy-generators = { path = "../../cedar-policy-generators", version = "2.*" }
smol_str = { version = "0.2", features = ["serde"] }
Expand Down
2 changes: 1 addition & 1 deletion cedar-drt/fuzz/fuzz_targets/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use cedar_drt::initialize_log;
use cedar_drt_inner::fuzz_target;
use cedar_policy_core::ast::{EntityType, ExprKind, Literal, StaticPolicy, Template};
use cedar_policy_core::parser::{self, parse_policy};
use cedar_policy_core::parser::{err, parse_policy};
use cedar_policy_formatter::{lexer, policies_str_to_pretty, Config};
use cedar_policy_generators::abac::{ABACPolicy, ABACSettings};
use cedar_policy_generators::schema::Schema;
Expand Down
2 changes: 1 addition & 1 deletion cedar-drt/fuzz/fuzz_targets/pp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use cedar_drt::initialize_log;
use cedar_drt_inner::fuzz_target;
use cedar_policy_core::ast::{EntityType, ExprKind, Literal, StaticPolicy, Template};
use cedar_policy_core::parser::{self, parse_policy};
use cedar_policy_core::parser::{err, parse_policy};
use cedar_policy_generators::abac::{ABACPolicy, ABACSettings};
use cedar_policy_generators::schema::Schema;
use libfuzzer_sys::arbitrary::{self, Arbitrary, Unstructured};
Expand Down
2 changes: 1 addition & 1 deletion cedar-drt/fuzz/fuzz_targets/validation-pbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ fuzz_target!(|input: FuzzTargetInput| {
.filter(|err| err.contains("type error"))
.collect::<Vec<String>>(),
Vec::<String>::new(),
"validated policy produced a type error!\npolicies:\n{policyset}\nentities:\n{entities}\nschema:\n{schemafile_string}\nrequest:\n{q}\n",
"validated policy produced a type error!\npolicies:\n{policyset}\nentities:\n{entities}\nschema:\nrequest:\n{q}\n",
);
// or wrong-number-of-arguments errors
assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion cedar-policy-generators/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ fn uid_for_action_name(namespace: Option<SmolStr>, action_name: &SmolStr) -> ast
let namespace_prefix = namespace.map(|ns| format!("{ns}::")).unwrap_or_default();
format!("{}Action::\"{}\"", namespace_prefix, action_name)
.parse()
unwrap_or_else(|e| panic!("schema actions should all be valid EntityUIDs in this context, but {action_name:?} led to an invalid one: {e}"))
.unwrap_or_else(|e| panic!("schema actions should all be valid EntityUIDs in this context, but {action_name:?} led to an invalid one: {e:?}"))
}

/// internal helper function, convert a SchemaType to a Type (loses some
Expand Down

0 comments on commit 2cb6357

Please sign in to comment.