Add some registration validation
This commit is contained in:
parent
001a4b4ac5
commit
a2cf1d6b7b
2 changed files with 23 additions and 0 deletions
|
@ -90,6 +90,12 @@ func getRegistrationHandler(keyDir keydirectory.RegistrationDirectory) http.Hand
|
|||
return
|
||||
}
|
||||
|
||||
if !isValidKeyType(key) {
|
||||
fmt.Println("Attempted to register invalid key type")
|
||||
http.Error(w, "Invalid key type", 400)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Printf("Registering key for %s\n", request.UserId)
|
||||
|
||||
keyId, err := keyDir.RegisterKey(key, request.UserId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue