# Path: opennsa/shared/requestinfo.py
# class RequestInfo:
#     """
#     Holds various data about the request.
#     Somewhat adding things as we go.
#     """
#     def __init__(self, cert_subject=None, cert_host_dn=None):
#         self.cert_subject = cert_subject
#         self.cert_host_dn = cert_host_dn


from twisted.python import log
from opennsa.shared.requestinfo import RequestInfo
"""
HTTP request authorization

Author: Henrik Thostrup Jensen <htj@nordu.net>
Copyright: NORDUnet (2013-2016)
"""



LOG_SYSTEM='protocol.authZ'


def checkAuthz(request, allowed_hosts):
    # returns allowed, msg, request_info
    # not the best api in the world, but it works
    # msg is None if allowed, otherwise it contains the reson to relay to the client

    allowed = False
    msg = None

# Path: opennsa/shared/requestinfo.py
# class RequestInfo:
#     """
#     Holds various data about the request.
#     Somewhat adding things as we go.
#     """
#     def __init__(self, cert_subject=None, cert_host_dn=None):
#         self.cert_subject = cert_subject
#         self.cert_host_dn = cert_host_dn


# Path: opennsa/protocols/shared/requestauthz.py
from twisted.python import log
from opennsa.shared.requestinfo import RequestInfo

"""
HTTP request authorization

Author: Henrik Thostrup Jensen <htj@nordu.net>
Copyright: NORDUnet (2013-2016)
"""



LOG_SYSTEM='protocol.authZ'


def checkAuthz(request, allowed_hosts):
    # returns allowed, msg, request_info
    # not the best api in the world, but it works
    # msg is None if allowed, otherwise it contains the reson to relay to the client

    allowed = False
    msg = None

    request_info = RequestInfo()