6#ifndef EXPR_EVALUATOR_H
7#define EXPR_EVALUATOR_H
10#include <nlohmann/json.hpp>
11#include <dukglue/dukglue.h>
13#include "../utils/utils.h"
17 using TokenMap = std::unordered_map<std::string, nlohmann::json>;
25 [[nodiscard]] duk_context*
get()
const;
43 static bool eval(
const std::string& expr,
const std::unordered_map<std::string, nlohmann::json>& vars = {});
Definition expr_evaluator.h:19
duk_context * get() const
Definition expr_evaluator.cpp:17
DukCtx()
Definition expr_evaluator.cpp:7
~DukCtx()
Definition expr_evaluator.cpp:12
router.h
Definition auth.h:15
std::unordered_map< std::string, nlohmann::json > TokenMap
Definition expr_evaluator.h:17
Struct instance for handling evaluation of database access rules.
Definition expr_evaluator.h:35
static bool eval(const std::string &expr, const std::unordered_map< std::string, nlohmann::json > &vars={})
Evaluates a given expression in a context of the given TokenMap variables.
Definition expr_evaluator.cpp:19