atsign-foundation / at_protocol

The open source repository for the atProtocol specification and supporting documentation
https://docs.atsign.com
BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

pkam enrollment error code difference when enrollment is pending/denied #99

Closed murali-shris closed 1 year ago

murali-shris commented 1 year ago

Describe the bug

When enrollment is in pending/denied state, we get the same error code from server E.g error:AT0401-Exception: enrollment id: 8d2b8340-c47b-4886-828e-ac6b14e8165b is not approved

Add a different error code which will help to differentiate error for pending vs denied enrollment

Steps to reproduce

  1. Client which is in already enrolled state must be running. e.g https://gist.github.com/murali-shris/55d1d67a4510bed1363d811140592444
  2. Send a enroll request to server
  3. Running client denies the enrollment or takes no action
  4. Observe the error code when enrollment is i) pending ii)denied

Expected behavior