2017-11-03 09:51:50 +00:00
|
|
|
post_verify_code_schema = {
|
2022-04-08 17:05:59 +01:00
|
|
|
'$schema': 'http://json-schema.org/draft-07/schema#',
|
2017-11-03 09:51:50 +00:00
|
|
|
'description': 'POST schema for verifying a 2fa code',
|
|
|
|
|
'type': 'object',
|
|
|
|
|
'properties': {
|
|
|
|
|
'code': {'type': 'string'},
|
|
|
|
|
'code_type': {'type': 'string'},
|
|
|
|
|
},
|
2017-11-03 16:00:22 +00:00
|
|
|
'required': ['code', 'code_type'],
|
|
|
|
|
'additionalProperties': False
|
2017-11-03 09:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-05-17 20:32:01 +01:00
|
|
|
post_verify_webauthn_schema = {
|
2022-04-08 17:05:59 +01:00
|
|
|
'$schema': 'http://json-schema.org/draft-07/schema#',
|
2021-05-17 20:32:01 +01:00
|
|
|
'description': 'POST schema for verifying a webauthn login attempt',
|
|
|
|
|
'type': 'object',
|
|
|
|
|
'properties': {
|
|
|
|
|
'successful': {'type': 'boolean'}
|
|
|
|
|
},
|
|
|
|
|
'required': ['successful'],
|
|
|
|
|
'additionalProperties': False
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-11-03 09:51:50 +00:00
|
|
|
post_send_user_email_code_schema = {
|
2022-04-08 17:05:59 +01:00
|
|
|
'$schema': 'http://json-schema.org/draft-07/schema#',
|
2017-11-07 16:05:43 +00:00
|
|
|
'description': (
|
|
|
|
|
'POST schema for generating a 2fa email - "to" is required for legacy purposes. '
|
|
|
|
|
'"next" is an optional url to redirect to on sign in'
|
|
|
|
|
),
|
2017-11-03 09:51:50 +00:00
|
|
|
'type': 'object',
|
|
|
|
|
'properties': {
|
2017-11-03 16:00:22 +00:00
|
|
|
# doesn't need 'to' as we'll just grab user.email_address. but lets keep it
|
|
|
|
|
# as allowed to keep admin code cleaner, but only as null to prevent confusion
|
|
|
|
|
'to': {'type': 'null'},
|
2018-02-09 14:16:10 +00:00
|
|
|
'email_auth_link_host': {'type': ['string', 'null']},
|
2017-11-03 09:51:50 +00:00
|
|
|
'next': {'type': ['string', 'null']},
|
|
|
|
|
},
|
|
|
|
|
'required': [],
|
2017-11-03 16:00:22 +00:00
|
|
|
'additionalProperties': False
|
2017-11-03 09:51:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
post_send_user_sms_code_schema = {
|
2022-04-08 17:05:59 +01:00
|
|
|
'$schema': 'http://json-schema.org/draft-07/schema#',
|
2017-11-07 16:05:43 +00:00
|
|
|
'description': 'POST schema for generating a 2fa sms',
|
2017-11-03 09:51:50 +00:00
|
|
|
'type': 'object',
|
|
|
|
|
'properties': {
|
|
|
|
|
'to': {'type': ['string', 'null']},
|
|
|
|
|
},
|
|
|
|
|
'required': [],
|
2017-11-03 16:00:22 +00:00
|
|
|
'additionalProperties': False
|
2017-11-03 09:51:50 +00:00
|
|
|
}
|
2019-02-22 11:26:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
post_set_permissions_schema = {
|
|
|
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
|
|
|
"description": "POST schema for setting user permissions",
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"permissions": {"type": "array", "items": {"type": "object"}},
|
|
|
|
|
"folder_permissions": {"type": "array", "items": {"type": "string"}}
|
|
|
|
|
},
|
|
|
|
|
"required": ["permissions"],
|
|
|
|
|
"additionalProperties": False
|
|
|
|
|
}
|