from ocyan.main.loading import get_baseclass

BaseNonceNode = get_baseclass(
    "main.utils", "NonceNode", "ocyan.plugin.security.security_main_extension"
)


class NonceNode(BaseNonceNode):
    def render(self, context):
        request = context.get("request")
        return str(request.csp_nonce)
