Skip to content

Provide Getter for Context from Request and attributes of the Entity #363

@maxcshui

Description

@maxcshui

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?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestThis issue requets a substantial new featuregood-first-issueGood for newcomers. A smaller issue that someone new to the Cedar codebase should be able to tacklehelp-wantedCommunity help desired. We have not scheduled time to fix this, but think it important.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions