ES-2955 idrepo update identity workaround#193
Conversation
Signed-off-by: Nandhukumar <nandhukumare@gmail.com>
WalkthroughAdded a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can disable the changed files summary in the walkthrough.Disable the |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java (1)
386-388:⚠️ Potential issue | 🔴 CriticalConstructor call needs to be updated to work with the new
Passwordclass structure.Once
@NoArgsConstructoris added toPassword.java, update this method to use setters, or alternatively passnullas the third argument and setvalueafterward inbuildIdentityRequest.🐛 Proposed fix: Use setters with `@NoArgsConstructor`
if (!StringUtils.isEmpty(responseWrapper.getResponse().getHashValue()) && !StringUtils.isEmpty(responseWrapper.getResponse().getSalt())) { - return new Password(responseWrapper.getResponse().getHashValue(), - responseWrapper.getResponse().getSalt()); + Password password = new Password(); + password.setHash(responseWrapper.getResponse().getHashValue()); + password.setSalt(responseWrapper.getResponse().getSalt()); + return password; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java` around lines 386 - 388, The Password constructor call in IdrepoProfileRegistryPluginImpl (the return new Password(responseWrapper.getResponse().getHashValue(), responseWrapper.getResponse().getSalt())) no longer matches the updated Password class; replace it by creating a no-args Password instance and use the setters (e.g., setHashValue, setSalt, setValue) to populate fields, or if you prefer the alternative, call the constructor with a null third arg and ensure buildIdentityRequest sets the value afterward; update the code paths that consume this Password (including buildIdentityRequest) so they expect the fields to be set via setters rather than the old two-arg constructor.mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/dto/Password.java (1)
11-17:⚠️ Potential issue | 🔴 CriticalCompilation failure: Adding the
valuefield breaks existing 2-argument constructor calls.The pipeline failure confirms that
@AllArgsConstructornow generates only a 3-argument constructorPassword(String, String, String), but existing code ingenerateSaltedHash()(line 387-388) calls the 2-argument constructor.Add
@NoArgsConstructorto enable setter-based construction, or explicitly define a 2-argument constructor for backward compatibility.🐛 Proposed fix: Add `@NoArgsConstructor` for setter-based usage
import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; `@Data` `@AllArgsConstructor` +@NoArgsConstructor public class Password { private String hash; private String salt; private String value; // Added for compatible with 1.3.0 IDRepo🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/dto/Password.java` around lines 11 - 17, The new field `value` caused `@AllArgsConstructor` to only generate a 3-arg ctor which breaks existing 2-arg calls from generateSaltedHash(); fix by adding Lombok's `@NoArgsConstructor` to the Password class (above class declaration alongside `@Data` and `@AllArgsConstructor`) so callers can use setter-based construction, or alternatively add an explicit two-argument constructor Password(String hash, String salt) to preserve backward compatibility for generateSaltedHash().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java`:
- Line 487: The code calls password.getHashValue() which doesn't exist on
Password; instead use the Password.hash accessor and then the inner
PasswordHash.getHashValue(); update the logic in IdrepoProfileRegistryPluginImpl
where password.setValue(...) is called to retrieve the actual hash string via
password.getHash().getHashValue(), adding a null-check for password.getHash()
and handling the absent case appropriately before calling password.setValue;
keep the change localized to the password.setValue call site and ensure any
imports or null-safety follow project conventions.
---
Outside diff comments:
In
`@mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/dto/Password.java`:
- Around line 11-17: The new field `value` caused `@AllArgsConstructor` to only
generate a 3-arg ctor which breaks existing 2-arg calls from
generateSaltedHash(); fix by adding Lombok's `@NoArgsConstructor` to the Password
class (above class declaration alongside `@Data` and `@AllArgsConstructor`) so
callers can use setter-based construction, or alternatively add an explicit
two-argument constructor Password(String hash, String salt) to preserve backward
compatibility for generateSaltedHash().
In
`@mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java`:
- Around line 386-388: The Password constructor call in
IdrepoProfileRegistryPluginImpl (the return new
Password(responseWrapper.getResponse().getHashValue(),
responseWrapper.getResponse().getSalt())) no longer matches the updated Password
class; replace it by creating a no-args Password instance and use the setters
(e.g., setHashValue, setSalt, setValue) to populate fields, or if you prefer the
alternative, call the constructor with a null third arg and ensure
buildIdentityRequest sets the value afterward; update the code paths that
consume this Password (including buildIdentityRequest) so they expect the fields
to be set via setters rather than the old two-arg constructor.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d88c47b8-eec4-4d35-a865-645fdc666343
📒 Files selected for processing (2)
mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/dto/Password.javamosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java
...in/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Nandhukumar <nandhukumare@gmail.com>
* fix: idrepo update identity workaround Signed-off-by: Nandhukumar <nandhukumare@gmail.com> * ES-2955 | fix: idrepo update identity workaround Signed-off-by: Nandhukumar <nandhukumare@gmail.com> --------- Signed-off-by: Nandhukumar <nandhukumare@gmail.com>
* Update README.md (#187) Signed-off-by: Rajapandi M <138785181+rajapandi1234@users.noreply.github.com> * ES-2914 (#190) * ES-2914 Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> * Fixed review comments Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> * Fixed review comments Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> * Fixed review comments Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> * Fixed review comments Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> --------- Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> * ES-2914 (#191) * Fixed mock identity validation issue removed unnecessary configurations Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> * Removed unnecessary configurations Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> * Fixed review comment Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> * Fixed review comment Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> * Fixed review comments Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> --------- Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> * ES-2955 idrepo update identity workaround (#193) * fix: idrepo update identity workaround Signed-off-by: Nandhukumar <nandhukumare@gmail.com> * ES-2955 | fix: idrepo update identity workaround Signed-off-by: Nandhukumar <nandhukumare@gmail.com> --------- Signed-off-by: Nandhukumar <nandhukumare@gmail.com> * Corrected the property name (#194) Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> --------- Signed-off-by: Rajapandi M <138785181+rajapandi1234@users.noreply.github.com> Signed-off-by: ase-101 <sunkadaeanusha@gmail.com> Signed-off-by: Nandhukumar <nandhukumare@gmail.com> Co-authored-by: Rajapandi M <138785181+rajapandi1234@users.noreply.github.com> Co-authored-by: ase-101 <sunkadaeanusha@gmail.com> Co-authored-by: Nandhukumar <nandhukumare@gmail.com>
Summary by CodeRabbit