[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=915415=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-915415 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 18/Apr/24 22:37 Start Date: 18/Apr/24 22:37 Worklog Time Spent: 10m Work Description: kusalk merged PR #917: URL: https://github.com/apache/struts/pull/917 Issue Time Tracking --- Worklog Id: (was: 915415) Time Spent: 2h 50m (was: 2h 40m) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 2h 50m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=915303=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-915303 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 18/Apr/24 12:35 Start Date: 18/Apr/24 12:35 Worklog Time Spent: 10m Work Description: sonarcloud[bot] commented on PR #917: URL: https://github.com/apache/struts/pull/917#issuecomment-2063764420 ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_struts=917) **Quality Gate passed** Issues ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_struts=917=false=true) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/component_measures?id=apache_struts=917=new_accepted_issues=list) Measures ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts=917=false=true) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [94.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_struts=917=new_coverage=list) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_struts=917=new_duplicated_lines_density=list) [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_struts=917) Issue Time Tracking --- Worklog Id: (was: 915303) Time Spent: 2h 40m (was: 2.5h) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 2h 40m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=915302=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-915302 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 18/Apr/24 12:30 Start Date: 18/Apr/24 12:30 Worklog Time Spent: 10m Work Description: kusalk opened a new pull request, #917: URL: https://github.com/apache/struts/pull/917 WW-5406 -- Fixing a minor bug I introduced with #910 Issue Time Tracking --- Worklog Id: (was: 915302) Time Spent: 2.5h (was: 2h 20m) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 2.5h > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=914076=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914076 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 11/Apr/24 04:27 Start Date: 11/Apr/24 04:27 Worklog Time Spent: 10m Work Description: kusalk merged PR #910: URL: https://github.com/apache/struts/pull/910 Issue Time Tracking --- Worklog Id: (was: 914076) Time Spent: 2h 20m (was: 2h 10m) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 2h 20m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913825=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913825 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 10/Apr/24 06:08 Start Date: 10/Apr/24 06:08 Worklog Time Spent: 10m Work Description: sonarcloud[bot] commented on PR #910: URL: https://github.com/apache/struts/pull/910#issuecomment-2046603099 ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_struts=910) **Quality Gate failed** Failed conditions ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [B Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_struts=910) (required ≥ A) [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_struts=910) ## ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request) Issue Time Tracking --- Worklog Id: (was: 913825) Time Spent: 2h 10m (was: 2h) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 2h 10m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913824=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913824 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 10/Apr/24 06:04 Start Date: 10/Apr/24 06:04 Worklog Time Spent: 10m Work Description: kusalk commented on PR #910: URL: https://github.com/apache/struts/pull/910#issuecomment-2046598907 Done Issue Time Tracking --- Worklog Id: (was: 913824) Time Spent: 2h (was: 1h 50m) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 2h > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913823=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913823 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 10/Apr/24 06:02 Start Date: 10/Apr/24 06:02 Worklog Time Spent: 10m Work Description: sonarcloud[bot] commented on PR #910: URL: https://github.com/apache/struts/pull/910#issuecomment-2046596843 ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_struts=910) **Quality Gate failed** Failed conditions ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [B Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_struts=910) (required ≥ A) [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_struts=910) ## ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request) Issue Time Tracking --- Worklog Id: (was: 913823) Time Spent: 1h 50m (was: 1h 40m) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 1h 50m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913822=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913822 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 10/Apr/24 05:59 Start Date: 10/Apr/24 05:59 Worklog Time Spent: 10m Work Description: kusalk commented on PR #910: URL: https://github.com/apache/struts/pull/910#issuecomment-2046593552 Ah wait, just realised I made a breaking change in PrepareOperations.java, let me fix that Issue Time Tracking --- Worklog Id: (was: 913822) Time Spent: 1h 40m (was: 1.5h) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 1h 40m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913821=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913821 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 10/Apr/24 05:59 Start Date: 10/Apr/24 05:59 Worklog Time Spent: 10m Work Description: kusalk commented on code in PR #910: URL: https://github.com/apache/struts/pull/910#discussion_r155068 ## core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareFilter.java: ## @@ -43,6 +43,8 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter { protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING = StrutsPrepareFilter.class.getName() + ".REQUEST_EXCLUDED_FROM_ACTION_MAPPING"; protected PrepareOperations prepare; + +@Deprecated Review Comment: Fixed and created this general issue - WW-5411 Issue Time Tracking --- Worklog Id: (was: 913821) Time Spent: 1.5h (was: 1h 20m) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 1.5h > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913820=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913820 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 10/Apr/24 05:53 Start Date: 10/Apr/24 05:53 Worklog Time Spent: 10m Work Description: lukaszlenart commented on code in PR #910: URL: https://github.com/apache/struts/pull/910#discussion_r1558883281 ## core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareFilter.java: ## @@ -43,6 +43,8 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter { protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING = StrutsPrepareFilter.class.getName() + ".REQUEST_EXCLUDED_FROM_ACTION_MAPPING"; protected PrepareOperations prepare; + +@Deprecated Review Comment: We can have one general ticket to remove all the deprecated options, just to be sure we won't miss this one at some point (so `since` would be needed) Issue Time Tracking --- Worklog Id: (was: 913820) Time Spent: 1h 20m (was: 1h 10m) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 1h 20m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913819=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913819 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 10/Apr/24 05:50 Start Date: 10/Apr/24 05:50 Worklog Time Spent: 10m Work Description: kusalk commented on code in PR #910: URL: https://github.com/apache/struts/pull/910#discussion_r1558881309 ## core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java: ## @@ -340,6 +348,27 @@ public void setMultipartValidationRegex(String multipartValidationRegex) { this.multipartValidationPattern = Pattern.compile(multipartValidationRegex); } +@Inject(value = StrutsConstants.STRUTS_ACTION_EXCLUDE_PATTERN_SEPARATOR, required = false) +public void setActionExcludedPatternsSeparator(String separator) { +this.actionExcludedPatternsSeparator = separator; +} + +@Inject(value = StrutsConstants.STRUTS_ACTION_EXCLUDE_PATTERN, required = false) +public void setActionExcludedPatterns(String excludedPatterns) { +this.actionExcludedPatterns = buildExcludedPatternsList(excludedPatterns, actionExcludedPatternsSeparator); +} + +private static List buildExcludedPatternsList(String patterns, String separator) { +if (patterns == null || patterns.trim().isEmpty()) { +return emptyList(); +} +return unmodifiableList(Arrays.stream(patterns.split(separator)).map(String::trim).map(Pattern::compile).collect(toList())); +} + +public List getActionExcludedPatterns() { +return actionExcludedPatterns; +} Review Comment: WW-5410 Issue Time Tracking --- Worklog Id: (was: 913819) Time Spent: 1h 10m (was: 1h) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 1h 10m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913817=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913817 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 10/Apr/24 05:19 Start Date: 10/Apr/24 05:19 Worklog Time Spent: 10m Work Description: kusalk commented on code in PR #910: URL: https://github.com/apache/struts/pull/910#discussion_r1558857128 ## core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareFilter.java: ## @@ -43,6 +43,8 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter { protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING = StrutsPrepareFilter.class.getName() + ".REQUEST_EXCLUDED_FROM_ACTION_MAPPING"; protected PrepareOperations prepare; + +@Deprecated Review Comment: Yep let me rectify Regarding a ticket for the deletion - my assumption would be that all deprecated elements are deleted in the next major version. Do we still require individual follow-up issues in the case of a deprecation? ## core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java: ## @@ -340,6 +348,27 @@ public void setMultipartValidationRegex(String multipartValidationRegex) { this.multipartValidationPattern = Pattern.compile(multipartValidationRegex); } +@Inject(value = StrutsConstants.STRUTS_ACTION_EXCLUDE_PATTERN_SEPARATOR, required = false) +public void setActionExcludedPatternsSeparator(String separator) { +this.actionExcludedPatternsSeparator = separator; +} + +@Inject(value = StrutsConstants.STRUTS_ACTION_EXCLUDE_PATTERN, required = false) +public void setActionExcludedPatterns(String excludedPatterns) { +this.actionExcludedPatterns = buildExcludedPatternsList(excludedPatterns, actionExcludedPatternsSeparator); +} + +private static List buildExcludedPatternsList(String patterns, String separator) { +if (patterns == null || patterns.trim().isEmpty()) { +return emptyList(); +} +return unmodifiableList(Arrays.stream(patterns.split(separator)).map(String::trim).map(Pattern::compile).collect(toList())); +} + +public List getActionExcludedPatterns() { +return actionExcludedPatterns; +} Review Comment: Yep I think that's a fair call, I'll create an issue for it Issue Time Tracking --- Worklog Id: (was: 913817) Time Spent: 1h (was: 50m) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 1h > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913812=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913812 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 10/Apr/24 04:53 Start Date: 10/Apr/24 04:53 Worklog Time Spent: 10m Work Description: lukaszlenart commented on code in PR #910: URL: https://github.com/apache/struts/pull/910#discussion_r1558837094 ## core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java: ## @@ -340,6 +348,27 @@ public void setMultipartValidationRegex(String multipartValidationRegex) { this.multipartValidationPattern = Pattern.compile(multipartValidationRegex); } +@Inject(value = StrutsConstants.STRUTS_ACTION_EXCLUDE_PATTERN_SEPARATOR, required = false) +public void setActionExcludedPatternsSeparator(String separator) { +this.actionExcludedPatternsSeparator = separator; +} + +@Inject(value = StrutsConstants.STRUTS_ACTION_EXCLUDE_PATTERN, required = false) +public void setActionExcludedPatterns(String excludedPatterns) { +this.actionExcludedPatterns = buildExcludedPatternsList(excludedPatterns, actionExcludedPatternsSeparator); +} + +private static List buildExcludedPatternsList(String patterns, String separator) { +if (patterns == null || patterns.trim().isEmpty()) { +return emptyList(); +} +return unmodifiableList(Arrays.stream(patterns.split(separator)).map(String::trim).map(Pattern::compile).collect(toList())); +} + +public List getActionExcludedPatterns() { +return actionExcludedPatterns; +} Review Comment: It's getting crowd'y here, what about moving all the injectable options into `DispatcherOptions`? It doesn't have to happen now, but I can create a ticket to address that later ## core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareFilter.java: ## @@ -43,6 +43,8 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter { protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING = StrutsPrepareFilter.class.getName() + ".REQUEST_EXCLUDED_FROM_ACTION_MAPPING"; protected PrepareOperations prepare; + +@Deprecated Review Comment: Please document why it's deprecated and what to use instead. Also `since` should be added, and feel free to create a ticket in JIRA to remove this deprecated element in Struts 7. [An example deprecation](https://github.com/apache/struts/blob/master/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java#L176) Issue Time Tracking --- Worklog Id: (was: 913812) Time Spent: 50m (was: 40m) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 50m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913556=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913556 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 09/Apr/24 04:37 Start Date: 09/Apr/24 04:37 Worklog Time Spent: 10m Work Description: lukaszlenart commented on PR #910: URL: https://github.com/apache/struts/pull/910#issuecomment-2044134648 > Ignore SonarCloud results, they are incorrect again Probably because the last scan was for Struts 7 branch, I will fix that Issue Time Tracking --- Worklog Id: (was: 913556) Time Spent: 40m (was: 0.5h) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 40m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913547=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913547 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 09/Apr/24 01:43 Start Date: 09/Apr/24 01:43 Worklog Time Spent: 10m Work Description: kusalk commented on PR #910: URL: https://github.com/apache/struts/pull/910#issuecomment-2043993582 Ignore SonarCloud results, they are incorrect again Issue Time Tracking --- Worklog Id: (was: 913547) Time Spent: 0.5h (was: 20m) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 0.5h > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913544=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913544 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 09/Apr/24 00:50 Start Date: 09/Apr/24 00:50 Worklog Time Spent: 10m Work Description: sonarcloud[bot] commented on PR #910: URL: https://github.com/apache/struts/pull/910#issuecomment-2043945051 ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_struts=910) **Quality Gate failed** Failed conditions ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [8 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts=910=false=true) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [28.6% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_struts=910=new_coverage=list) (required ≥ 80%) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [4.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_struts=910=new_duplicated_lines_density=list) (required ≤ 3%) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [E Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_struts=910) (required ≥ A) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [E Security Rating on New Code](https://sonarcloud.io/dashboard?id=apache_struts=910) (required ≥ A) [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_struts=910) ## ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request) Issue Time Tracking --- Worklog Id: (was: 913544) Time Spent: 20m (was: 10m) > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 20m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (WW-5406) Action excluded patterns are not updated following a configuration reload
[ https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913459=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913459 ] ASF GitHub Bot logged work on WW-5406: -- Author: ASF GitHub Bot Created on: 08/Apr/24 13:04 Start Date: 08/Apr/24 13:04 Worklog Time Spent: 10m Work Description: kusalk opened a new pull request, #910: URL: https://github.com/apache/struts/pull/910 WW-5406 -- Issue Time Tracking --- Worklog Id: (was: 913459) Remaining Estimate: 0h Time Spent: 10m > Action excluded patterns are not updated following a configuration reload > - > > Key: WW-5406 > URL: https://issues.apache.org/jira/browse/WW-5406 > Project: Struts 2 > Issue Type: Bug > Components: Core >Reporter: Kusal Kithul-Godage >Priority: Minor > Fix For: 6.5.0 > > Time Spent: 10m > Remaining Estimate: 0h > > If {{struts.action.excludePattern}} or > {{struts.action.excludePattern.separator}} are updated during runtime, the > changes are not reflected in the application behaviour due to these constants > only being read exactly once. This is not consistent with all other > configuration which is re-injected following a configuration reload. -- This message was sent by Atlassian Jira (v8.20.10#820010)