# Path: huacaya/auth/exception.py
# class RegisterError(Exception):
#     pass
# 
# class AuthorizationError(Exception):
#     pass


import datetime
import re
from uuid import uuid4
from base64 import b32encode
from .exception import RegisterError, AuthorizationError
    from urlparse import urlparse
    from urllib.parse import urlparse
    def authorization_request(self, account_ident, client_id, redirect_uri=None, scope=None):
        return self._server.authorization_request(account_ident, client_id, redirect_uri, scope)

    def verify_authorization_code(self, authorization_code):
        return self._server.verify_authorization_code(authorization_code)

    def authorization_code_grant(self, authorization_code, client_id, redirect_uri=None):
        return self._server.authorization_code_grant(authorization_code, client_id, redirect_uri)

    def verify_token(self, token):
        return self._server.verify_token(token)

    def verify_scope(self, access_token, scope):
        return self._server.verify_scope(access_token, scope)

    def refresh_token_grant(self, refresh_token):
        return self._server.refresh_token_grant(refresh_token)

    def implicit_grant(self, account_ident, client_id, redirect_uri=None, scope=None):
        return self._server.implicit_grant(account_ident, client_id, redirect_uri, scope)

    def password_grant(self, account_ident, credentials, scope=None):
        return self._server.password_grant(account_ident, credentials, scope)

class Server(object):
    def __init__(self, dao=None):
        self._dao = dao

    def register_client(self, client_id, **kwds):
        if self._dao.has_client_id(client_id):

# Path: huacaya/auth/exception.py
# class RegisterError(Exception):
#     pass
# 
# class AuthorizationError(Exception):
#     pass


# Path: huacaya/auth/auth.py
import datetime
import re
from uuid import uuid4
from base64 import b32encode
from .exception import RegisterError, AuthorizationError
    from urlparse import urlparse
    from urllib.parse import urlparse

    def authorization_request(self, account_ident, client_id, redirect_uri=None, scope=None):
        return self._server.authorization_request(account_ident, client_id, redirect_uri, scope)

    def verify_authorization_code(self, authorization_code):
        return self._server.verify_authorization_code(authorization_code)

    def authorization_code_grant(self, authorization_code, client_id, redirect_uri=None):
        return self._server.authorization_code_grant(authorization_code, client_id, redirect_uri)

    def verify_token(self, token):
        return self._server.verify_token(token)

    def verify_scope(self, access_token, scope):
        return self._server.verify_scope(access_token, scope)

    def refresh_token_grant(self, refresh_token):
        return self._server.refresh_token_grant(refresh_token)

    def implicit_grant(self, account_ident, client_id, redirect_uri=None, scope=None):
        return self._server.implicit_grant(account_ident, client_id, redirect_uri, scope)

    def password_grant(self, account_ident, credentials, scope=None):
        return self._server.password_grant(account_ident, credentials, scope)

class Server(object):
    def __init__(self, dao=None):
        self._dao = dao

    def register_client(self, client_id, **kwds):
        if self._dao.has_client_id(client_id):

            raise RegisterError('client_id have been registered.')