Add multiple license support (#618)

Make license info available through LicenseChecker
Add LicenseInfoSender
Move license library from utils
Rename telemetry_lib to mg-telemetry
This commit is contained in:
Jure Bajic
2022-11-04 15:23:43 +01:00
committed by GitHub
parent 2a2b99b02a
commit ff21c0705c
41 changed files with 834 additions and 364 deletions

View File

@@ -20,11 +20,11 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "license/license.hpp"
#include "query/context.hpp"
#include "query/exceptions.hpp"
#include "query/interpret/frame.hpp"
#include "query/plan/operator.hpp"
#include "utils/license.hpp"
#include "query_plan_common.hpp"
#include "storage/v2/id_types.hpp"
@@ -80,7 +80,7 @@ TEST(QueryPlan, CreateNodeWithAttributes) {
#ifdef MG_ENTERPRISE
TEST(QueryPlan, FineGrainedCreateNodeWithAttributes) {
memgraph::utils::license::global_license_checker.EnableTesting();
memgraph::license::global_license_checker.EnableTesting();
memgraph::query::AstStorage ast;
memgraph::query::SymbolTable symbol_table;
memgraph::storage::Storage db;
@@ -164,7 +164,7 @@ TEST(QueryPlan, CreateReturn) {
#ifdef MG_ENTERPRISE
TEST(QueryPlan, FineGrainedCreateReturn) {
memgraph::utils::license::global_license_checker.EnableTesting();
memgraph::license::global_license_checker.EnableTesting();
// test CREATE (n:Person {age: 42}) RETURN n, n.age
memgraph::storage::Storage db;
@@ -310,7 +310,7 @@ class CreateExpandWithAuthFixture : public testing::Test {
AstStorage storage;
SymbolTable symbol_table;
void SetUp() override { memgraph::utils::license::global_license_checker.EnableTesting(); }
void SetUp() override { memgraph::license::global_license_checker.EnableTesting(); }
void ExecuteCreateExpand(bool cycle, memgraph::auth::User &user) {
const auto label_node_1 = dba.NameToLabel("Node1");
@@ -470,7 +470,7 @@ class MatchCreateNodeWithAuthFixture : public testing::Test {
AstStorage storage;
SymbolTable symbol_table;
void SetUp() override { memgraph::utils::license::global_license_checker.EnableTesting(); }
void SetUp() override { memgraph::license::global_license_checker.EnableTesting(); }
void InitGraph() {
// add three nodes we'll match and expand-create from
@@ -600,7 +600,7 @@ class MatchCreateExpandWithAuthFixture : public testing::Test {
AstStorage storage;
SymbolTable symbol_table;
void SetUp() override { memgraph::utils::license::global_license_checker.EnableTesting(); }
void SetUp() override { memgraph::license::global_license_checker.EnableTesting(); }
void InitGraph() {
// add three nodes we'll match and expand-create from
@@ -818,7 +818,7 @@ class DeleteOperatorWithAuthFixture : public testing::Test {
AstStorage storage;
SymbolTable symbol_table;
void SetUp() override { memgraph::utils::license::global_license_checker.EnableTesting(); }
void SetUp() override { memgraph::license::global_license_checker.EnableTesting(); }
void InitGraph() {
std::vector<memgraph::query::VertexAccessor> vertices;
@@ -1253,7 +1253,7 @@ TEST(QueryPlan, SetLabels) {
#ifdef MG_ENTERPRISE
TEST(QueryPlan, SetLabelsWithFineGrained) {
memgraph::utils::license::global_license_checker.EnableTesting();
memgraph::license::global_license_checker.EnableTesting();
auto set_labels = [&](memgraph::auth::User user, memgraph::query::DbAccessor dba,
std::vector<memgraph::storage::LabelId> labels) {
ASSERT_TRUE(dba.InsertVertex().AddLabel(labels[0]).HasValue());
@@ -1426,7 +1426,7 @@ TEST(QueryPlan, RemoveLabels) {
#ifdef MG_ENTERPRISE
TEST(QueryPlan, RemoveLabelsFineGrainedFiltering) {
memgraph::utils::license::global_license_checker.EnableTesting();
memgraph::license::global_license_checker.EnableTesting();
auto remove_labels = [&](memgraph::auth::User user, memgraph::query::DbAccessor dba,
std::vector<memgraph::storage::LabelId> labels) {
auto v1 = dba.InsertVertex();
@@ -1896,7 +1896,7 @@ class UpdatePropertiesWithAuthFixture : public testing::Test {
const memgraph::storage::PropertyId edge_prop{dba.NameToProperty(edge_prop_name)};
const memgraph::storage::PropertyValue edge_prop_value{1};
void SetUp() override { memgraph::utils::license::global_license_checker.EnableTesting(); }
void SetUp() override { memgraph::license::global_license_checker.EnableTesting(); }
void SetVertexProperty(memgraph::query::VertexAccessor vertex) {
static_cast<void>(vertex.SetProperty(entity_prop, entity_prop_value));