Damans227 opened a new pull request, #14866:
URL: https://github.com/apache/cloudstack/pull/14866

   Fixes #14865
   
   A wrong username or password on the legacy FlashArray login shows 
"Unexpected HTTP response code ... [400]", because the array answers 400 with 
{"msg": "invalid credentials"} and only 401 and 403 were treated as a login 
failure. This treats 400 the same way and includes the array's own message.
   
   ### Test:
   
   Run the 4.22 FlashArrayAdapter login against a FlashArray (Purity//FA 
6.10.6) with a wrong password, then the right one.
   
   **Before:**
   
       login failed: Unexpected HTTP response code from FlashArray 
[https://10.23.26.50:443/api] - [400] - Bad Request
   
   **After:**
   
       login failed: Authentication to FlashArray [https://10.23.26.50:443/api] 
with user [pureuser] failed, check the username and password configured for 
this storage pool (HTTP 400: {"msg": "invalid credentials"})
       login ok    (right password)
   
   What the array returns for each case:
   
       wrong password  {"msg": "invalid credentials"} -> HTTP 400
       wrong user      {"msg": "invalid credentials"} -> HTTP 400
       right password  HTTP 200
   
   
![array-400](https://raw.githubusercontent.com/Damans227/cloudstack/flasharray-login-error-screenshots/array-400.png)
   
![login-before-after](https://raw.githubusercontent.com/Damans227/cloudstack/flasharray-login-error-screenshots/login-before-after.png)
   
   Also added unit tests for the message.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to