Fix NoScript enforcement for sub commands in Lua scripts#1887
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Lua scripting NoScript enforcement by including sub-commands in LuaRunner.NoScriptDetails, and extends the scripting test suite to validate both NoScript blocking and ACL enforcement when commands are invoked from Lua scripts.
Changes:
- Extend
LuaRunner.InitializeNoScriptDetails()to includeNoScriptsub-commands in the bitmap used by script permission checks. - Expand
NoScriptCommandsForbiddento testNoScriptrestrictions for both top-level commands and sub-commands invoked viaredis.call. - Add a scripting test to verify ACL permission failures are enforced during
redis.callexecution.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/standalone/Garnet.test.scripting/LuaScriptTests.cs | Adds/extends tests for NoScript enforcement (including sub-commands) and ACL enforcement from Lua scripts. |
| libs/server/Lua/LuaRunner.cs | Updates NoScriptDetails bitmap initialization to include NoScript-flagged sub-commands. |
vazois
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's a bug right now where sub commands are not included in the
LuaRunner.NoScriptDetailsbitmap.Fixes that, adds a test.
This also adds a test to double check that ACLs are enforced, as there was no explicit test for that.