fix: supports null values for MEBX and MPSPasswords#753
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #753 +/- ##
==========================================
+ Coverage 39.78% 39.87% +0.09%
==========================================
Files 112 112
Lines 10580 10596 +16
==========================================
+ Hits 4209 4225 +16
+ Misses 6020 6016 -4
- Partials 351 355 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request modifies the device entity to support nullable values for MPSPassword and MEBXPassword fields, changing them from required string fields to optional pointer fields that can be null in the database.
Changes:
- Updated entity structure to use pointer types (*string) for MPSPassword and MEBXPassword fields
- Modified database schema in test files to remove NOT NULL constraints for these password columns
- Enhanced password handling logic to properly encrypt/decrypt nullable password fields
- Added comprehensive test coverage for scenarios with both nil and non-nil password values
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/entity/device.go | Changed MPSPassword and MEBXPassword from string to *string to support null values |
| internal/usecase/sqldb/device_test.go | Updated test database schema to remove NOT NULL constraints from password columns |
| internal/usecase/devices/usecase.go | Modified dtoToEntity and entityToDTO to handle nil pointer values during encryption/decryption |
| internal/usecase/devices/repo.go | Updated GetByID to safely dereference password pointers before decryption |
| internal/usecase/devices/repo_test.go | Added comprehensive tests for password handling including nil cases and added ptr helper function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fea3546 to
c747c7b
Compare
graikhel-intel
left a comment
There was a problem hiding this comment.
Looks good to me, I was able to load the devices page after upgrading from v1.15 using this fix.
|
🎉 This PR is included in version 1.18.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
No description provided.