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

   ### Description
   
   Currently, the `listUsers` API response supports the `usersource` attribute, 
which represents the authentication source of users, such as `native`, `ldap`, 
`saml2` and `saml2disabled`.  However, it is neither possible to filter users 
by their authentication source nor to view this attribute in the users' list 
view.
   
   Therefore, this PR proposes to extend the `listUsers` API by introducing a 
new parameter called `usersource`, allowing callers to filter users by their 
authentication source. Furthermore, the UI has been enhanced to support this 
parameter in the search view and display the `usersource` attribute in the 
users' list view.
   
   ---
   
   Fixes #9932
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [X] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [X] Minor
   
   ### Screenshots (if appropriate):
   
   
![image](https://github.com/user-attachments/assets/891fee58-e59b-4bbe-ab8d-035b5ae7af4a)
   
   
![image](https://github.com/user-attachments/assets/3b8495b6-18a9-4456-8dc3-a44439274546)
   
   ### How Has This Been Tested?
   
   #### Through CloudMonkey
   - Verified that all users are listed when the `usersource` parameter is 
omitted.
   
   <details>
   <summary>
   <code>list users listall=true filter=account,username,usersource</code>
   </summary>
   
   ```bash
   (localcloud) 🐹 > list users listall=true filter=account,username,usersource
   {
     "count": 9,
     "user": [
       {
         "account": "admin",
         "username": "admin",
         "usersource": "native"
       },
       {
         "account": "baremetal-system-account",
         "username": "baremetal-system-account",
         "usersource": "native"
       },
       {
         "account": "admin",
         "username": "admin-kubeadmin",
         "usersource": "native"
       },
       {
         "account": "euler",
         "username": "euler",
         "usersource": "ldap"
       },
       {
         "account": "tesla",
         "username": "tesla",
         "usersource": "ldap"
       },
       {
         "account": "boyle",
         "username": "boyle",
         "usersource": "ldap"
       },
       {
         "account": "gauss",
         "username": "gauss",
         "usersource": "ldap"
       },
       {
         "account": "saml-u1",
         "username": "saml-u1",
         "usersource": "saml2"
       },
       {
         "account": "saml-u2",
         "username": "saml-u2",
         "usersource": "saml2"
       }
     ]
   }
   ```
   </details>
   
   - Verified that users are listed according to their source when the 
`usersource` parameter is specified. 
   
   <details>
   <summary>
   <code>list users listall=true filter=account,username,usersource 
usersource="ldap"</code>
   </summary>
   
   ```bash
   (localcloud) 🐲 > list users listall=true filter=account,username,usersource 
usersource="ldap"
   {
     "count": 4,
     "user": [
       {
         "account": "euler",
         "username": "euler",
         "usersource": "ldap"
       },
       {
         "account": "tesla",
         "username": "tesla",
         "usersource": "ldap"
       },
       {
         "account": "boyle",
         "username": "boyle",
         "usersource": "ldap"
       },
       {
         "account": "gauss",
         "username": "gauss",
         "usersource": "ldap"
       }
     ]
   }
   ```
   </details>
   
   - Verified that an error message is thrown when the `usersource` value is 
invalid.
   
   <details>
   <summary>
   <code>list users listall=true filter=account,username,usersource 
usersource="notValid"</code>
   </summary>
   
   ```bash
   (localcloud) 🐄 > list users listall=true filter=account,username,usersource 
usersource="notValid"
   🙈 Error: (HTTP 431, error code 4350) Invalid user source: notValid. Valid 
values are: native, ldap, saml2 and saml2disabled.
   ```
   
   </details>
   
   #### Through UI
   
   - Verified that the `usersource` is displayed in the users' list view:
   
   
![image](https://github.com/user-attachments/assets/891fee58-e59b-4bbe-ab8d-035b5ae7af4a)
   
   - Verified that the `usersource` search filter works as expected:
   
   
![image](https://github.com/user-attachments/assets/3b8495b6-18a9-4456-8dc3-a44439274546)
   


-- 
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