'Return a dictionary of token properties to validate against.'

def generate_token_schema(self, domain_scoped=False, project_scoped=False):

    properties = {'audit_ids': {'type': 'array', 'items': {'type': 'string'}, 'minItems': 1, 'maxItems': 2}, 'bind': {'type': 'object', 'properties': {'kerberos': {'type': 'string'}}, 'required': ['kerberos'], 'additionalProperties': False}, 'expires_at': {'type': 'string', 'pattern': unit.TIME_FORMAT_REGEX}, 'issued_at': {'type': 'string', 'pattern': unit.TIME_FORMAT_REGEX}, 'methods': {'type': 'array', 'items': {'type': 'string'}}, 'user': {'type': 'object', 'required': ['id', 'name', 'domain', 'password_expires_at'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'domain': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}, 'required': ['id', 'name'], 'additonalProperties': False}, 'password_expires_at': {'type': ['string', 'null'], 'pattern': unit.TIME_FORMAT_REGEX}}, 'additionalProperties': False}}
    if domain_scoped:
        properties['catalog'] = {'type': 'array'}
        properties['roles'] = {'type': 'array', 'items': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}, 'required': ['id', 'name'], 'additionalProperties': False}, 'minItems': 1}
        properties['domain'] = {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}, 'additionalProperties': False}
    elif project_scoped:
        properties['is_admin_project'] = {'type': 'boolean'}
        properties['catalog'] = {'type': 'array'}
        properties['roles'] = {'type': 'array'}
        properties['is_domain'] = {'type': 'boolean'}
        properties['project'] = {'type': ['object'], 'required': ['id', 'name', 'domain'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'domain': {'type': ['object'], 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}
    schema = {'type': 'object', 'properties': properties, 'required': ['audit_ids', 'expires_at', 'issued_at', 'methods', 'user'], 'optional': ['bind'], 'additionalProperties': False}
    if domain_scoped:
        schema['required'].extend(['domain', 'roles'])
        schema['optional'].append('catalog')
    elif project_scoped:
        schema['required'].append('project')
        schema['optional'].append('catalog')
        schema['optional'].append('OS-TRUST:trust')
        schema['optional'].append('is_admin_project')
        schema['optional'].append('is_domain')
    return schema
