-
Notifications
You must be signed in to change notification settings - Fork 59
RCM-124 - Cohort Builder pages fails with DWR javascript errors #54
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,31 +33,12 @@ | |
| <allow> | ||
| <create creator="new" javascript="DWRPatientSetService"> | ||
| <param name="class" value="org.openmrs.web.dwr.DWRPatientSetService"/> | ||
| </create> | ||
| <create creator="new" javascript="DWRCohortBuilderService"> | ||
| <param name="class" value="org.openmrs.web.dwr.DWRCohortBuilderService"/> | ||
| <include method="getPatients"/> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once the LUI-212 filter is in play it fails open, so a method added to this list later without
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added DwrConfigXmlTest (00fdc0c): asserts config.xml has exactly one block, and that every d method resolves to a @RequirePrivilege-annotated method, mirroring DwrAuthorizationFilter's own scanDwrCreates/findMethodAnnotation logic. Verified it fails when either bug is reintroduced (duplicate block, or an unannotated method). Needed Java 8 (diamond operator, try-with-resources), so bumped the module's min compiler source/target from 1.5 to 1.8 in the same commit. |
||
| </create> | ||
| <convert match="org.openmrs.cohort.Cohort" converter="bean"/> | ||
| </allow> | ||
| </dwr> | ||
|
|
||
| <globalProperty> | ||
| <property>reportingcompatibility.patientLinkUrl</property> | ||
| <defaultValue>patientDashboard.form</defaultValue> | ||
| <description>The link url for a particular patient to view from the cohort builder</description> | ||
| </globalProperty> | ||
|
|
||
| <globalProperty> | ||
| <property>reportingcompatibility.data_export_batch_size</property> | ||
| <defaultValue>7500</defaultValue> | ||
| <description>The number of patients to export at a time in a data export. The larger this number the faster and more memory that is used. The smaller this number the slower and less memory is used.</description> | ||
| </globalProperty> | ||
|
|
||
| <dwr> | ||
| <allow> | ||
| <convert converter="bean" match="org.openmrs.report.Parameter"/> | ||
| <convert converter="bean" match="org.openmrs.cohort.CohortSearchHistory"/> | ||
|
|
||
| <create creator="new" javascript="DWRCohortBuilderService"> | ||
| <param name="class" value="org.openmrs.web.dwr.DWRCohortBuilderService" /> | ||
| <include method="getMissingParameters"/> | ||
|
|
@@ -82,7 +63,19 @@ | |
| </create> | ||
| </allow> | ||
| </dwr> | ||
|
|
||
|
|
||
| <globalProperty> | ||
| <property>reportingcompatibility.patientLinkUrl</property> | ||
| <defaultValue>patientDashboard.form</defaultValue> | ||
| <description>The link url for a particular patient to view from the cohort builder</description> | ||
| </globalProperty> | ||
|
|
||
| <globalProperty> | ||
| <property>reportingcompatibility.data_export_batch_size</property> | ||
| <defaultValue>7500</defaultValue> | ||
| <description>The number of patients to export at a time in a data export. The larger this number the faster and more memory that is used. The smaller this number the slower and less memory is used.</description> | ||
| </globalProperty> | ||
|
|
||
| <servlet> | ||
| <servlet-name>dataExportServlet</servlet-name> | ||
| <servlet-class>org.openmrs.web.servlet.DataExportServlet</servlet-class> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiling against 2.1.0 is right (it's the first release with
RequirePrivilege), but the runtime half of this fix is openmrs/openmrs-module-legacyui#268, which isn't in any legacyui release yet. The 2.1.0DwrAuthorizationFilterbuilds its allowlist from legacyui's own config.xml only. I initialized the filter straight from the published 2.1.0 jar to check: 100 entries, all legacyui's own scripts, nothing from this module. So under legacyui 2.1.0 everyDWRCohortBuilderService.*call keeps returning the RCM-124 403 even with this merged, and the annotations added here are never read. Nothing to change in the code. I'd just record the minimum legacyui version in the ticket and in the release notes of whatever module release carries this, and hold that release until the legacyui side ships, so nobody upgrades against legacyui 2.1.0 expecting the cohort builder back.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually bumping the required version up to 2.2.0-SNAPSHOT @dkayiwa , just to ensure the fix is in and these endpoints work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good @mseaton. 2.2.0-SNAPSHOT does include the LUI-212 fix (openmrs/openmrs-module-legacyui#268 merged earlier today), so compiling against it guarantees the annotations and the filter line up. Two things worth keeping on the radar for release time:
The maven-release-plugin will refuse to release this module while
legacyuiVersionpoints at a SNAPSHOT, so a legacyui 2.2.0 release needs to be cut first and the property bumped to it. Conveniently, that also enforces the "hold this release until the legacyui side ships" part automatically.The pom bump only covers compile time. In config.xml, legacyui is still just an
<aware_of_module>with no version constraint, so nothing at runtime stops the module from starting against legacyui 2.1.0, where the DWR endpoints keep returning the 403. Since legacyui is deliberately optional here, I'd still record legacyui >= 2.2.0 in the RCM-124 ticket and the release notes.