aerospike-client-python icon indicating copy to clipboard operation
aerospike-client-python copied to clipboard

[CLIENT-2093] Validate values passed to client config and partition filter dictionaries

Open juliannguyen4 opened this issue 1 year ago • 1 comments

Valgrind

This branch: https://github.com/aerospike/aerospike-client-python/actions/runs/8104278566/job/22150570588 Dev: https://github.com/aerospike/aerospike-client-python/actions/runs/8103677912/job/22148781775

Changes

  • In client config, instead of silently ignoring values with invalid types, throw a ParamError
  • Throw a ParamError if client config option is specified as a 32-bit unsigned integer and the passed value is not a valid value of that type

Extra changes:

  • Fixed a bug where the client only takes in a str instead of a bytearray for the partition filter's digest at partition_filter["digest"]["value"]
  • If a host tuple's port is not an integer, throw a ParamError instead of setting it to 0.

Notes

  • Besides the changes listed above, I tried to avoid regressions wherever possible. If there was existing input validation for the setting, I didn't modify the code such that it returns a different error message.
  • No input validation added for deprecated / undocumented config options

juliannguyen4 avatar Feb 16 '24 22:02 juliannguyen4

Codecov Report

Attention: Patch coverage is 98.11321% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 81.79%. Comparing base (b72fcf2) to head (ad247db). Report is 2 commits behind head on dev.

Files Patch % Lines
src/main/tls_config.c 91.42% 3 Missing :warning:
src/main/convert_partition_filter.c 95.23% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #582      +/-   ##
==========================================
+ Coverage   81.39%   81.79%   +0.40%     
==========================================
  Files          98       98              
  Lines       14921    15075     +154     
==========================================
+ Hits        12145    12331     +186     
+ Misses       2776     2744      -32     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Feb 16 '24 23:02 codecov-commenter