cedar-policy / cedar

Implementation of the Cedar Policy Language
https://www.cedarpolicy.com
Apache License 2.0
889 stars 80 forks source link

Improve cedar policy API to access request context information #1318

Closed tamas-jozsa closed 6 days ago

tamas-jozsa commented 1 week ago

Description of changes

Added a new get helper method to Context that allows easy extraction of generic values from the context by key. This method simplifies the common use case of retrieving values from Context objects.

Issue #, if available

Add get convenience method to Context for generic value extraction

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

I confirm that this PR (choose one, and delete the other options):

I confirm that cedar-spec (choose one, and delete the other options):

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):

john-h-kastner-aws commented 6 days ago

also, maybe add a line to the changelog for the new functionality

tamas-jozsa commented 6 days ago

also, maybe add a line to the changelog for the new functionality

done and done