Skip to content

Commit fd9ed89

Browse files
Update EntityUID constructor for cedar-policy/cedar#802 (#300)
Signed-off-by: John Kastner <[email protected]>
1 parent a793905 commit fd9ed89

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

cedar-policy-generators/src/hierarchy.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ impl Hierarchy {
155155
)?;
156156
Ok(uid.clone())
157157
} else {
158-
Ok(EntityUID::from_components(typename.clone(), u.arbitrary()?))
158+
Ok(EntityUID::from_components(
159+
typename.clone(),
160+
u.arbitrary()?,
161+
None,
162+
))
159163
}
160164
}
161165
/// size hint for arbitrary_uid_with_type()
@@ -402,6 +406,7 @@ pub(crate) fn arbitrary_specified_uid(u: &mut Unstructured<'_>) -> Result<ast::E
402406
Ok(ast::EntityUID::from_components(
403407
u.arbitrary::<ast::Name>()?,
404408
u.arbitrary::<ast::Eid>()?,
409+
None,
405410
))
406411
}
407412

@@ -421,7 +426,7 @@ pub(crate) fn generate_uid_with_type(
421426
Eid::new(nanoid!(n))
422427
}
423428
};
424-
Ok(ast::EntityUID::from_components(ty, eid))
429+
Ok(ast::EntityUID::from_components(ty, eid, None))
425430
}
426431

427432
impl<'a, 'u> HierarchyGenerator<'a, 'u> {

cedar-policy-generators/src/schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ fn arbitrary_schematype_size_hint(depth: usize) -> (usize, Option<usize>) {
274274
pub fn uid_for_action_name(namespace: Option<ast::Name>, action_name: ast::Eid) -> ast::EntityUID {
275275
let entity_type =
276276
build_qualified_entity_type_name(namespace, "Action".parse().expect("valid id"));
277-
ast::EntityUID::from_components(entity_type, action_name)
277+
ast::EntityUID::from_components(entity_type, action_name, None)
278278
}
279279

280280
/// internal helper function, convert a SchemaType to a Type (loses some

0 commit comments

Comments
 (0)