mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
tweak webauthn rest errors
simplify logic by changing the dao function to require a user id and a webauthn cred id. Note that this changes the response from a 400 to a 404 if the cred is for a different user than the supplied id. give a minimum length to the text fields in POSTS to create/update a credential to avoid surprising unexpected edge cases involving empty string names etc.
This commit is contained in:
@@ -3,9 +3,9 @@ post_create_webauthn_credential_schema = {
|
||||
"description": "POST webauthn_credential schema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
"credential_data": {"type": "string"},
|
||||
"registration_response": {"type": "string"},
|
||||
"name": {"type": "string", "minLength": 1},
|
||||
"credential_data": {"type": "string", "minLength": 1},
|
||||
"registration_response": {"type": "string", "minLength": 1},
|
||||
},
|
||||
"required": ["name", "credential_data", "registration_response"],
|
||||
"additionalProperties": False
|
||||
@@ -16,7 +16,7 @@ post_update_webauthn_credential_schema = {
|
||||
"description": "POST update webauthn_credential schema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
"name": {"type": "string", "minLength": 1},
|
||||
},
|
||||
"required": ["name"],
|
||||
"additionalProperties": False
|
||||
|
||||
Reference in New Issue
Block a user