Fix validation of REST array parameters.#1768
Merged
aaronweeden merged 2 commits intoDec 11, 2023
Merged
Conversation
This was referenced Aug 31, 2023
6 tasks
7bfda44 to
afbc7e5
Compare
49064e0 to
f4d5652
Compare
4ddeb41 to
cd86575
Compare
cd86575 to
3b2f8d0
Compare
3b2f8d0 to
17b944f
Compare
b4f7f2b to
ada284d
Compare
b673a8a to
ce0f619
Compare
ce0f619 to
d4dedd6
Compare
eiffel777
approved these changes
Dec 11, 2023
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.
Description
This PR fixes a bug in the validation of REST parameters in the
getParam()method ofBaseControllerProviderin which array parameters were not properly caught as being invalid.filter_var()was returningfalsebut only being checked fornull.This PR also fixes a bug in
XdmodApplicationFactorywith processing array POST data that was exposed when testing the bug above; if non-string data was sent in a POST, it would still attempt tojson_decodeit. Now, instead, it decodes that data as null.This PR also adds the ability to make
PUTrequests withXdmodTestHelper, which is needed by ubccr/xdmod-appkernels#95.Tests performed
This PR adds integration tests of array parameters for endpoints that call
getParam().Additional integration tests are added in ubccr/xdmod-appkernels#95 and ubccr/xdmod-supremm#350.
I developed the tests incrementally while running in the
tools-ext-01.ccr.xdmod.org/xdmod10.0:rockylinux8.5-0.5Docker container upgraded to the latest XDMoD.Also, in a Docker container running
tools-ext-01.ccr.xdmod.org/xdmod-10.5.0-x86_64:rockylinux8.5-0.3:/before.txtand/after.txtand make sure the differences are correct:ControllerTest::testEnumTargetAddresses.MetricExplorerTest::testCreateQueryParamValidation.MetricExplorerTest::testUpdateQueryByIdParamValidation.UserControllerProviderTest::testUpdateCurrentUser.AuthenticationControllerProviderTest::testGetIdpRedirect.DashboardControllerProviderTest::testSetLayout.DashboardControllerProviderTest::testGetStatisticsParamValidation.WarehouseControllerProviderTest::testCreateSearchHistory.WarehouseControllerProviderTest::testGetHistoryById.WarehouseControllerProviderTest::testUpdateHistory.WarehouseControllerProviderTest::testDeleteHistory.WarehouseControllerProviderTest::testDeleteAllHistory.WarehouseControllerProviderTest::testGetDimensions.WarehouseExportControllerProviderTest::testCreateRequestParamValidation.AdminControllerProviderTest::testResetUserTourViewed.DashboardControllerProviderTest::testSetViewedUserTour.WarehouseControllerProviderTest::testGetSearchHistory.WarehouseControllerProviderTest::testSearchJobs.WarehouseControllerProviderTest::testSearchJobsByPeers.WarehouseControllerProviderTest::testSearchJobsByTimeseries.WarehouseControllerProviderTest::testGetAggregateDataMalformedRequests.WarehouseControllerProviderTest::testGetDimensionValues.WarehouseControllerProviderTest::testGetRawData.Checklist: