Skip to content

fix(security): default the dynamic-code kill-switch to off in every run mode#2863

Closed
hongwei1 wants to merge 1 commit into
OpenBankProject:developfrom
hongwei1:fix/dynamic-code-default-off-everywhere
Closed

fix(security): default the dynamic-code kill-switch to off in every run mode#2863
hongwei1 wants to merge 1 commit into
OpenBankProject:developfrom
hongwei1:fix/dynamic-code-default-off-everywhere

Conversation

@hongwei1

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #2860 per review feedback from @simonredfern.

  • allow_user_generated_scala_code previously defaulted to true in test/dev run modes when unset, and false only in production. This PR removes that run-mode fallback: the prop must now be explicitly set to true anywhere — including test and dev — or dynamic Scala/JS/Java compilation stays disabled. There is no implicit "on" state left in DynamicUtil.dynamicCodeExecutionEnabled at all.
  • Sets the prop explicitly in the CI "Setup props" steps (build_pull_request.yml, build_container.yml) and in test.default.props.template / run_tests_parallel.sh, so the existing dynamic-code test suites (DynamicUtilTest, ConnectorMethodTest, AbacRuleTests, DynamicResourceDocTest, DynamicMessageDocTest, DynamicCodeKillSwitchTest) keep exercising their ON scenarios locally and in CI.
  • Updates DynamicCodeKillSwitchTest's predicate scenarios to reflect that the suite's "enabled" baseline is now an explicit prop value rather than an implicit test-mode default (there's no way to exercise the truly-absent case from within the test harness, since the base props file always supplies a value once it's set — that branch is covered by direct inspection of the match expression).

Test plan

  • mvn install -pl .,obp-commons -am -DskipTests — BUILD SUCCESS
  • mvn test-compile -pl obp-api -am — main + test sources compile clean
  • Targeted suites (DynamicCodeKillSwitchTest, DynamicUtilTest, ConnectorMethodTest, AbacRuleTests, DynamicResourceDocTest, DynamicMessageDocTest, ResourceDocsTest) — 114 succeeded, 0 failed (3 canceled are pre-existing JDK24+ SecurityManager-unavailable skips, unrelated to this change)

…un mode

allow_user_generated_scala_code previously defaulted to true in
test/dev run modes when unset, only defaulting to false in
production. Per review feedback, remove the run-mode fallback
entirely: the prop must now be set explicitly to true anywhere,
including test and dev, or dynamic Scala/JS/Java compilation stays
disabled.

Set the prop explicitly in the CI "Setup props" steps and in
test.default.props.template / run_tests_parallel.sh so the existing
dynamic-code test suites keep exercising the ON path locally and in
CI. Update DynamicCodeKillSwitchTest's predicate scenarios to reflect
that the suite's baseline is now an explicit prop value, not an
implicit test-mode default.
@sonarqubecloud

Copy link
Copy Markdown

@hongwei1 hongwei1 closed this Jul 13, 2026
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.

1 participant