Skip to content

More code examples#895

Merged
snazy merged 2 commits into
projectnessie:mainfrom
snazy:more-examples
Jul 16, 2026
Merged

More code examples#895
snazy merged 2 commits into
projectnessie:mainfrom
snazy:more-examples

Conversation

@snazy

@snazy snazy commented Jul 15, 2026

Copy link
Copy Markdown
Member

Adds more examples to the README plus corresponding tests for:

  • custom functions
  • authz style expressions

Also reorganize the README to improve consumability.

Adds more examples to the README plus corresponding tests for:
* custom functions
* authz style expressions

Also reorganize the README to improve consumability.
@snazy snazy requested a review from XN137 July 15, 2026 11:53
XN137
XN137 previously approved these changes Jul 15, 2026

@XN137 XN137 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like a net-positive with minor comments (feel free to ignore)

Comment thread core/src/test/java/org/projectnessie/cel/CELTest.java Outdated
Comment thread tools/src/test/java/org/projectnessie/cel/tools/ScriptHostTest.java
.withLibraries(new AttributeLibrary("prod"))
.build();

assertThat(grants(script, Collections.emptyMap())).isFalse();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this seems to be another case where we collapse exceptions to false, but the behavior could be tested more accurately by asserting the exception.
I understand that in a real "grants" implementation you would want to collapse to "false" in those cases, but not sure about testing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the update.
we seem to have kept the isFalse assertions, which now basically only tests that our grants implementation, collapses exceptions to false

Comment thread README.md
Comment thread README.md Outdated
.withLibraries(new AttributeLibrary("prod"))
.build();

assertThat(grants(script, Collections.emptyMap())).isFalse();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the update.
we seem to have kept the isFalse assertions, which now basically only tests that our grants implementation, collapses exceptions to false

@snazy snazy merged commit d67ab13 into projectnessie:main Jul 16, 2026
3 checks passed
@snazy snazy deleted the more-examples branch July 16, 2026 09:28
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.

2 participants