'Delete all tokens for a given domain.
It will delete all the project-scoped tokens for the projects
that are owned by the given domain, as well as any tokens issued
to users that are owned by this domain.
However, deletion of domain_scoped tokens will still need to be
implemented as stated in TODO below.'

def delete_tokens_for_domain(self, domain_id):

    if (not CONF.token.revoke_by_id):
        return
    projects = self.resource_api.list_projects()
    for project in projects:
        if (project['domain_id'] == domain_id):
            for user_id in self.assignment_api.list_user_ids_for_project(project['id']):
                self.delete_tokens_for_user(user_id, project['id'])
    users = self.identity_api.list_users(domain_id)
    user_ids = (user['id'] for user in users)
    self.delete_tokens_for_users(user_ids)
