sergehuber opened a new pull request, #852: URL: https://github.com/apache/unomi/pull/852
Uploading a Groovy action puts code into the server process. That is a host-level operation rather than something confined to one tenant's data plane, so GroovyActionsEndPoint now requires UnomiRoles.ADMINISTRATOR on every path, including the multipart upload. GroovyActionsServiceImpl also compiles through GroovyClassLoader.parseClass(codeSource, false) rather than GroovyShell.parse. The distinction matters because GroovyShell.parse instantiates the script, and instantiating a Groovy script is what evaluates its @Field initializers. Saving an action should compile it and nothing more; evaluating any part of a script's body belongs to dispatch, not to storage. The emitted bytecode is otherwise identical, which was checked rather than assumed. testSaveCompilesWithoutInstantiating carries its own positive control: the same script is first run through a plain GroovyShell and must set the marker. Without that step a probe that silently failed to set it would make the real assertion pass while proving nothing. Jira: https://issues.apache.org/jira/browse/UNOMI-976 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
