MCPcopy Create free account
hub / github.com/cedar-policy/cedar-java / template_authorization_call_succeeds

Function template_authorization_call_succeeds

CedarJavaFFI/src/tests.rs:139–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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
183mod validation_tests {

Callers

nothing calls this directly

Calls 2

call_cedarFunction · 0.85

Tested by

no test coverage detected