2017-11-03 09:51:50 +00:00
|
|
|
post_verify_code_schema = {
|
|
|
|
|
'$schema': 'http://json-schema.org/draft-04/schema#',
|
|
|
|
|
'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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
post_send_user_email_code_schema = {
|
|
|
|
|
'$schema': 'http://json-schema.org/draft-04/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 = {
|
|
|
|
|
'$schema': 'http://json-schema.org/draft-04/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
|
|
|
}
|