Source code for luna_licenses.app.handlers.license_handler

# -*- coding: utf-8 -*-
"""License Handler

Module realize license handler.
"""

from sanic.response import HTTPResponse

from app.handlers.base_handler import BaseLicensesRequestHandler
from crutches_on_wheels.cow.utils.timer import timer


[docs]class LicenseHandler(BaseLicensesRequestHandler): """ Handler for getting license data Resource: "/{api_version}/license" """
[docs] @timer async def get(self) -> HTTPResponse: """ Get license, see `spec_get_license`_. .. _spec_get_license: _static/api.html#operation/getLicense Returns: Response with license data """ return self.successWithSignature(outputJson=self.app.ctx.licensing.license.asDict())