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

Calling CelRuntimeBuilder.setStandardEnvironmentEnabled(false) does not disable standard functions #255

Closed
modhanami opened this issue Feb 26, 2024 · 1 comment

Comments

@modhanami
Copy link
Contributor

Note

I see StandardFunctions.add() being called twice in CelRuntimeLegacyImpl.build(), once in DefaultDispatcher.create() unconditionally, and another when standardEnvironmentEnabled is true.

Are these intended? Or how can I disable the standard functions completely to achieve something like cel-go's NewCustomEnv?

DefaultDispatcher dispatcher = DefaultDispatcher.create(options, dynamicProto);
if (standardEnvironmentEnabled) {
StandardFunctions.add(dispatcher, dynamicProto, options);
}

public static DefaultDispatcher create(CelOptions celOptions, DynamicProto dynamicProto) {
DefaultDispatcher dispatcher = new DefaultDispatcher(celOptions);
StandardFunctions.add(dispatcher, dynamicProto, celOptions);
return dispatcher;
}

@l46kok
Copy link
Collaborator

l46kok commented Feb 27, 2024

This is most definitely unintended. #256 should fix this when it lands.

Thanks for reporting.

copybara-service bot pushed a commit that referenced this issue Feb 27, 2024
copybara-service bot pushed a commit that referenced this issue Feb 27, 2024
copybara-service bot pushed a commit that referenced this issue Feb 28, 2024
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 a pull request may close this issue.

2 participants