diff --git a/cedar b/cedar index 552a00c72..35b7f79fb 160000 --- a/cedar +++ b/cedar @@ -1 +1 @@ -Subproject commit 552a00c72f852fc4046426599b67719929080e8d +Subproject commit 35b7f79fb92219dfc68dd24dbc265441102b694a diff --git a/cedar-dafny/difftest/main.dfy b/cedar-dafny/difftest/main.dfy index 699b26ec6..64f7b002a 100644 --- a/cedar-dafny/difftest/main.dfy +++ b/cedar-dafny/difftest/main.dfy @@ -68,7 +68,7 @@ module difftest.main { const entitytypeFromProdJson := sumDeserializer( map[ - "Concrete" := j => var n :- nameFromProdJson(j); Ok(EntityType(n)), + "Specified" := j => var n :- nameFromProdJson(j); Ok(EntityType(n)), "Unspecified" := _ => Ok(EntityType.UNSPECIFIED) ]) @@ -293,11 +293,11 @@ module difftest.main { } // In the production engine, `EntityUIDEntry` is the data type for a request - // field that is either a "concrete" EntityUID or "unknown" (for partial + // field that is either a "known" EntityUID or "unknown" (for partial // evaluation). We currently don't support partial evaluation, so we just - // translate the "concrete" variant to an EntityUID. + // translate the "known" variant to an EntityUID. const entityUIDEntryFromProdJson := - sumDeserializer(map["Concrete" := entityUIDFromProdJson]) + sumDeserializer(map["Known" := entityUIDFromProdJson]) function getEntityUIDEntryField(request: Json, f: string): FromProdResult { deserializeField(request, f, entityUIDEntryFromProdJson) @@ -532,7 +532,7 @@ module difftest.main { const entitytypeFromProdJsonOption := sumDeserializer( map[ - "Concrete" := j => var n :- nameFromProdJson(j); Ok(Some(EntityType(n))), + "Specified" := j => var n :- nameFromProdJson(j); Ok(Some(EntityType(n))), "Unspecified" := _ => Ok(None) ]) diff --git a/cedar-drt/fuzz/src/dump.rs b/cedar-drt/fuzz/src/dump.rs index b9a6dea84..9795d09d9 100644 --- a/cedar-drt/fuzz/src/dump.rs +++ b/cedar-drt/fuzz/src/dump.rs @@ -140,9 +140,9 @@ pub fn dump<'a>( fn dump_request_var(var: &EntityUIDEntry) -> Option { match var { EntityUIDEntry::Unknown => None, - EntityUIDEntry::Concrete(euid) => match euid.entity_type() { + EntityUIDEntry::Known(euid) => match euid.entity_type() { cedar_policy_core::ast::EntityType::Unspecified => None, - cedar_policy_core::ast::EntityType::Concrete(_) => Some(euid.to_string()), + cedar_policy_core::ast::EntityType::Specified(_) => Some(euid.to_string()), }, } } diff --git a/cedar-drt/fuzz/src/lib.rs b/cedar-drt/fuzz/src/lib.rs index 37b4e0267..0719762a7 100644 --- a/cedar-drt/fuzz/src/lib.rs +++ b/cedar-drt/fuzz/src/lib.rs @@ -179,13 +179,13 @@ fn test_run_auth_test() { let java_def_engine = JavaDefinitionalEngine::new().expect("failed to create definitional engine"); - let principal = ast::EntityUIDEntry::Concrete(std::sync::Arc::new( + let principal = ast::EntityUIDEntry::Known(std::sync::Arc::new( EntityUID::with_eid_and_type("User", "alice").unwrap(), )); - let action = ast::EntityUIDEntry::Concrete(std::sync::Arc::new( + let action = ast::EntityUIDEntry::Known(std::sync::Arc::new( EntityUID::with_eid_and_type("Action", "view").unwrap(), )); - let resource = ast::EntityUIDEntry::Concrete(std::sync::Arc::new( + let resource = ast::EntityUIDEntry::Known(std::sync::Arc::new( EntityUID::with_eid_and_type("Photo", "vacation").unwrap(), )); let query = ast::Request::new_with_unknowns( diff --git a/cedar-policy-generators/src/hierarchy.rs b/cedar-policy-generators/src/hierarchy.rs index a826e0856..e33da085f 100644 --- a/cedar-policy-generators/src/hierarchy.rs +++ b/cedar-policy-generators/src/hierarchy.rs @@ -260,7 +260,7 @@ impl From for Hierarchy { let mut uids_by_type: HashMap> = HashMap::new(); for e in entities.iter() { let etype = match e.uid().entity_type() { - ast::EntityType::Concrete(name) => name.clone(), + ast::EntityType::Specified(name) => name.clone(), ast::EntityType::Unspecified => { panic!("didn't expect unspecified entity in Entities") } @@ -411,7 +411,7 @@ impl<'a, 'u> HierarchyGenerator<'a, 'u> { entity_types .into_iter() .filter_map(|ty| match ty { - ast::EntityType::Concrete(name) => Some(name), + ast::EntityType::Specified(name) => Some(name), ast::EntityType::Unspecified => None, }) .collect() @@ -495,7 +495,7 @@ impl<'a, 'u> HierarchyGenerator<'a, 'u> { .entities() .map(|e| e.uid()) .map(|uid| { - let ast::EntityType::Concrete(name) = uid.entity_type() else { + let ast::EntityType::Specified(name) = uid.entity_type() else { // `entity_types` was generated in such a way as to never produce // unspecified entities panic!("should not be possible to generate an unspecified entity") diff --git a/cedar-policy-generators/src/schema.rs b/cedar-policy-generators/src/schema.rs index ea2317489..64d0e7e2d 100644 --- a/cedar-policy-generators/src/schema.rs +++ b/cedar-policy-generators/src/schema.rs @@ -335,7 +335,7 @@ pub(crate) fn build_qualified_entity_type_name( name: ast::Id, ) -> ast::Name { match build_qualified_entity_type(namespace, Some(name)) { - ast::EntityType::Concrete(type_name) => type_name, + ast::EntityType::Specified(type_name) => type_name, ast::EntityType::Unspecified => { panic!("Should not have built an unspecified type from `Some(name)`.") } @@ -378,8 +378,8 @@ fn build_qualified_entity_type( ) -> ast::EntityType { match basename { Some(basename) => match namespace { - None => ast::EntityType::Concrete(ast::Name::unqualified_name(basename)), - Some(ns) => ast::EntityType::Concrete(ast::Name::type_in_namespace(basename, ns)), + None => ast::EntityType::Specified(ast::Name::unqualified_name(basename)), + Some(ns) => ast::EntityType::Specified(ast::Name::type_in_namespace(basename, ns)), }, None => ast::EntityType::Unspecified, } @@ -854,7 +854,7 @@ impl Schema { ) -> Result { let ty = build_qualified_entity_type(self.namespace().cloned(), ty_name); match ty { - ast::EntityType::Concrete(ty) => self + ast::EntityType::Specified(ty) => self .exprgenerator(hierarchy) .arbitrary_uid_with_type(&ty, u), ast::EntityType::Unspecified => Ok(ast::EntityUID::unspecified_from_eid( @@ -892,7 +892,7 @@ impl Schema { ast::EntityType::Unspecified => { panic!("should not be possible to generate an unspecified entity") } - ast::EntityType::Concrete(name) => { + ast::EntityType::Specified(name) => { Some(entity_type_name_to_schema_type_variant(&name)) } }