# Path: zoe_api/rest_api/request_handler.py
# class ZoeAPIRequestHandler(ZoeRequestHandler):
#     """RequestHandler class for Zoe Web interface."""
# 
#     def set_default_headers(self):
#         """Set up the headers for enabling CORS."""
#         self._manage_cors_headers()
# 
#     def _manage_cors_headers(self):
#         """Set up the headers for enabling CORS."""
#         if self.request.headers.get('Origin') is None:
#             self.set_header("Access-Control-Allow-Origin", "*")
#         else:
#             self.set_header("Access-Control-Allow-Origin", self.request.headers.get('Origin'))
#         self.set_header("Access-Control-Allow-Credentials", "true")
#         self.set_header("Access-Control-Allow-Headers", "x-requested-with, Content-Type, origin, authorization, accept, client-security-token")
#         self.set_header("Access-Control-Allow-Methods", "OPTIONS, GET, DELETE")
#         self.set_header("Access-Control-Max-Age", "1000")
# 
#     def options(self):
#         """Needed for CORS."""
#         self.set_status(204)
#         self.finish()
# 
#     def get_current_user(self):
#         """In case auth fails, redirect to login page."""
#         try:
#             user = super().get_current_user()
#         except ZoeException as e:
#             self.set_status(e.status_code, "Unauthorized access: {}".format(e))
#             return None
#         return user
# 
# Path: zoe_lib/config.py
# def get_conf() -> Namespace:
#     """Returns the conf singleton."""
#     return _CONF
# 
# Path: zoe_lib/version.py
# ZOE_API_VERSION = '0.7'
# 
# ZOE_APPLICATION_FORMAT_VERSION = 3
# 
# ZOE_VERSION = '2018.12'


from zoe_api.rest_api.request_handler import ZoeAPIRequestHandler
from zoe_lib.config import get_conf
from zoe_lib.version import ZOE_API_VERSION, ZOE_APPLICATION_FORMAT_VERSION, ZOE_VERSION
# Copyright (c) 2016, Daniele Venzano
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""The Info API endpoint."""





class InfoAPI(ZoeAPIRequestHandler):
    """The Info API endpoint."""

    def get(self):
        """HTTP GET method."""
        ret = {
            'version': ZOE_VERSION,

# Path: zoe_api/rest_api/request_handler.py
# class ZoeAPIRequestHandler(ZoeRequestHandler):
#     """RequestHandler class for Zoe Web interface."""
# 
#     def set_default_headers(self):
#         """Set up the headers for enabling CORS."""
#         self._manage_cors_headers()
# 
#     def _manage_cors_headers(self):
#         """Set up the headers for enabling CORS."""
#         if self.request.headers.get('Origin') is None:
#             self.set_header("Access-Control-Allow-Origin", "*")
#         else:
#             self.set_header("Access-Control-Allow-Origin", self.request.headers.get('Origin'))
#         self.set_header("Access-Control-Allow-Credentials", "true")
#         self.set_header("Access-Control-Allow-Headers", "x-requested-with, Content-Type, origin, authorization, accept, client-security-token")
#         self.set_header("Access-Control-Allow-Methods", "OPTIONS, GET, DELETE")
#         self.set_header("Access-Control-Max-Age", "1000")
# 
#     def options(self):
#         """Needed for CORS."""
#         self.set_status(204)
#         self.finish()
# 
#     def get_current_user(self):
#         """In case auth fails, redirect to login page."""
#         try:
#             user = super().get_current_user()
#         except ZoeException as e:
#             self.set_status(e.status_code, "Unauthorized access: {}".format(e))
#             return None
#         return user
# 
# Path: zoe_lib/config.py
# def get_conf() -> Namespace:
#     """Returns the conf singleton."""
#     return _CONF
# 
# Path: zoe_lib/version.py
# ZOE_API_VERSION = '0.7'
# 
# ZOE_APPLICATION_FORMAT_VERSION = 3
# 
# ZOE_VERSION = '2018.12'


# Path: zoe_api/rest_api/info.py
from zoe_api.rest_api.request_handler import ZoeAPIRequestHandler
from zoe_lib.config import get_conf
from zoe_lib.version import ZOE_API_VERSION, ZOE_APPLICATION_FORMAT_VERSION, ZOE_VERSION

# Copyright (c) 2016, Daniele Venzano
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""The Info API endpoint."""





class InfoAPI(ZoeAPIRequestHandler):
    """The Info API endpoint."""

    def get(self):
        """HTTP GET method."""
        ret = {
            'version': ZOE_VERSION,

            'api_version': ZOE_API_VERSION,