atsign-foundation / at_server

The software implementation of Atsign's core technology
https://docs.atsign.com
BSD 3-Clause "New" or "Revised" License
39 stars 13 forks source link

Add validation to prevent duplicate enrollment with existing appName and deviceName #1923

Closed sitaram-kalluri closed 2 months ago

sitaram-kalluri commented 2 months ago

Is your feature request related to a problem? Please describe.

  1. Currently, the secondary server lacks specific checks when processing new enrollments. It does not prevent new enrollments that share the same appName and deviceName with an existing one if the exisiting enrollment is in either an "approved" or "pending" state.
  2. There is no way for the client to fetch the enrollment information for the given enrollment Id.

Describe the solution you'd like

  1. When submitting a new enrollment, add validations on the server side, to throw an exception if an enrollment with the same appName and deviceName with the existing enrollment if the existing enrollment is either an approved or pending state.
  2. Add "enroll:fetch" to retrieve the enrollment information for the given enrollment id.