tech5usa / TLSential

A server for providing short-lived TLS certificates to all services within a firewall restricted network.
GNU General Public License v3.0
15 stars 2 forks source link

Change response code for Super Admin request to 400 #80

Closed d1str0 closed 4 years ago

d1str0 commented 4 years ago

Context

Super Admins can only be created once unless the server is restarted with the "reset superadmin" flag set. If you were to make a follow up request to create a super admin when one already exists, the server returned 500 which is not meaningful.

Approach

Change response code to 400 for the error case of a SA already existing.

Testing

attempt to make 2 SAs