Fix NPE when deprecated credential fields are null during conversion#51009
Fix NPE when deprecated credential fields are null during conversion#51009satyamkumarmishra2005 wants to merge 1 commit into
Conversation
Signed-off-by: Satyam Mishra <satyamkumarmishra2005@gmail.com>
06e7e8d to
e55bed5
Compare
|
Hi @satyamkumarmishra2005, thank you for the contribution and the thorough unit tests - the test coverage in your PR is excellent. We're going to go with the validation approach from PR #49316 instead. The Similarly, defaulting OTP parameters (digits/counter/period) risks silently creating credentials that don't match the user's authenticator configuration - they'd import fine but verification would fail with no clear indication why. Rejecting with a clear error is the safer path. Closing this as a duplicate - thank you for the contribution, and we hope you'll pick up another issue! |
Summary
This PR prevents a NullPointerException in
RepresentationToModel.convertDeprecatedCredentialsFormat()when deprecatedpassword or OTP credentials contain nullable
Integerfields that areauto-unboxed into primitive
intconstructor parameters.Changes
-1whenhashIterationsis absent.digits=6,counter=0,period=30) when thecorresponding fields are absent.
hashIterationsdigits,counter, andperiodRelated to #41640