Provide Getter for Context from Request and attributes of the Entity #363
Labels
feature-request
This issue requets a substantial new feature
good-first-issue
Good for newcomers. A smaller issue that someone new to the Cedar codebase should be able to tackle
help-wanted
Community help desired. We have not scheduled time to fix this, but think it important.
Category
User level API changes
Describe the feature you'd like to request
Currently, both Request and Entity do not expose the API for user to retrieve the Context of the Request and Attribute of the Entity.
In my use case, I need to access both Request and Entity information for purposes like authorization logging and mapping these fields into the OCSF (Open Cybersecurity Framework) format. However, my current option is limited to using the to_string() method to store the entire context of the entity and request in the authorization log.
If cedar could introduce features such as
Request.context() -> Option<impl Iterator<Item = (String, RestrictedExpression)>>
,Entity.attributes() -> Option<HashMap<String, RestrictedExpression>>
, it would significantly enhance my authorization log by providing additional information. It would be beneficial for user to access both fields such that user could do some data manipulation and other purpose.Describe alternatives you've considered
I used
to_string()
to log the whole string into the authorization log.Additional context
No response
Is this something that you'd be interested in working on?
The text was updated successfully, but these errors were encountered: