()
| 137 | |
| 138 | #[test] |
| 139 | fn template_authorization_call_succeeds() { |
| 140 | let result = call_cedar( |
| 141 | "AuthorizationOperation", |
| 142 | r#" |
| 143 | { |
| 144 | "principal" : { |
| 145 | "type" : "User", |
| 146 | "id" : "alice" |
| 147 | }, |
| 148 | "action" : { |
| 149 | "type" : "Photo", |
| 150 | "id" : "view" |
| 151 | }, |
| 152 | "resource" : { |
| 153 | "type" : "Photo", |
| 154 | "id" : "door" |
| 155 | }, |
| 156 | "context" : {}, |
| 157 | "policies" : { |
| 158 | "staticPolicies" : {}, |
| 159 | "templates" : { |
| 160 | "ID0": "permit(principal == ?principal, action, resource);" |
| 161 | }, |
| 162 | "templateLinks" : [ |
| 163 | { |
| 164 | "templateId" : "ID0", |
| 165 | "newId" : "ID0_User_alice", |
| 166 | "values" : { |
| 167 | "?principal": { |
| 168 | "type" : "User", |
| 169 | "id" : "alice" |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | ] |
| 174 | }, |
| 175 | "entities" : [] |
| 176 | } |
| 177 | "#, |
| 178 | ); |
| 179 | assert_authorization_success(&result); |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | mod validation_tests { |
nothing calls this directly
no test coverage detected