Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cedar-lean/Protobuf] fix bug parsing empty maps #500

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

cdisselkoen
Copy link
Contributor

Fix incorrect logic when parsing a Proto.Map that has no entries. While we're here, added an HAppend instance for Proto.Map to clean up some calling code slightly

@cdisselkoen
Copy link
Contributor Author

Hmm this regression test doesn't actually fail without this supposed empty-map "fix". Something else going on here. This "fix" does fix my non-reduced example (an AuthorizationRequest from cedar-drt/protobuf_schema, which unfortunately we aren't set up to easily unit-test at the moment)

@cdisselkoen
Copy link
Contributor Author

Possible that it only fails on a policyset like this when the LiteralPolicySet is used as an embedded Message in some larger message (like AuthorizationRequest). Which would make this hard to test in a unit test, since none of the types in cedar-policy have protobuf representations that include a LiteralPolicySet as an embedded Message (right?)

Copy link
Contributor

@john-h-kastner-aws john-h-kastner-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look reasonable, though I don't understand the details of the problems you mention in comments. Does it make sense to merge this as-is given that should fix at least one problem?

@cdisselkoen
Copy link
Contributor Author

I do think we should merge as-is, even though the added test doesn't catch the problem this is fixing, it is definitely fixing a problem

@cdisselkoen cdisselkoen merged commit 50a6ede into main Dec 27, 2024
6 checks passed
@cdisselkoen cdisselkoen deleted the cdisselkoen/proto-fix branch December 27, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants