Skip to content

Commit

Permalink
Fixing unit tests= (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjeline authored Nov 8, 2023
1 parent a4a13d4 commit 1918739
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions CedarJavaFFI/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ mod test {
"AuthorizationOperation",
r#"
{
"principal": "User::\"alice\"",
"action": "Photo::\"view\"",
"resource": "Photo::\"photo\"",
"principal" : { "type" : "User", "id" : "alice" },
"action" : { "type" : "Photo", "id" : "view" },
"resource" : { "type" : "Photo", "id" : "photo" },
"slice": {
"policies": {},
"entities": []
Expand Down Expand Up @@ -349,8 +349,8 @@ mod test {
"template_instantiations": []
},
"principal": null,
"action": "Action::\"view\"",
"resource": "Resource::\"thing\""
"action" : { "type" : "Action", "id" : "view" },
"resource" : { "type" : "Resource", "id" : "thing" }
}
"#,
);
Expand All @@ -372,8 +372,8 @@ mod test {
"templates": {},
"template_instantiations": []
},
"principal": "User::\"alice\"",
"action": "Action::\"view\"",
"principal" : { "type" : "User", "id" : "alice" },
"action" : { "type" : "Action", "id" : "view" },
"resource": null
}
"#,
Expand All @@ -386,11 +386,21 @@ mod test {
let result = call_cedar(
"AuthorizationOperation",
r#"
{ "principal": "User::\"alice\""
, "action" : "Photo::\"view\""
, "resource" : "Photo::\"door\""
, "context" : {}
, "slice" : {
{
"principal" : {
"type" : "User",
"id" : "alice"
},
"action" : {
"type" : "Photo",
"id" : "view"
},
"resource" : {
"type" : "Photo",
"id" : "door"
},
"context" : {},
"slice" : {
"policies" : {}
, "entities" : []
, "templates" : {
Expand Down

0 comments on commit 1918739

Please sign in to comment.