jamf / scout-public

A tool to aggregate devices across multiple MDM servers
GNU General Public License v3.0
11 stars 3 forks source link

Better handling of Jamf Pro Server Re-Entry into Scout #2

Closed jacobschultz closed 4 years ago

jacobschultz commented 5 years ago

When adding and removing the same Jamf Pro Server to a single Scout instance multiple times, issues are often encountered re-adding that server. Most of the time it's because the ScoutAdmin user was not removed from the Jamf Pro Server before we re-added the server to Scout again.

Steps to Reproduce:

  1. Aquire a Jamf Pro Server and a scout instance
  2. Add the JPS to Scout
  3. Verify the 'ScoutAdmin' user was created in the JPS
  4. Delete the server from Scout
  5. Attempt to add the server again

Tasks:

  1. When adding a new JPS to scout, make another request to the JPS API Endpoint: /users/name/{name} where name is ScoutAdmin.
  2. If that user already exists, just update it with the new password generated.
  3. If the user doesn't exists, create it as normal.
  4. Make sure this check that the user exists happens before creating/updating the scout admin user.
  5. When a server is deleted, also delete the ScoutAdmin user from the Jamf Pro Server using the DELETE /users/name/ScoutAdmin endpoint.

Pull Request Ready When:

  1. Servers can be added and removed and added again without any errors.
  2. ScoutAdmin user is deleted from the server when it's deleted from scout

Resources: