@@ -304,9 +304,9 @@ mod test {
304304 "AuthorizationOperation" ,
305305 r#"
306306{
307- "principal": " User::\ "alice\"" ,
308- "action": " Photo::\ "view\"" ,
309- "resource": " Photo::\ "photo\"" ,
307+ "principal" : { "type" : " User", "id" : "alice" } ,
308+ "action" : { "type" : " Photo", "id" : "view" } ,
309+ "resource" : { "type" : " Photo", "id" : "photo" } ,
310310 "slice": {
311311 "policies": {},
312312 "entities": []
@@ -349,8 +349,8 @@ mod test {
349349 "template_instantiations": []
350350 },
351351 "principal": null,
352- "action": " Action::\ "view\"" ,
353- "resource": " Resource::\ "thing\""
352+ "action" : { "type" : " Action", "id" : "view" } ,
353+ "resource" : { "type" : " Resource", "id" : "thing" }
354354 }
355355 "# ,
356356 ) ;
@@ -372,8 +372,8 @@ mod test {
372372 "templates": {},
373373 "template_instantiations": []
374374 },
375- "principal": " User::\ "alice\"" ,
376- "action": " Action::\ "view\"" ,
375+ "principal" : { "type" : " User", "id" : "alice" } ,
376+ "action" : { "type" : " Action", "id" : "view" } ,
377377 "resource": null
378378 }
379379 "# ,
@@ -386,11 +386,21 @@ mod test {
386386 let result = call_cedar (
387387 "AuthorizationOperation" ,
388388 r#"
389- { "principal": "User::\"alice\""
390- , "action" : "Photo::\"view\""
391- , "resource" : "Photo::\"door\""
392- , "context" : {}
393- , "slice" : {
389+ {
390+ "principal" : {
391+ "type" : "User",
392+ "id" : "alice"
393+ },
394+ "action" : {
395+ "type" : "Photo",
396+ "id" : "view"
397+ },
398+ "resource" : {
399+ "type" : "Photo",
400+ "id" : "door"
401+ },
402+ "context" : {},
403+ "slice" : {
394404 "policies" : {}
395405 , "entities" : []
396406 , "templates" : {
0 commit comments