Altinn / altinn-notifications

Altinn platform microservice for handling notifications (mail, sms, etc)
MIT License
2 stars 3 forks source link

Improved handling of invalid mobile numbers #623

Closed hggutvik closed 1 month ago

hggutvik commented 1 month ago

Description

When placing notification orders where SMS is involved, mobile numbers that include invalid characters (like letters) now produces response code 400 instead of 500. Additionally, the general response for such invalid numbers is changed:

Affected endpoints:

The MobileNumberHelper class, used by Validators to perform number validation, now has a try/catch for when PhoneNumberUtil throws NumberParseException. These exceptions now result in the method IsValidMobileNumber returning false.

Related Issue(s)

Verification

Documentation

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud