@@ -89,9 +89,9 @@ async def check(
8989 )
9090 query_context = self ._context_store .get_derived_context (context )
9191 input = dict (
92- user = normalized_user .dict (),
92+ user = normalized_user .dict (exclude_unset = True ),
9393 action = action ,
94- resource = normalized_resource .dict (),
94+ resource = normalized_resource .dict (exclude_unset = True ),
9595 context = query_context ,
9696 )
9797
@@ -171,8 +171,8 @@ def _normalize_resource(self, resource: ResourceInput) -> ResourceInput:
171171 @staticmethod
172172 def _resource_repr (resource : ResourceInput ) -> str :
173173 resource_repr : str = resource .type
174- if resource .id is not None :
175- resource_repr += ":" + resource .id
174+ if resource .key is not None :
175+ resource_repr += ":" + resource .key
176176 if resource .tenant :
177177 resource_repr += f", tenant: { resource .tenant } "
178178 return resource_repr
@@ -182,7 +182,7 @@ def _resource_from_string(resource: str) -> ResourceInput:
182182 parts = resource .split (RESOURCE_DELIMITER )
183183 if len (parts ) < 1 or len (parts ) > 2 :
184184 raise ValueError (f"permit.check() got invalid resource string: { resource } " )
185- return ResourceInput (type = parts [0 ], id = (parts [1 ] if len (parts ) > 1 else None ))
185+ return ResourceInput (type = parts [0 ], key = (parts [1 ] if len (parts ) > 1 else None ))
186186
187187
188188class SyncEnforcer (Enforcer , metaclass = SyncClass ):
0 commit comments