1
0
Fork 0

issue 458.1: move SystemDatabaseFeature from IResearch to RestServer (#6260)

* issue 458.1: move SystemDatabaseFeature from IResearch to RestServer

* Add modified tests.
This commit is contained in:
Vasiliy 2018-08-28 10:48:09 +03:00 committed by Jan
parent 0a73e64b0b
commit 953027ba63
49 changed files with 889 additions and 257 deletions

View File

@ -75,7 +75,6 @@ if (USE_IRESEARCH)
IResearch/IResearchDocument.cpp IResearch/IResearchDocument.h
IResearch/IResearchFilterFactory.cpp IResearch/IResearchFilterFactory.h
IResearch/IResearchOrderFactory.cpp IResearch/IResearchOrderFactory.h
IResearch/SystemDatabaseFeature.cpp IResearch/SystemDatabaseFeature.h
IResearch/VelocyPackHelper.cpp IResearch/VelocyPackHelper.h
IResearch/ExpressionFilter.cpp IResearch/ExpressionFilter.h
IResearch/AqlHelper.cpp IResearch/AqlHelper.h
@ -466,6 +465,7 @@ SET(ARANGOD_SOURCES
RestServer/ScriptFeature.cpp
RestServer/ServerFeature.cpp
RestServer/ServerIdFeature.cpp
RestServer/SystemDatabaseFeature.cpp RestServer/SystemDatabaseFeature.h
RestServer/TransactionManagerFeature.cpp
RestServer/TraverserEngineRegistryFeature.cpp
RestServer/UpgradeFeature.cpp

View File

@ -35,13 +35,13 @@
#include "ApplicationServerHelper.h"
#include "IResearchAnalyzerFeature.h"
#include "IResearchCommon.h"
#include "SystemDatabaseFeature.h"
#include "VelocyPackHelper.h"
#include "Aql/AqlFunctionFeature.h"
#include "Basics/StaticStrings.h"
#include "Cluster/ServerState.h"
#include "Logger/LogMacros.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "StorageEngine/StorageEngine.h"
#include "Transaction/StandaloneContext.h"
@ -254,9 +254,9 @@ void ensureConfigCollection(TRI_vocbase_t& vocbase) {
////////////////////////////////////////////////////////////////////////////////
/// @brief return a pointer to the system database or nullptr on error
////////////////////////////////////////////////////////////////////////////////
arangodb::iresearch::SystemDatabaseFeature::ptr getSystemDatabase() {
arangodb::SystemDatabaseFeature::ptr getSystemDatabase() {
auto* database = arangodb::application_features::ApplicationServer::lookupFeature<
arangodb::iresearch::SystemDatabaseFeature
arangodb::SystemDatabaseFeature
>();
if (!database) {
@ -1239,4 +1239,4 @@ NS_END // arangodb
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2017 ArangoDB GmbH, Cologne, Germany
/// Copyright 2018 ArangoDB GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
@ -21,19 +21,19 @@
/// @author Vasiliy Nabatchikov
////////////////////////////////////////////////////////////////////////////////
#include "IResearchCommon.h"
#include "DatabaseFeature.h"
#include "Logger/LogMacros.h"
#include "RestServer/DatabaseFeature.h"
#include "VocBase/vocbase.h"
#include "SystemDatabaseFeature.h"
namespace {
static std::string const FEATURE_NAME("SystemDatabase");
static std::string const FEATURE_NAME("SystemDatabase");
}
namespace arangodb {
namespace iresearch {
void SystemDatabaseFeature::VocbaseReleaser::operator()(TRI_vocbase_t* ptr) {
if (ptr) {
@ -42,11 +42,11 @@ void SystemDatabaseFeature::VocbaseReleaser::operator()(TRI_vocbase_t* ptr) {
}
SystemDatabaseFeature::SystemDatabaseFeature(
arangodb::application_features::ApplicationServer& server,
application_features::ApplicationServer& server,
TRI_vocbase_t* vocbase /*= nullptr*/
): ApplicationFeature(server, SystemDatabaseFeature::name()),
_vocbase(vocbase) {
startsAfter("V8Phase");
startsAfter("Database");
}
/*static*/ std::string const& SystemDatabaseFeature::name() noexcept {
@ -54,18 +54,18 @@ SystemDatabaseFeature::SystemDatabaseFeature(
}
void SystemDatabaseFeature::start() {
auto* databases = arangodb::application_features::ApplicationServer::lookupFeature<
auto* feature = application_features::ApplicationServer::lookupFeature<
arangodb::DatabaseFeature
>("Database");
if (databases) {
_vocbase.store(databases->systemDatabase());
if (feature) {
_vocbase.store(feature->systemDatabase());
return;
}
LOG_TOPIC(WARN, arangodb::iresearch::TOPIC)
<< "failure to find feature 'Database' while starting SystemDatabaseFeature";
LOG_TOPIC(WARN, arangodb::Logger::FIXME)
<< "failure to find feature 'Database' while starting feature '" << FEATURE_NAME << "'";
FATAL_ERROR_EXIT();
}
@ -79,7 +79,6 @@ SystemDatabaseFeature::ptr SystemDatabaseFeature::use() const {
return ptr(vocbase && vocbase->use() ? vocbase : nullptr);
}
} // iresearch
} // arangodb
// -----------------------------------------------------------------------------

View File

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2017 ArangoDB GmbH, Cologne, Germany
/// Copyright 2018 ArangoDB GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
@ -21,22 +21,21 @@
/// @author Vasiliy Nabatchikov
////////////////////////////////////////////////////////////////////////////////
#ifndef ARANGOD_IRESEARCH__SYSTEM_DATABASE_FEATURE_H
#define ARANGOD_IRESEARCH__SYSTEM_DATABASE_FEATURE_H 1
#ifndef ARANGOD_RESTSERVER__SYSTEM_DATABASE_FEATURE_H
#define ARANGOD_RESTSERVER__SYSTEM_DATABASE_FEATURE_H 1
#include "ApplicationFeatures/ApplicationFeature.h"
struct TRI_vocbase_t; // forward declaration
namespace arangodb {
namespace iresearch {
////////////////////////////////////////////////////////////////////////////////
/// @brief a flexible way to get at the system vocbase
/// can be used for for persisting configuration
/// can be used for persisting configuration
////////////////////////////////////////////////////////////////////////////////
class SystemDatabaseFeature final:
public arangodb::application_features::ApplicationFeature {
public application_features::ApplicationFeature {
public:
struct VocbaseReleaser {
void operator()(TRI_vocbase_t* ptr);
@ -44,9 +43,10 @@ class SystemDatabaseFeature final:
typedef std::unique_ptr<TRI_vocbase_t, VocbaseReleaser> ptr;
SystemDatabaseFeature(
arangodb::application_features::ApplicationServer& server,
application_features::ApplicationServer& server,
TRI_vocbase_t* vocbase = nullptr
);
static std::string const& name() noexcept;
void start() override;
void stop() override;
@ -56,7 +56,6 @@ class SystemDatabaseFeature final:
std::atomic<TRI_vocbase_t*> _vocbase; // cached pointer to the system database
};
} // iresearch
} // arangodb
#endif

View File

@ -86,6 +86,7 @@
#include "RestServer/ScriptFeature.h"
#include "RestServer/ServerFeature.h"
#include "RestServer/ServerIdFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TransactionManagerFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "RestServer/UpgradeFeature.h"
@ -111,7 +112,6 @@
#ifdef USE_IRESEARCH
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#endif
// storage engines
@ -209,6 +209,7 @@ static int runServer(int argc, char** argv, ArangoGlobalContext &context) {
server.addFeature(new SslFeature(server));
server.addFeature(new StatisticsFeature(server));
server.addFeature(new StorageEngineFeature(server));
server.addFeature(new SystemDatabaseFeature(server));
server.addFeature(new TempFeature(server, name));
server.addFeature(new TransactionManagerFeature(server));
server.addFeature(new TraverserEngineRegistryFeature(server));
@ -239,7 +240,6 @@ static int runServer(int argc, char** argv, ArangoGlobalContext &context) {
#ifdef USE_IRESEARCH
server.addFeature(new arangodb::iresearch::IResearchAnalyzerFeature(server));
server.addFeature(new arangodb::iresearch::IResearchFeature(server));
server.addFeature(new arangodb::iresearch::SystemDatabaseFeature(server));
#endif
// storage engines

View File

@ -41,6 +41,7 @@ const rightLevels = helper.rightLevels;
const testViewName = `${namePrefix}ViewNew`;
const testViewType = "arangosearch";
const testColName = `${namePrefix}ColNew`;
const testColNameAnother = `${namePrefix}ColAnotherNew`;
const userSet = helper.userSet;
const systemLevel = helper.systemLevel;
@ -165,6 +166,29 @@ function hasIResearch (db) {
helper.switchUser(name, dbName);
};
const rootGetViewProps = (viewName, switchBack = true) => {
helper.switchUser('root', dbName);
let properties = db._view(viewName).properties();
if (switchBack) {
helper.switchUser(name, dbName);
}
return properties;
};
const rootGrantCollection = (colName, user, explicitRight = '') => {
if (rootTestCollection(colName, false)) {
if (explicitRight !== '' && rightLevels.includes(explicitRight))
{
if (helper.isLdapEnabledExternal()) {
users.grantCollection(':role:' + user, dbName, colName, explicitRight);
} else {
users.grantCollection(user, dbName, colName, explicitRight);
}
}
}
helper.switchUser(user, dbName);
};
const checkError = (e) => {
expect(e.code).to.equal(403, "Expected to get forbidden REST error code, but got another one");
expect(e.errorNum).to.oneOf([errors.ERROR_FORBIDDEN.code, errors.ERROR_ARANGO_READ_ONLY.code], "Expected to get forbidden error number, but got another one");
@ -173,7 +197,6 @@ function hasIResearch (db) {
describe('create a', () => {
before(() => {
db._useDatabase(dbName);
rootDropView(testViewName);
});
after(() => {
@ -181,8 +204,9 @@ function hasIResearch (db) {
rootDropCollection(testColName);
});
it('view', () => {
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
it('view with empty (default) parameters', () => {
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view exists');
if (dbLevel['rw'].has(name)) {
db._createView(testViewName, testViewType, {});
expect(rootTestView(testViewName)).to.equal(true, 'View creation reported success, but view was not found afterwards');
@ -197,23 +221,44 @@ function hasIResearch (db) {
}
});
it('view with links to existing collections', () => {
it('view with non-empty parameters (except links)', () => {
rootDropView(testViewName);
rootDropCollection(testColName);
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
if (dbLevel['rw'].has(name)) {
db._createView(testViewName, testViewType, { cleanupIntervalStep: 20 });
expect(rootTestView(testViewName)).to.equal(true, 'View creation reported success, but view was not found afterwards');
expect(rootGetViewProps(testViewName, true)["cleanupIntervalStep"]).to.equal(20, 'View creation reported success, but view property was not set as expected during creation');
} else {
try {
db._createView(testViewName, testViewType, { cleanupIntervalStep: 20 });
} catch (e) {
checkError(e);
return;
}
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
}
});
// FIXME: uncomment after PR 6199 is done with respectful changes
/*
it('view with links to existing collection', () => {
rootDropView(testViewName);
rootDropCollection(testColName);
rootCreateCollection(testColName);
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
expect(rootTestCollection(testColName)).to.equal(true, 'Precondition failed, the collection still not exists');
let view;
if (dbLevel['rw'].has(name) && colLevel['rw'].has(name)) {
view = db._createView(testViewName, testViewType, {});
view.properties({ links: { [testColName]: { includeAllFields: true } } }, true);
if (dbLevel['rw'].has(name) && colLevel['rw'].has(name) || colLevel['ro'].has(name)) {
db._createView(testViewName, testViewType, { links: { [testColName]: { includeAllFields: true } } });
expect(rootTestView(testViewName)).to.equal(true, 'View creation reported success, but view was not found afterwards');
expect(rootTestViewHasLinks(testViewName, [`${testColName}`])).to.equal(true, 'View links expected to be visible, but were not found afterwards');
} else {
try {
view = db._createView(testViewName, testViewType, {});
view.properties({ links: { [testColName]: { includeAllFields: true } } }, true);
db._createView(testViewName, testViewType, { links: { [testColName]: { includeAllFields: true } } });
} catch (e) {
checkError(e);
return;
@ -223,6 +268,107 @@ function hasIResearch (db) {
}
}
});
it('view with links to multiple collections with same access level', () => {
rootDropView(testViewName);
rootDropCollection(testColName);
rootCreateCollection(testColName);
rootCreateCollection(testColNameAnother);
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
expect(rootTestCollection(testColName)).to.equal(true, 'Precondition failed, the collection still not exists');
expect(rootTestCollection(testColNameAnother)).to.equal(true, 'Precondition failed, the collection still not exists');
if (dbLevel['rw'].has(name) && colLevel['rw'].has(name) || colLevel['ro'].has(name)) {
db._createView(testViewName, testViewType, { links: {
[testColName]: { includeAllFields: true }, [testColNameAnother]: { includeAllFields: true }
}
});
expect(rootTestView(testViewName)).to.equal(true, 'View creation reported success, but view was not found afterwards');
expect(rootTestViewHasLinks(testViewName, [`${testColName}`, `${testColNameAnother}`])).to.equal(true, 'View links expected to be visible, but were not found afterwards');
} else {
try {
db._createView(testViewName, testViewType, { links: {
[testColName]: { includeAllFields: true }, [testColNameAnother]: { includeAllFields: true }
}
});
} catch (e) {
checkError(e);
return;
}
if(!dbLevel['rw'].has(name)) {
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
}
}
});
var itName = 'view with links to multiple collections with RO access level to one of them';
!(colLevel['rw'].has(name) || colLevel['none'].has(name)) ? it.skip(itName) :
it(itName, () => {
rootDropView(testViewName);
rootDropCollection(testColName);
rootDropCollection(testColNameAnother);
rootCreateCollection(testColName);
rootCreateCollection(testColNameAnother);
rootGrantCollection(testColNameAnother, name, "ro");
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
expect(rootTestCollection(testColName)).to.equal(true, 'Precondition failed, the collection still not exists');
expect(rootTestCollection(testColNameAnother)).to.equal(true, 'Precondition failed, the collection still not exists');
if (dbLevel['rw'].has(name) && colLevel['rw'].has(name)) {
db._createView(testViewName, testViewType, { links: {
[testColName]: { includeAllFields: true }, [testColNameAnother]: { includeAllFields: true }
}
});
expect(rootTestView(testViewName)).to.equal(true, 'View creation reported success, but view was not found afterwards');
expect(rootTestViewHasLinks(testViewName, [`${testColName}`, `${testColNameAnother}`])).to.equal(true, 'View links expected to be visible, but were not found afterwards');
} else {
try {
db._createView(testViewName, testViewType, { links: {
[testColName]: { includeAllFields: true }, [testColNameAnother]: { includeAllFields: true }
}
});
} catch (e) {
checkError(e);
return;
}
if(!dbLevel['rw'].has(name)) {
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
}
}
});
var itName = 'view with links to multiple collections with NONE access level to one of them';
!(colLevel['rw'].has(name) || colLevel['ro'].has(name)) ? it.skip(itName) :
it(itName, () => {
rootDropView(testViewName);
rootDropCollection(testColName);
rootDropCollection(testColNameAnother);
rootCreateCollection(testColName);
rootCreateCollection(testColNameAnother);
rootGrantCollection(testColNameAnother, name, "none");
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
expect(rootTestCollection(testColName)).to.equal(true, 'Precondition failed, the collection still not exists');
expect(rootTestCollection(testColNameAnother)).to.equal(true, 'Precondition failed, the collection still not exists');
if (dbLevel['rw'].has(name)) {
try {
db._createView(testViewName, testViewType, { links: {
[testColName]: { includeAllFields: true }, [testColNameAnother]: { includeAllFields: true }
}
});
} catch (e) {
checkError(e);
return;
}
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
});
*/
});
});
});

View File

@ -234,7 +234,7 @@ function hasIResearch (db) {
rootCreateCollection(testCol1Name);
rootCreateView(testViewName, { links: { [testCol1Name]: { includeAllFields: true } } });
expect(rootTestView(testViewName)).to.equal(true, 'Precondition failed, the view doesn not exist');
if (dbLevel['rw'].has(name) && colLevel['rw'].has(name)) {
if (dbLevel['rw'].has(name) && (colLevel['rw'].has(name) || colLevel['ro'].has(name))) {
db._dropView(testViewName);
expect(rootTestView(testViewName)).to.equal(false, 'View deletion reported success, but view was found afterwards');
} else {
@ -243,12 +243,15 @@ function hasIResearch (db) {
} catch (e) {
checkError(e);
return;
} finally {
expect(rootTestView(testViewName)).to.equal(true, `${name} was able to drop a view with insufficent rights`);
}
expect(rootTestView(testViewName)).to.equal(!(colLevel['ro'].has(name) || colLevel['rw'].has(name)), `${name} was able to delete a view with insufficent rights`);
}
});
it('view with links to multiple collections (switching 1 of them as RW during RO/NONE of a user collection level)', () => {
var itName = 'view with links to multiple collections (switching 1 of them as RW during RO/NONE of a user collection level)';
!(colLevel['ro'].has(name) || colLevel['none'].has(name)) ? it.skip(itName) :
it(itName, () => {
rootDropView(testViewName);
rootDropCollection(testCol1Name);
@ -256,30 +259,19 @@ function hasIResearch (db) {
rootCreateCollection(testCol2Name);
rootCreateView(testViewName, { links: { [testCol1Name]: { includeAllFields: true }, [testCol2Name]: { includeAllFields: true } } });
expect(rootTestView(testViewName)).to.equal(true, 'Precondition failed, the view doesn not exist');
if (dbLevel['rw'].has(name)) {
if(colLevel['rw'].has(name))
{
rootGrantCollection(testCol2Name, name, 'rw');
if (dbLevel['rw'].has(name) && colLevel['ro'].has(name)) {
db._dropView(testViewName);
expect(rootTestView(testViewName)).to.equal(false, 'View deletion reported success, but view was found afterwards');
} else {
rootGrantCollection(testCol2Name, name, 'rw');
try {
db._dropView(testViewName);
} catch (e) {
checkError(e);
return;
}
expect(rootTestView(testViewName)).to.equal(!(colLevel['ro'].has(name) || colLevel['rw'].has(name)), `${name} was able to delete a view with insufficent rights`);
}
} else {
try {
db._dropView(testViewName);
} catch (e) {
checkError(e);
return;
}
if(!dbLevel['rw'].has(name)) {
expect(rootTestView(testViewName)).to.equal(true, `${name} was able to delete a view with insufficent rights`);
} finally {
expect(rootTestView(testViewName)).to.equal(true, `${name} was able to drop a view with insufficent rights`);
}
}
});

View File

@ -271,7 +271,9 @@ function hasIResearch (db) {
}
});
describe('with links to multiple collections with none access level to one of them', () => {
var descName = 'view with links to multiple collections with NONE access level to one of them';
!(colLevel['rw'].has(name) || colLevel['ro'].has(name)) ? describe(descName, () => {}) :
describe(descName, () => {
before(() => {
rootGrantCollection(testCol2Name, name, 'none');
expect(rootTestView(testView2Name)).to.equal(true, 'Precondition failed, the view doesn\'t exist');

View File

@ -44,6 +44,7 @@ const rightLevels = helper.rightLevels;
const testViewName = `${namePrefix}ViewNew`;
const testViewType = "arangosearch";
const testColName = `${namePrefix}ColNew`;
const testColNameAnother = `${namePrefix}ColAnotherNew`;
const keySpaceId = 'task_create_view_keyspace';
const userSet = helper.userSet;
@ -221,6 +222,29 @@ function hasIResearch (db) {
helper.switchUser(name, dbName);
};
const rootGetViewProps = (viewName, switchBack = true) => {
helper.switchUser('root', dbName);
let properties = db._view(viewName).properties();
if (switchBack) {
helper.switchUser(name, dbName);
}
return properties;
};
const rootGrantCollection = (colName, user, explicitRight = '') => {
if (rootTestCollection(colName, false)) {
if (explicitRight !== '' && rightLevels.includes(explicitRight))
{
if (helper.isLdapEnabledExternal()) {
users.grantCollection(':role:' + user, dbName, colName, explicitRight);
} else {
users.grantCollection(user, dbName, colName, explicitRight);
}
}
}
helper.switchUser(user, dbName);
};
const checkError = (e) => {
expect(e.code).to.equal(403, "Expected to get forbidden REST error code, but got another one");
expect(e.errorNum).to.equal(errors.ERROR_FORBIDDEN.code, "Expected to get forbidden error number, but got another one");
@ -229,18 +253,18 @@ function hasIResearch (db) {
describe('create a', () => {
before(() => {
db._useDatabase(dbName);
rootDropView();
});
after(() => {
rootDropView();
rootDropView(testViewName);
rootDropCollection(testColName);
});
it('view', () => {
it('view with empty (default) parameters', () => {
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
setKey(keySpaceId, name);
const taskId = 'task_create_view_' + name;
const taskId = 'task_create_view_default_params_' + name;
const task = {
id: taskId,
name: taskId,
@ -248,14 +272,19 @@ function hasIResearch (db) {
try {
const db = require('@arangodb').db;
db._createView('${testViewName}', '${testViewType}', {});
global.KEY_SET('${keySpaceId}', '${name}_status', true);
} catch (e) {
global.KEY_SET('${keySpaceId}', '${name}_status', false);
} finally {
global.KEY_SET('${keySpaceId}', '${name}', true);
}
})(params);`
};
if (dbLevel['rw'].has(name)) {
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(true, `${name} could not create the view with sufficient rights`);
expect(rootTestView(testViewName)).to.equal(true, 'View creation reported success, but view was not found afterwards');
} else {
try {
@ -271,39 +300,90 @@ function hasIResearch (db) {
}
});
it('view with links to existing collections', () => {
it('view with non-empty parameters (except links)', () => {
rootDropView(testViewName);
rootDropCollection(testColName);
rootCreateCollection(testColName);
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
expect(rootTestCollection(testColName)).to.equal(true, 'Precondition failed, the collection still not exists');
setKey(keySpaceId, name);
const taskId = 'task_create_view_with_links_existing_collections' + name;
const taskId = 'task_create_view_non_default_params_except_links_' + name;
const task = {
id: taskId,
name: taskId,
command: `(function (params) {
try {
const db = require('@arangodb').db;
var view = db._createView('${testViewName}', '${testViewType}', {});
view.properties( { links : { '${testColName}': { includeAllFields: true } } }, true);
db._createView('${testViewName}', '${testViewType}', { cleanupIntervalStep: 20 });
global.KEY_SET('${keySpaceId}', '${name}_status', true);
} catch (e) {
global.KEY_SET('${keySpaceId}', '${name}_status', false);
} finally {
global.KEY_SET('${keySpaceId}', '${name}', true);
}
})(params);`
};
if (dbLevel['rw'].has(name)) {
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(true, `${name} could not create the view with sufficient rights`);
expect(rootTestView(testViewName)).to.equal(true, 'View creation reported success, but view was not found afterwards');
expect(rootGetViewProps(testViewName, true)["cleanupIntervalStep"]).to.equal(20, 'View creation reported success, but view property was not set as expected during creation');
} else {
try {
tasks.register(task);
wait(keySpaceId, name);
} catch (e) {
checkError(e);
return;
} finally {
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
}
expect(false).to.equal(true, `${name} managed to register a task with insufficient rights`);
}
});
// FIXME: uncomment after PR 6199 is done with respectful changes
/*
it('view with links to existing collection', () => {
rootDropView(testViewName);
rootDropCollection(testColName);
rootCreateCollection(testColName);
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
expect(rootTestCollection(testColName)).to.equal(true, 'Precondition failed, the collection still not exists')
setKey(keySpaceId, name);
const taskId = 'task_create_view_with_links_to_existing_collection_' + name;
const task = {
id: taskId,
name: taskId,
command: `(function (params) {
try {
const db = require('@arangodb').db;
var view = db._createView('${testViewName}', '${testViewType}', { links: { '${testColName}': { includeAllFields: true } } });
global.KEY_SET('${keySpaceId}', '${name}_status', true);
} catch (e) {
global.KEY_SET('${keySpaceId}', '${name}_status', false);
} finally {
global.KEY_SET('${keySpaceId}', '${name}', true);
}
})(params);`
};
if (dbLevel['rw'].has(name)) {
if (colLevel['rw'].has(name) || colLevel['ro'].has(name)) {
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(true, `${name} could not create the view with sufficient rights`);
expect(rootTestView(testViewName)).to.equal(true, 'View creation reported success, but view was not found afterwards');
expect(rootTestViewHasLinks(testViewName, [`${testColName}`])).to.equal(true, 'View links expected to be visible, but were not found afterwards');
} else {
tasks.register(task);
wait(keySpaceId, name);
expect(rootTestView(testViewName)).to.equal(true, `${name} was unable to create a view with sufficent rights`);
expect(rootTestViewLinksEmpty(testViewName)).to.equal(true, 'View links expected to be empty, but were created afterwards with insufficent rights');
expect(getKey(keySpaceId, `${name}_status`)).to.equal(false, `${name} could create the view with insufficient rights`);
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
}
} else {
try {
@ -318,6 +398,184 @@ function hasIResearch (db) {
expect(false).to.equal(true, `${name} managed to register a task with insufficient rights`);
}
});
it('view with links to multiple collections with same access level', () => {
rootDropView(testViewName);
rootDropCollection(testColName);
rootCreateCollection(testColName);
rootCreateCollection(testColNameAnother);
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
expect(rootTestCollection(testColName)).to.equal(true, 'Precondition failed, the collection still not exists');
expect(rootTestCollection(testColNameAnother)).to.equal(true, 'Precondition failed, the collection still not exists');
setKey(keySpaceId, name);
const taskId = 'task_create_view_with_links_to_existing_collections_with_same_access_level_' + name;
const task = {
id: taskId,
name: taskId,
command: `(function (params) {
try {
const db = require('@arangodb').db;
var view = db._createView('${testViewName}', '${testViewType}', { links: {
'${testColName}': { includeAllFields: true }, '${testColNameAnother}': { includeAllFields: true }
}
});
global.KEY_SET('${keySpaceId}', '${name}_status', true);
} catch (e) {
global.KEY_SET('${keySpaceId}', '${name}_status', false);
} finally {
global.KEY_SET('${keySpaceId}', '${name}', true);
}
})(params);`
};
if (dbLevel['rw'].has(name)) {
if (colLevel['rw'].has(name) || colLevel['ro'].has(name)) {
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(true, `${name} could not create the view with sufficient rights`);
expect(rootTestView(testViewName)).to.equal(true, 'View creation reported success, but view was not found afterwards');
expect(rootTestViewHasLinks(testViewName, [`${testColName}`, `${testColNameAnother}`])).to.equal(true, 'View links expected to be visible, but were not found afterwards');
} else {
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(false, `${name} could create the view with insufficient rights`);
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
}
} else {
try {
tasks.register(task);
wait(keySpaceId, name);
} catch (e) {
checkError(e);
return;
} finally {
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
}
expect(false).to.equal(true, `${name} managed to register a task with insufficient rights`);
}
});
var itName = 'view with links to multiple collections with RO access level to one of them';
!(colLevel['rw'].has(name) || colLevel['none'].has(name)) ? it.skip(itName) :
it(itName, () => {
rootDropView(testViewName);
rootDropCollection(testColName);
rootDropCollection(testColNameAnother);
rootCreateCollection(testColName);
rootCreateCollection(testColNameAnother);
rootGrantCollection(testColNameAnother, name, "ro");
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
expect(rootTestCollection(testColName)).to.equal(true, 'Precondition failed, the collection still not exists');
expect(rootTestCollection(testColNameAnother)).to.equal(true, 'Precondition failed, the collection still not exists');
setKey(keySpaceId, name);
const taskId = 'task_create_view_with_links_to_existing_collections_with_RO_access_level_to_one_of_them_' + name;
const task = {
id: taskId,
name: taskId,
command: `(function (params) {
try {
const db = require('@arangodb').db;
var view = db._createView('${testViewName}', '${testViewType}', { links: {
'${testColName}': { includeAllFields: true }, '${testColNameAnother}': { includeAllFields: true }
}
});
global.KEY_SET('${keySpaceId}', '${name}_status', true);
} catch (e) {
global.KEY_SET('${keySpaceId}', '${name}_status', false);
} finally {
global.KEY_SET('${keySpaceId}', '${name}', true);
}
})(params);`
};
if (dbLevel['rw'].has(name)) {
if (colLevel['rw'].has(name)) {
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(true, `${name} could not create the view with sufficient rights`);
expect(rootTestView(testViewName)).to.equal(true, 'View creation reported success, but view was not found afterwards');
expect(rootTestViewHasLinks(testViewName, [`${testColName}`, `${testColNameAnother}`])).to.equal(true, 'View links expected to be visible, but were not found afterwards');
} else {
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(false, `${name} could create the view with insufficient rights`);
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
}
} else {
try {
tasks.register(task);
wait(keySpaceId, name);
} catch (e) {
checkError(e);
return;
} finally {
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
}
expect(false).to.equal(true, `${name} managed to register a task with insufficient rights`);
}
});
var itName = 'view with links to multiple collections with NONE access level to one of them';
!(colLevel['rw'].has(name) || colLevel['ro'].has(name)) ? it.skip(itName) :
it(itName, () => {
rootDropView(testViewName);
rootDropCollection(testColName);
rootDropCollection(testColNameAnother);
rootCreateCollection(testColName);
rootCreateCollection(testColNameAnother);
rootGrantCollection(testColNameAnother, name, "none");
expect(rootTestView(testViewName)).to.equal(false, 'Precondition failed, the view still exists');
expect(rootTestCollection(testColName)).to.equal(true, 'Precondition failed, the collection still not exists');
expect(rootTestCollection(testColNameAnother)).to.equal(true, 'Precondition failed, the collection still not exists');
setKey(keySpaceId, name);
const taskId = 'task_create_view_with_links_to_existing_collections_with_NONE_access_level_to_one_of_them_' + name;
const task = {
id: taskId,
name: taskId,
command: `(function (params) {
try {
const db = require('@arangodb').db;
var view = db._createView('${testViewName}', '${testViewType}', { links: {
'${testColName}': { includeAllFields: true }, '${testColNameAnother}': { includeAllFields: true }
}
});
global.KEY_SET('${keySpaceId}', '${name}_status', true);
} catch (e) {
global.KEY_SET('${keySpaceId}', '${name}_status', false);
} finally {
global.KEY_SET('${keySpaceId}', '${name}', true);
}
})(params);`
};
if (dbLevel['rw'].has(name)) {
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(false, `${name} could create the view with insufficient rights`);
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
} else {
try {
tasks.register(task);
wait(keySpaceId, name);
} catch (e) {
checkError(e);
return;
} finally {
expect(rootTestView(testViewName)).to.equal(false, `${name} was able to create a view with insufficent rights`);
}
expect(false).to.equal(true, `${name} managed to register a task with insufficient rights`);
}
});
*/
});
});
});

View File

@ -343,7 +343,7 @@ function hasIResearch (db) {
})(params);`
};
if (dbLevel['rw'].has(name)) {
if (colLevel['rw'].has(name) || colLevel['ro'].has(name)) {
if(colLevel['rw'].has(name) || colLevel['ro'].has(name)){
tasks.register(task);
wait(keySpaceId, name);
expect(rootTestView(testViewName)).to.equal(false, 'View deletion reported success, but view was found afterwards');
@ -366,7 +366,9 @@ function hasIResearch (db) {
}
});
it('view with links to multiple collections (switching 1 of them as RW during RO of a user collection level)', () => {
var itName = 'view with links to multiple collections (switching 1 of them as RW during RO/NONE of a user collection level)';
!(colLevel['ro'].has(name) || colLevel['none'].has(name)) ? it.skip(itName) :
it(itName, () => {
rootDropView(testViewName);
rootDropCollection(testCol1Name);
@ -374,6 +376,7 @@ function hasIResearch (db) {
rootCreateCollection(testCol2Name);
rootCreateView(testViewName, { links: { [testCol1Name]: { includeAllFields: true }, [testCol2Name]: { includeAllFields: true } } });
expect(rootTestView(testViewName)).to.equal(true, 'Precondition failed, the view doesn not exist');
rootGrantCollection(testCol2Name, name, 'rw');
setKey(keySpaceId, name);
const taskId = 'task_drop_view_with_link_to_existing_diff_col' + name;
const task = {
@ -392,16 +395,15 @@ function hasIResearch (db) {
})(params);`
};
if (dbLevel['rw'].has(name)) {
if(colLevel['rw'].has(name))
if(colLevel['ro'].has(name))
{
tasks.register(task);
wait(keySpaceId, name);
expect(rootTestView(testViewName)).to.equal(false, 'View deletion reported success, but view was found afterwards');
} else {
rootGrantCollection(testCol2Name, name, 'rw');
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.not.equal(false, `${name} managed to drop the view with insufficient rights`);
expect(rootTestView(testViewName)).to.equal(true, `${name} was able to drop a view with insufficent rights`);
}
} else {
try {
@ -410,6 +412,8 @@ function hasIResearch (db) {
} catch (e) {
checkError(e);
return;
} finally {
expect(getKey(keySpaceId, `${name}_status`)).to.equal(false, `${name} could update the view with insufficient rights`);
}
expect(false).to.equal(true, `${name} managed to register a task with insufficient rights`);
}

View File

@ -386,7 +386,9 @@ function hasIResearch (db) {
}
});
describe('with links to multiple collections with none access level to one of them', () => {
var descName = 'view with links to multiple collections with NONE access level to one of them';
!(colLevel['rw'].has(name) || colLevel['ro'].has(name)) ? describe(descName, () => {}) :
describe(descName, () => {
before(() => {
rootGrantCollection(testCol2Name, name, 'none');
expect(rootTestView(testView2Name)).to.equal(true, 'Precondition failed, the view doesn\'t exist');

View File

@ -305,11 +305,11 @@ function hasIResearch (db) {
}
})(params);`
};
if (dbLevel['rw'].has(name) && (colLevel['ro'].has(name) || colLevel['rw'].has(name))) {
if (dbLevel['rw'].has(name)) {
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(true, `${name} could not update the view with sufficient rights`);
expect(rootTestView(testViewRename)).to.equal(true, 'View renaming reported success, but updated view was not found afterwards');
expect(getKey(keySpaceId, `${name}_status`)).to.equal(colLevel['ro'].has(name) || colLevel['rw'].has(name), `${name} could not update the view with sufficient rights`);
expect(rootTestView(testViewRename)).to.equal(colLevel['ro'].has(name) || colLevel['rw'].has(name), 'View renaming reported success, but updated view was not found afterwards');
} else {
try {
tasks.register(task);
@ -320,7 +320,7 @@ function hasIResearch (db) {
} finally {
expect(getKey(keySpaceId, `${name}_status`)).to.equal(false, `${name} could update the view with insufficient rights`);
}
expect(false).to.equal(!dbLevel['rw'].has(name), `${name} managed to register a task with insufficient rights`);
expect(false).to.equal(true, `${name} managed to register a task with insufficient rights`);
}
});
@ -388,7 +388,7 @@ function hasIResearch (db) {
})(params);`
};
if (dbLevel['rw'].has(name)) {
if (colLevel['rw'].has(name) || colLevel['ro'].has(name)) {
if(colLevel['rw'].has(name) || colLevel['ro'].has(name)){
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(true, `${name} could not update the view with sufficient rights`);
@ -432,7 +432,7 @@ function hasIResearch (db) {
})(params);`
};
if (dbLevel['rw'].has(name)) {
if (colLevel['rw'].has(name) || colLevel['ro'].has(name)) {
if(colLevel['rw'].has(name) || colLevel['ro'].has(name)){
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(true, `${name} could not update the view with sufficient rights`);
@ -476,7 +476,8 @@ function hasIResearch (db) {
})(params);`
};
if (dbLevel['rw'].has(name)) {
if (colLevel['rw'].has(name) || colLevel['ro'].has(name)) {
if(colLevel['rw'].has(name) || colLevel['ro'].has(name))
{
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(true, `${name} could not update the view with sufficient rights`);
@ -544,7 +545,9 @@ function hasIResearch (db) {
}
});
it('view by new link to RW collection (partial)', () => {
var itName = 'view by new link to RW collection (partial)';
!(colLevel['ro'].has(name) || colLevel['none'].has(name)) ? it.skip(itName) :
it(itName, () => {
expect(rootTestView(testViewName)).to.equal(true, 'Precondition failed, view was not found');
rootGrantCollection(testCol2Name, name, 'rw');
setKey(keySpaceId, name);
@ -565,7 +568,7 @@ function hasIResearch (db) {
})(params);`
};
if (dbLevel['rw'].has(name)) {
if (colLevel['rw'].has(name) || colLevel['ro'].has(name)) {
if (colLevel['ro'].has(name)) {
tasks.register(task);
wait(keySpaceId, name);
expect(getKey(keySpaceId, `${name}_status`)).to.equal(true, `${name} could not update the view with sufficient rights`);

View File

@ -242,13 +242,15 @@ function hasIResearch (db) {
it('view by name', () => {
require('internal').sleep(2);
expect(rootTestView(testViewName)).to.equal(true, 'Precondition failed, view was not found');
if (dbLevel['rw'].has(name) && (colLevel['ro'].has(name) || colLevel['rw'].has(name))) {
if (dbLevel['rw'].has(name)) {
try {
db._view(testViewName).rename(testViewRename);
} catch (e) {
//FIXME: remove try/catch block after renaming will work in cluster
if (e.code === 404 && (e.errorNum === 1203 || e.errorNum === 1470)) {
return;
} else if (e.code === 403) {
return; // not authorised is valid if a non-read collection is present in the view
} else {
throw e;
}
@ -283,7 +285,7 @@ function hasIResearch (db) {
it('view by property except links (full)', () => {
expect(rootTestView(testViewName)).to.equal(true, 'Precondition failed, view was not found');
if (dbLevel['rw'].has(name) && (colLevel['ro'].has(name) || colLevel['rw'].has(name))) {
if (dbLevel['rw'].has(name) && (colLevel['rw'].has(name) || colLevel['ro'].has(name))) {
db._view(testViewName).properties({ "cleanupIntervalStep": 1 }, false);
expect(rootGetViewProps(testViewName, true)["cleanupIntervalStep"]).to.equal(1, 'View property update reported success, but property was not updated');
} else {
@ -299,7 +301,7 @@ function hasIResearch (db) {
it('view by properties remove (full)', () => {
expect(rootTestView(testViewName)).to.equal(true, 'Precondition failed, view was not found');
if (dbLevel['rw'].has(name) && (colLevel['ro'].has(name) || colLevel['rw'].has(name))) {
if (dbLevel['rw'].has(name) && (colLevel['rw'].has(name) || colLevel['ro'].has(name))) {
db._view(testViewName).properties({}, false);
expect(rootGetViewProps(testViewName, true)).to.deep.equal(rootGetDefaultViewProps(), 'View properties update reported success, but properties were not updated');
} else {
@ -315,7 +317,7 @@ function hasIResearch (db) {
it('view by existing link update (partial)', () => {
expect(rootTestView(testViewName)).to.equal(true, 'Precondition failed, view was not found');
if (dbLevel['rw'].has(name) && (colLevel['ro'].has(name) || colLevel['rw'].has(name))) {
if (dbLevel['rw'].has(name) && (colLevel['rw'].has(name) || colLevel['ro'].has(name))) {
db._view(testViewName).properties({ links: { [testCol1Name]: { includeAllFields: true, analyzers: ["text_de","text_en"] } } }, true);
expect(rootGetViewProps(testViewName, true)["links"][testCol1Name]["analyzers"]).to.eql(["text_de","text_en"], 'View link update reported success, but property was not updated');
} else {
@ -331,7 +333,7 @@ function hasIResearch (db) {
it('view by existing link update (full)', () => {
expect(rootTestView(testViewName)).to.equal(true, 'Precondition failed, view was not found');
if (dbLevel['rw'].has(name) && (colLevel['ro'].has(name) || colLevel['rw'].has(name))) {
if (dbLevel['rw'].has(name) && (colLevel['rw'].has(name) || colLevel['ro'].has(name))) {
db._view(testViewName).properties({ links: { [testCol1Name]: { includeAllFields: true, analyzers: ["text_de","text_en"] } } }, false);
expect(rootGetViewProps(testViewName, true)["links"][testCol1Name]["analyzers"]).to.eql(["text_de","text_en"], 'View link update reported success, but property was not updated');
} else {
@ -345,10 +347,12 @@ function hasIResearch (db) {
}
});
it('view by new link to RW collection (partial)', () => {
var itName = 'view by new link to RW collection (partial)';
!(colLevel['ro'].has(name) || colLevel['none'].has(name)) ? it.skip(itName) :
it(itName, () => {
expect(rootTestView(testViewName)).to.equal(true, 'Precondition failed, view was not found');
rootGrantCollection(testCol2Name, name, 'rw');
if (dbLevel['rw'].has(name) && (colLevel['rw'].has(name) || colLevel['ro'].has(name))) {
if (dbLevel['rw'].has(name) && colLevel['ro'].has(name)) {
db._view(testViewName).properties({ links: { [testCol2Name]: { includeAllFields: true, analyzers: ["text_de"] } } }, true);
expect(rootGetViewProps(testViewName, true)["links"][testCol2Name]["analyzers"]).to.eql(["text_de"], 'View link update reported success, but property was not updated');
} else {

View File

@ -38,14 +38,12 @@
#include "Aql/Query.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "RestServer/DatabasePathFeature.h"
@ -53,7 +51,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "V8/v8-globals.h"
#include "VocBase/LogicalCollection.h"
@ -98,8 +98,9 @@ struct IResearchBlockMockSetup {
features.emplace_back(new arangodb::DatabasePathFeature(server), false);
features.emplace_back(new arangodb::DatabaseFeature(server), false); // required for FeatureCacheFeature
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
@ -107,7 +108,6 @@ struct IResearchBlockMockSetup {
features.emplace_back(new arangodb::ShardingFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -37,7 +37,6 @@
#include "Aql/Query.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/ExpressionFilter.h"
#include "IResearch/IResearchCommon.h"
@ -45,7 +44,6 @@
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "IResearch/VelocyPackHelper.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
@ -54,7 +52,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "Transaction/Methods.h"
#include "Transaction/StandaloneContext.h"
@ -250,8 +250,9 @@ struct IResearchExpressionFilterSetup {
features.emplace_back(new arangodb::DatabasePathFeature(server), false);
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::ShardingFeature(server), false);
@ -259,7 +260,6 @@ struct IResearchExpressionFilterSetup {
features.emplace_back(functions = new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -34,14 +34,14 @@
#include "Enterprise/Ldap/LdapFeature.h"
#endif
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "IResearch/VelocyPackHelper.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "Sharding/ShardingFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "Transaction/StandaloneContext.h"
#include "Utils/OperationOptions.h"
@ -195,10 +195,10 @@ struct IResearchAnalyzerFeatureSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // required for constructing TRI_vocbase_t
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<Vocbase>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE); // QueryRegistryFeature required for instantiation
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE
@ -548,7 +548,7 @@ SECTION("test_text_features") {
SECTION("test_persistence") {
auto* database = arangodb::application_features::ApplicationServer::lookupFeature<
arangodb::iresearch::SystemDatabaseFeature
arangodb::SystemDatabaseFeature
>();
auto vocbase = database->use();
@ -849,7 +849,7 @@ SECTION("test_remove") {
SECTION("test_start") {
auto* database = arangodb::application_features::ApplicationServer::lookupFeature<
arangodb::iresearch::SystemDatabaseFeature
arangodb::SystemDatabaseFeature
>();
auto vocbase = database->use();
@ -1157,7 +1157,7 @@ SECTION("test_start") {
SECTION("test_tokens") {
auto* database = arangodb::application_features::ApplicationServer::lookupFeature<
arangodb::iresearch::SystemDatabaseFeature
arangodb::SystemDatabaseFeature
>();
auto vocbase = database->use();
@ -1174,7 +1174,7 @@ SECTION("test_tokens") {
auto* analyzers = new arangodb::iresearch::IResearchAnalyzerFeature(server);
auto* functions = new arangodb::aql::AqlFunctionFeature(server);
auto* sharding = new arangodb::ShardingFeature(server);
auto* systemdb = new arangodb::iresearch::SystemDatabaseFeature(server, s.system.get());
auto* systemdb = new arangodb::SystemDatabaseFeature(server, s.system.get());
arangodb::application_features::ApplicationServer::server->addFeature(analyzers);
arangodb::application_features::ApplicationServer::server->addFeature(functions);
@ -1360,4 +1360,4 @@ SECTION("test_visit") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -32,7 +32,6 @@
#include "Enterprise/Ldap/LdapFeature.h"
#endif
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/IResearchCommon.h"
@ -40,11 +39,12 @@
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchLinkMeta.h"
#include "IResearch/IResearchKludge.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "Sharding/ShardingFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "velocypack/Iterator.h"
@ -141,12 +141,12 @@ struct IResearchDocumentSetup {
features.emplace_back(new arangodb::AuthenticationFeature(server), true);
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // required for constructing TRI_vocbase_t
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::ShardingFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE
@ -1797,4 +1797,4 @@ SECTION("test_visitReaderCollections") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -30,7 +30,6 @@
#include "Aql/Query.h"
#include "Aql/ExecutionPlan.h"
#include "Aql/AqlFunctionFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
@ -40,7 +39,6 @@
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/IResearchKludge.h"
#include "IResearch/ExpressionFilter.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "IResearch/AqlHelper.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
@ -48,8 +46,10 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "RestServer/ViewTypesFeature.h"
#include "Sharding/ShardingFeature.h"
#ifdef USE_ENTERPRISE
#include "Enterprise/Ldap/LdapFeature.h"
@ -157,8 +157,9 @@ struct IResearchFilterSetup {
features.emplace_back(new arangodb::AuthenticationFeature(server), true);
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::ViewTypesFeature(server), false); // required for IResearchFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
@ -166,7 +167,6 @@ struct IResearchFilterSetup {
features.emplace_back(functions = new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
for (auto& f : features) {
arangodb::application_features::ApplicationServer::server->addFeature(f.first);
@ -255,4 +255,4 @@ TEST_CASE("IResearchFilterTest", "[iresearch][iresearch-filter]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -42,13 +42,13 @@
#include "IResearch/IResearchViewMeta.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/ExpressionFilter.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "IResearch/AqlHelper.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "RestServer/ViewTypesFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -89,15 +89,15 @@ struct IResearchFilterSetup {
features.emplace_back(new arangodb::AuthenticationFeature(server), true);
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::ViewTypesFeature(server), false); // required for IResearchFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(functions = new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE
@ -3638,4 +3638,4 @@ SECTION("BinaryAnd") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -42,13 +42,13 @@
#include "IResearch/IResearchViewMeta.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/ExpressionFilter.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "IResearch/AqlHelper.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "RestServer/ViewTypesFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -90,15 +90,15 @@ struct IResearchFilterSetup {
features.emplace_back(new arangodb::AuthenticationFeature(server), true);
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::ViewTypesFeature(server), false); // required for IResearchFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(functions = new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE
@ -3668,4 +3668,4 @@ SECTION("BinaryLT") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -30,7 +30,6 @@
#include "Enterprise/Ldap/LdapFeature.h"
#endif
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
@ -39,7 +38,6 @@
#include "IResearch/IResearchViewMeta.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/ExpressionFilter.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "IResearch/AqlHelper.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
@ -49,8 +47,10 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "RestServer/ViewTypesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
#include "Aql/ExecutionPlan.h"
@ -92,15 +92,15 @@ struct IResearchFilterSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
features.emplace_back(new arangodb::ShardingFeature(server), false);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::ViewTypesFeature(server), false); // required for IResearchFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(functions = new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE
@ -2272,4 +2272,4 @@ SECTION("StartsWith") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -42,13 +42,13 @@
#include "IResearch/IResearchViewMeta.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/ExpressionFilter.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "IResearch/AqlHelper.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "RestServer/ViewTypesFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -89,15 +89,15 @@ struct IResearchFilterSetup {
features.emplace_back(new arangodb::AuthenticationFeature(server), true);
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::ViewTypesFeature(server), false); // required for IResearchFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(functions = new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE
@ -3950,4 +3950,4 @@ SECTION("BinaryNotIn") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -37,11 +37,11 @@
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabasePathFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "RestServer/ViewTypesFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -153,14 +153,14 @@ struct IResearchIndexSetup {
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::ViewTypesFeature(server), true); // required by TRI_vocbase_t::createView(...)
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // required by TRI_vocbase_t(...)
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // QueryRegistryFeature required to be present before calling TRI_vocbase_t(...)
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // required for AQLFeature
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true); // required for arangodb::aql::Query::execute(...)
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true); // required for use of iresearch analyzers
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true); // required for creating views of type 'iresearch'
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
for (auto& f: features) {
arangodb::application_features::ApplicationServer::server->addFeature(f.first);
@ -929,4 +929,4 @@ SECTION("test_fields") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -36,13 +36,11 @@
#endif
#include "Basics/files.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchMMFilesLink.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "RestServer/DatabaseFeature.h"
@ -50,7 +48,9 @@
#include "RestServer/FlushFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/ServerIdFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/ViewTypesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "Transaction/Methods.h"
#include "Transaction/StandaloneContext.h"
@ -89,13 +89,13 @@ struct IResearchLinkSetup {
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::ViewTypesFeature(server), true);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::DatabasePathFeature(server), false);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::FlushFeature(server), false); // do not start the thread
#if USE_ENTERPRISE

View File

@ -51,7 +51,6 @@
#include "Cluster/ClusterComm.h"
#include "Cluster/ClusterFeature.h"
#include "Cluster/ClusterInfo.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/ApplicationServerHelper.h"
#include "IResearch/IResearchCommon.h"
@ -59,7 +58,6 @@
#include "IResearch/IResearchViewCoordinator.h"
#include "IResearch/IResearchLinkCoordinator.h"
#include "IResearch/IResearchLinkHelper.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "Random/RandomFeature.h"
@ -70,7 +68,9 @@
#include "RestServer/FlushFeature.h"
#include "RestServer/DatabasePathFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/ViewTypesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "Utils/OperationOptions.h"
#include "Utils/SingleCollectionTransaction.h"
@ -136,6 +136,7 @@ struct IResearchLinkCoordinatorSetup {
std::string name = ftr->name();
features.emplace(name, std::make_pair(ftr, start));
};
arangodb::application_features::ApplicationFeature* tmpFeature;
buildFeatureEntry(new arangodb::application_features::BasicFeaturePhase(server, false), false);
buildFeatureEntry(new arangodb::application_features::ClusterFeaturePhase(server), false);
@ -147,7 +148,10 @@ struct IResearchLinkCoordinatorSetup {
buildFeatureEntry(new arangodb::V8DealerFeature(server), false);
buildFeatureEntry(new arangodb::ViewTypesFeature(server), true);
buildFeatureEntry(new arangodb::QueryRegistryFeature(server), false);
buildFeatureEntry(tmpFeature = new arangodb::QueryRegistryFeature(server), false);
arangodb::application_features::ApplicationServer::server->addFeature(tmpFeature); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
buildFeatureEntry(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
buildFeatureEntry(new arangodb::RandomFeature(server), false); // required by AuthenticationFeature
buildFeatureEntry(new arangodb::AuthenticationFeature(server), false);
buildFeatureEntry(arangodb::DatabaseFeature::DATABASE = new arangodb::DatabaseFeature(server), false);
@ -156,11 +160,6 @@ struct IResearchLinkCoordinatorSetup {
buildFeatureEntry(new arangodb::AqlFeature(server), true);
buildFeatureEntry(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
buildFeatureEntry(new arangodb::iresearch::IResearchFeature(server), true);
// We need this feature to be added now in order to create the system database
arangodb::application_features::ApplicationServer::server->addFeature(features.at("QueryRegistry").first);
system = std::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_COORDINATOR, 0, TRI_VOC_SYSTEM_DATABASE);
buildFeatureEntry(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
buildFeatureEntry(new arangodb::FlushFeature(server), false); // do not start the thread
buildFeatureEntry(new arangodb::ClusterFeature(server), false);
buildFeatureEntry(new arangodb::ShardingFeature(server), false);

View File

@ -45,14 +45,14 @@
#include "Enterprise/Ldap/LdapFeature.h"
#endif
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchLinkMeta.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "Sharding/ShardingFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "velocypack/Builder.h"
#include "velocypack/Iterator.h"
@ -110,6 +110,7 @@ struct IResearchLinkMetaSetup {
std::string name = ftr->name();
features.emplace(name, std::make_pair(ftr, start));
};
arangodb::application_features::ApplicationFeature* tmpFeature;
buildFeatureEntry(new arangodb::application_features::BasicFeaturePhase(server, false), false);
buildFeatureEntry(new arangodb::application_features::ClusterFeaturePhase(server), false);
@ -123,14 +124,12 @@ struct IResearchLinkMetaSetup {
buildFeatureEntry(new arangodb::DatabaseFeature(server), false);
buildFeatureEntry(new arangodb::ShardingFeature(server), false);
buildFeatureEntry(new arangodb::QueryRegistryFeature(server), false); // required for constructing TRI_vocbase_t
// We need this feature to be added now in order to create the system database
arangodb::application_features::ApplicationServer::server->addFeature(features.at("QueryRegistry").first);
buildFeatureEntry(tmpFeature = new arangodb::QueryRegistryFeature(server), false);
arangodb::application_features::ApplicationServer::server->addFeature(tmpFeature); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
buildFeatureEntry(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
buildFeatureEntry(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
buildFeatureEntry(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
buildFeatureEntry(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
buildFeatureEntry(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE
@ -639,4 +638,4 @@ SECTION("test_writeMaskNone") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -31,14 +31,12 @@
#include "VocBase/LogicalView.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -47,7 +45,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -168,15 +168,15 @@ struct IResearchQuerySetup {
features.emplace_back(new arangodb::DatabasePathFeature(server), false);
features.emplace_back(new arangodb::DatabaseFeature(server), false); // required for FeatureCacheFeature
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
for (auto& f : features) {
arangodb::application_features::ApplicationServer::server->addFeature(f.first);

View File

@ -38,14 +38,12 @@
#include "Transaction/StandaloneContext.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -54,7 +52,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -101,15 +101,15 @@ struct IResearchQueryAggregateSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -35,15 +35,12 @@
#include "Aql/OptimizerRulesFeature.h"
#include "Aql/Query.h"
#include "Basics/VelocyPackHelper.h"
#include "Sharding/ShardingFeature.h"
#include "V8/v8-globals.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -52,7 +49,10 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "V8/v8-globals.h"
#include "VocBase/LogicalCollection.h"
#include "VocBase/LogicalView.h"
@ -101,15 +101,15 @@ struct IResearchQueryAndSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false); //
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -39,23 +39,23 @@
#include "Utils/SingleCollectionTransaction.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "RestServer/DatabasePathFeature.h"
#include "RestServer/ViewTypesFeature.h"
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -102,15 +102,15 @@ struct IResearchQueryBooleanTermSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -38,14 +38,12 @@
#include "Utils/SingleCollectionTransaction.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -54,7 +52,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -101,15 +101,15 @@ struct IResearchQueryComplexBooleanSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false); //
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -40,14 +40,12 @@
#include "Utils/SingleCollectionTransaction.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -56,7 +54,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -103,15 +103,15 @@ struct IResearchQueryExistsSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -39,14 +39,12 @@
#include "Utils/SingleCollectionTransaction.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -55,7 +53,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -101,15 +101,15 @@ struct IResearchQueryInSetup {
features.emplace_back(new arangodb::DatabasePathFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -39,7 +39,6 @@
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Aql/ExecutionPlan.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/ApplicationServerHelper.h"
#include "IResearch/IResearchCommon.h"
@ -47,7 +46,6 @@
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -56,7 +54,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -202,15 +202,15 @@ struct IResearchQueryJoinSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(functions = new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -38,14 +38,12 @@
#include "Utils/SingleCollectionTransaction.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -54,7 +52,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -101,15 +101,15 @@ struct IResearchQueryNullTermSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -39,14 +39,12 @@
#include "Utils/OperationOptions.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -55,7 +53,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -101,8 +101,9 @@ struct IResearchQueryNumericTermSetup {
features.emplace_back(new arangodb::DatabasePathFeature(server), false);
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
@ -110,7 +111,6 @@ struct IResearchQueryNumericTermSetup {
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -39,14 +39,12 @@
#include "Transaction/Methods.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -55,7 +53,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -102,15 +102,15 @@ struct IResearchQueryOrSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -38,14 +38,12 @@
#include "Utils/SingleCollectionTransaction.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -54,7 +52,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -101,15 +101,15 @@ struct IResearchQueryPhraseSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -39,14 +39,12 @@
#include "Utils/SingleCollectionTransaction.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -55,7 +53,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -101,8 +101,9 @@ struct IResearchQuerySelectAllSetup {
features.emplace_back(new arangodb::DatabasePathFeature(server), false);
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
@ -110,7 +111,6 @@ struct IResearchQuerySelectAllSetup {
features.emplace_back(new arangodb::ShardingFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -39,14 +39,12 @@
#include "Utils/SingleCollectionTransaction.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -55,7 +53,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -102,15 +102,15 @@ struct IResearchQueryStartsWithSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), true);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -39,14 +39,12 @@
#include "Transaction/Methods.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -55,7 +53,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -103,15 +103,15 @@ struct IResearchQueryStringTermSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(functions = new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -39,14 +39,12 @@
#include "Utils/SingleCollectionTransaction.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -55,7 +53,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -109,15 +109,15 @@ struct IResearchQueryTokensSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -38,14 +38,12 @@
#include "Utils/SingleCollectionTransaction.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -54,7 +52,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -101,15 +101,15 @@ struct IResearchQueryTraversalSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -38,14 +38,12 @@
#include "Utils/SingleCollectionTransaction.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/IResearchCommon.h"
#include "IResearch/IResearchFeature.h"
#include "IResearch/IResearchFilterFactory.h"
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -54,7 +52,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -101,15 +101,15 @@ struct IResearchQueryValueSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE

View File

@ -60,7 +60,6 @@
#include "IResearch/IResearchLinkMeta.h"
#include "IResearch/IResearchMMFilesLink.h"
#include "IResearch/IResearchView.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "Random/RandomFeature.h"
@ -70,6 +69,7 @@
#include "RestServer/FlushFeature.h"
#include "RestServer/DatabasePathFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/ViewTypesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -158,6 +158,7 @@ struct IResearchViewSetup {
std::string name = ftr->name();
features.emplace(name, std::make_pair(ftr, start));
};
arangodb::application_features::ApplicationFeature* tmpFeature;
buildFeatureEntry(new arangodb::application_features::BasicFeaturePhase(server, false), false);
buildFeatureEntry(new arangodb::application_features::ClusterFeaturePhase(server), false);
@ -167,7 +168,10 @@ struct IResearchViewSetup {
// setup required application features
buildFeatureEntry(new arangodb::V8DealerFeature(server), false);
buildFeatureEntry(new arangodb::ViewTypesFeature(server), true);
buildFeatureEntry(new arangodb::QueryRegistryFeature(server), false);
buildFeatureEntry(tmpFeature = new arangodb::QueryRegistryFeature(server), false);
arangodb::application_features::ApplicationServer::server->addFeature(tmpFeature); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
buildFeatureEntry(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
buildFeatureEntry(new arangodb::RandomFeature(server), false); // required by AuthenticationFeature
buildFeatureEntry(new arangodb::AuthenticationFeature(server), true);
buildFeatureEntry(new arangodb::ClusterFeature(server), false);
@ -178,13 +182,6 @@ struct IResearchViewSetup {
buildFeatureEntry(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
buildFeatureEntry(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
buildFeatureEntry(new arangodb::iresearch::IResearchFeature(server), true);
// We need this feature to be added now in order to create the system database
arangodb::application_features::ApplicationServer::server->addFeature(features.at("QueryRegistry").first);
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
buildFeatureEntry(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
buildFeatureEntry(new arangodb::ShardingFeature(server), false);
buildFeatureEntry(new arangodb::FlushFeature(server), false); // do not start the thread
@ -4038,6 +4035,201 @@ SECTION("test_update_overwrite") {
CHECK((false == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
}
}
// drop link (collection not authorized)
{
auto collectionJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection\", \"id\": 100 }");
auto viewCreateJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testView\", \"type\": \"arangosearch\" }");
auto viewUpdateJson = arangodb::velocypack::Parser::fromJson("{ \"links\": { \"testCollection\": null } }");
TRI_vocbase_t vocbase(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 1, "testVocbase");
auto* logicalCollection = vocbase.createCollection(collectionJson->slice());
REQUIRE((nullptr != logicalCollection));
auto logicalView = vocbase.createView(viewCreateJson->slice());
REQUIRE((false == !logicalView));
CHECK((true == logicalCollection->getIndexes().empty()));
CHECK((true == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
// initial link creation
{
auto updateJson = arangodb::velocypack::Parser::fromJson("{ \"links\": { \"testCollection\": {} } }");
CHECK((logicalView->updateProperties(updateJson->slice(), true, false).ok()));
CHECK((false == logicalCollection->getIndexes().empty()));
CHECK((false == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
}
struct ExecContext: public arangodb::ExecContext {
ExecContext(): arangodb::ExecContext(arangodb::ExecContext::Type::Default, "", "",
arangodb::auth::Level::NONE, arangodb::auth::Level::NONE) {}
} execContext;
arangodb::ExecContextScope scopedExecContext(&execContext);
auto* authFeature = arangodb::AuthenticationFeature::instance();
auto* userManager = authFeature->userManager();
arangodb::aql::QueryRegistry queryRegistry(0); // required for UserManager::loadFromDB()
userManager->setQueryRegistry(&queryRegistry);
auto resetUserManager = std::shared_ptr<arangodb::auth::UserManager>(userManager, [](arangodb::auth::UserManager* ptr)->void { ptr->removeAllUsers(); });
// subsequent update (overwrite) not authorised (NONE collection)
{
arangodb::auth::UserMap userMap;
auto& user = userMap.emplace("", arangodb::auth::User::newUser("", "", arangodb::auth::Source::LDAP)).first->second;
user.grantCollection(vocbase.name(), "testCollection", arangodb::auth::Level::NONE); // for missing collections User::collectionAuthLevel(...) returns database auth::Level
userManager->setAuthInfo(userMap); // set user map to avoid loading configuration from system database
CHECK((TRI_ERROR_FORBIDDEN == logicalView->updateProperties(viewUpdateJson->slice(), false, false).errorNumber()));
CHECK((false == logicalCollection->getIndexes().empty()));
CHECK((false == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
}
// subsequent update (overwrite) authorised (RO collection)
{
arangodb::auth::UserMap userMap;
auto& user = userMap.emplace("", arangodb::auth::User::newUser("", "", arangodb::auth::Source::LDAP)).first->second;
user.grantCollection(vocbase.name(), "testCollection", arangodb::auth::Level::RO); // for missing collections User::collectionAuthLevel(...) returns database auth::Level
userManager->setAuthInfo(userMap); // set user map to avoid loading configuration from system database
CHECK((logicalView->updateProperties(viewUpdateJson->slice(), false, false).ok()));
CHECK((true == logicalCollection->getIndexes().empty()));
CHECK((true == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
}
}
// add authorised link (existing collection not authorized)
{
auto collection0Json = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection0\", \"id\": 100 }");
auto collection1Json = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection1\", \"id\": 101 }");
auto viewCreateJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testView\", \"type\": \"arangosearch\" }");
auto viewUpdateJson = arangodb::velocypack::Parser::fromJson("{ \"links\": { \"testCollection0\": {}, \"testCollection1\": {} } }");
TRI_vocbase_t vocbase(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 1, "testVocbase");
auto* logicalCollection0 = vocbase.createCollection(collection0Json->slice());
REQUIRE((nullptr != logicalCollection0));
auto* logicalCollection1 = vocbase.createCollection(collection1Json->slice());
REQUIRE((nullptr != logicalCollection1));
auto logicalView = vocbase.createView(viewCreateJson->slice());
REQUIRE((false == !logicalView));
CHECK((true == logicalCollection0->getIndexes().empty()));
CHECK((true == logicalCollection1->getIndexes().empty()));
CHECK((true == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
// initial link creation
{
auto updateJson = arangodb::velocypack::Parser::fromJson("{ \"links\": { \"testCollection0\": {} } }");
CHECK((logicalView->updateProperties(updateJson->slice(), true, false).ok()));
CHECK((false == logicalCollection0->getIndexes().empty()));
CHECK((true == logicalCollection1->getIndexes().empty()));
CHECK((false == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
}
struct ExecContext: public arangodb::ExecContext {
ExecContext(): arangodb::ExecContext(arangodb::ExecContext::Type::Default, "", "",
arangodb::auth::Level::NONE, arangodb::auth::Level::NONE) {}
} execContext;
arangodb::ExecContextScope scopedExecContext(&execContext);
auto* authFeature = arangodb::AuthenticationFeature::instance();
auto* userManager = authFeature->userManager();
arangodb::aql::QueryRegistry queryRegistry(0); // required for UserManager::loadFromDB()
userManager->setQueryRegistry(&queryRegistry);
auto resetUserManager = std::shared_ptr<arangodb::auth::UserManager>(userManager, [](arangodb::auth::UserManager* ptr)->void { ptr->removeAllUsers(); });
// subsequent update (overwrite) not authorised (NONE collection)
{
arangodb::auth::UserMap userMap;
auto& user = userMap.emplace("", arangodb::auth::User::newUser("", "", arangodb::auth::Source::LDAP)).first->second;
user.grantCollection(vocbase.name(), "testCollection0", arangodb::auth::Level::NONE); // for missing collections User::collectionAuthLevel(...) returns database auth::Level
user.grantCollection(vocbase.name(), "testCollection1", arangodb::auth::Level::RO); // for missing collections User::collectionAuthLevel(...) returns database auth::Level
userManager->setAuthInfo(userMap); // set user map to avoid loading configuration from system database
CHECK((TRI_ERROR_FORBIDDEN == logicalView->updateProperties(viewUpdateJson->slice(), false, false).errorNumber()));
CHECK((false == logicalCollection0->getIndexes().empty()));
CHECK((true == logicalCollection1->getIndexes().empty()));
CHECK((false == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
}
// subsequent update (overwrite) authorised (RO collection)
{
arangodb::auth::UserMap userMap;
auto& user = userMap.emplace("", arangodb::auth::User::newUser("", "", arangodb::auth::Source::LDAP)).first->second;
user.grantCollection(vocbase.name(), "testCollection0", arangodb::auth::Level::RO); // for missing collections User::collectionAuthLevel(...) returns database auth::Level
user.grantCollection(vocbase.name(), "testCollection1", arangodb::auth::Level::RO); // for missing collections User::collectionAuthLevel(...) returns database auth::Level
userManager->setAuthInfo(userMap); // set user map to avoid loading configuration from system database
CHECK((logicalView->updateProperties(viewUpdateJson->slice(), false, false).ok()));
CHECK((false == logicalCollection0->getIndexes().empty()));
CHECK((false == logicalCollection1->getIndexes().empty()));
CHECK((false == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
}
}
// drop authorised link (existing collection not authorized)
{
auto collection0Json = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection0\", \"id\": 100 }");
auto collection1Json = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection1\", \"id\": 101 }");
auto viewCreateJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testView\", \"type\": \"arangosearch\" }");
auto viewUpdateJson = arangodb::velocypack::Parser::fromJson("{ \"links\": { \"testCollection0\": {} } }");
TRI_vocbase_t vocbase(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 1, "testVocbase");
auto* logicalCollection0 = vocbase.createCollection(collection0Json->slice());
REQUIRE((nullptr != logicalCollection0));
auto* logicalCollection1 = vocbase.createCollection(collection1Json->slice());
REQUIRE((nullptr != logicalCollection1));
auto logicalView = vocbase.createView(viewCreateJson->slice());
REQUIRE((false == !logicalView));
CHECK((true == logicalCollection0->getIndexes().empty()));
CHECK((true == logicalCollection1->getIndexes().empty()));
CHECK((true == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
// initial link creation
{
auto updateJson = arangodb::velocypack::Parser::fromJson("{ \"links\": { \"testCollection0\": {}, \"testCollection1\": {} } }");
CHECK((logicalView->updateProperties(updateJson->slice(), true, false).ok()));
CHECK((false == logicalCollection0->getIndexes().empty()));
CHECK((false == logicalCollection1->getIndexes().empty()));
CHECK((false == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
}
struct ExecContext: public arangodb::ExecContext {
ExecContext(): arangodb::ExecContext(arangodb::ExecContext::Type::Default, "", "",
arangodb::auth::Level::NONE, arangodb::auth::Level::NONE) {}
} execContext;
arangodb::ExecContextScope scopedExecContext(&execContext);
auto* authFeature = arangodb::AuthenticationFeature::instance();
auto* userManager = authFeature->userManager();
arangodb::aql::QueryRegistry queryRegistry(0); // required for UserManager::loadFromDB()
userManager->setQueryRegistry(&queryRegistry);
auto resetUserManager = std::shared_ptr<arangodb::auth::UserManager>(userManager, [](arangodb::auth::UserManager* ptr)->void { ptr->removeAllUsers(); });
// subsequent update (overwrite) not authorised (NONE collection)
{
arangodb::auth::UserMap userMap;
auto& user = userMap.emplace("", arangodb::auth::User::newUser("", "", arangodb::auth::Source::LDAP)).first->second;
user.grantCollection(vocbase.name(), "testCollection0", arangodb::auth::Level::NONE); // for missing collections User::collectionAuthLevel(...) returns database auth::Level
user.grantCollection(vocbase.name(), "testCollection1", arangodb::auth::Level::RO); // for missing collections User::collectionAuthLevel(...) returns database auth::Level
userManager->setAuthInfo(userMap); // set user map to avoid loading configuration from system database
CHECK((TRI_ERROR_FORBIDDEN == logicalView->updateProperties(viewUpdateJson->slice(), false, false).errorNumber()));
CHECK((false == logicalCollection0->getIndexes().empty()));
CHECK((false == logicalCollection1->getIndexes().empty()));
CHECK((false == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
}
// subsequent update (overwrite) authorised (RO collection)
{
arangodb::auth::UserMap userMap;
auto& user = userMap.emplace("", arangodb::auth::User::newUser("", "", arangodb::auth::Source::LDAP)).first->second;
user.grantCollection(vocbase.name(), "testCollection0", arangodb::auth::Level::RO); // for missing collections User::collectionAuthLevel(...) returns database auth::Level
user.grantCollection(vocbase.name(), "testCollection1", arangodb::auth::Level::RO); // for missing collections User::collectionAuthLevel(...) returns database auth::Level
userManager->setAuthInfo(userMap); // set user map to avoid loading configuration from system database
CHECK((logicalView->updateProperties(viewUpdateJson->slice(), false, false).ok()));
CHECK((false == logicalCollection0->getIndexes().empty()));
CHECK((true == logicalCollection1->getIndexes().empty()));
CHECK((false == logicalView->visitCollections([](TRI_voc_cid_t)->bool { return false; })));
}
}
}
SECTION("test_update_partial") {
@ -5543,4 +5735,4 @@ SECTION("test_update_partial") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -66,7 +66,6 @@
#include "IResearch/IResearchLinkMeta.h"
#include "IResearch/IResearchViewCoordinator.h"
#include "IResearch/IResearchViewNode.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "Random/RandomFeature.h"
@ -76,6 +75,7 @@
#include "RestServer/FlushFeature.h"
#include "RestServer/DatabasePathFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/ViewTypesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -138,6 +138,7 @@ struct IResearchViewCoordinatorSetup {
std::string name = ftr->name();
features.emplace(name, std::make_pair(ftr, start));
};
arangodb::application_features::ApplicationFeature* tmpFeature;
buildFeatureEntry(new arangodb::application_features::BasicFeaturePhase(server, false), false);
buildFeatureEntry(new arangodb::application_features::ClusterFeaturePhase(server), false);
@ -148,7 +149,10 @@ struct IResearchViewCoordinatorSetup {
// setup required application features
buildFeatureEntry(new arangodb::V8DealerFeature(server), false);
buildFeatureEntry(new arangodb::ViewTypesFeature(server), true);
buildFeatureEntry(new arangodb::QueryRegistryFeature(server), false);
buildFeatureEntry(tmpFeature = new arangodb::QueryRegistryFeature(server), false);
arangodb::application_features::ApplicationServer::server->addFeature(tmpFeature); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
buildFeatureEntry(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
buildFeatureEntry(new arangodb::RandomFeature(server), false); // required by AuthenticationFeature
buildFeatureEntry(new arangodb::AuthenticationFeature(server), false);
buildFeatureEntry(arangodb::DatabaseFeature::DATABASE = new arangodb::DatabaseFeature(server), false);
@ -157,12 +161,6 @@ struct IResearchViewCoordinatorSetup {
buildFeatureEntry(new arangodb::AqlFeature(server), true);
buildFeatureEntry(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
buildFeatureEntry(new arangodb::iresearch::IResearchFeature(server), true);
// We need this feature to be added now in order to create the system database
arangodb::application_features::ApplicationServer::server->addFeature(features.at("QueryRegistry").first);
system = std::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_COORDINATOR, 0, TRI_VOC_SYSTEM_DATABASE);
buildFeatureEntry(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
buildFeatureEntry(new arangodb::aql::OptimizerRulesFeature(server), true);
buildFeatureEntry(new arangodb::FlushFeature(server), false); // do not start the thread
buildFeatureEntry(new arangodb::ClusterFeature(server), false);

View File

@ -40,7 +40,6 @@
#include "Aql/BasicBlocks.h"
#include "Aql/ExecutionEngine.h"
#include "Aql/OptimizerRulesFeature.h"
#include "Sharding/ShardingFeature.h"
#include "GeneralServer/AuthenticationFeature.h"
#include "IResearch/ApplicationServerHelper.h"
#include "IResearch/IResearchFilterFactory.h"
@ -50,7 +49,6 @@
#include "IResearch/IResearchViewNode.h"
#include "IResearch/IResearchViewBlock.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/SystemDatabaseFeature.h"
#include "Logger/Logger.h"
#include "Logger/LogTopic.h"
#include "StorageEngine/EngineSelectorFeature.h"
@ -59,7 +57,9 @@
#include "RestServer/AqlFeature.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"
#include "RestServer/TraverserEngineRegistryFeature.h"
#include "Sharding/ShardingFeature.h"
#include "Basics/VelocyPackHelper.h"
#include "Aql/Ast.h"
#include "Aql/Query.h"
@ -101,15 +101,15 @@ struct IResearchViewNodeSetup {
features.emplace_back(new arangodb::DatabaseFeature(server), false);
features.emplace_back(new arangodb::ShardingFeature(server), false);
features.emplace_back(new arangodb::QueryRegistryFeature(server), false); // must be first
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first);
arangodb::application_features::ApplicationServer::server->addFeature(features.back().first); // need QueryRegistryFeature feature to be added now in order to create the system database
system = irs::memory::make_unique<TRI_vocbase_t>(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 0, TRI_VOC_SYSTEM_DATABASE);
features.emplace_back(new arangodb::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::TraverserEngineRegistryFeature(server), false); // must be before AqlFeature
features.emplace_back(new arangodb::AqlFeature(server), true);
features.emplace_back(new arangodb::aql::OptimizerRulesFeature(server), true);
features.emplace_back(new arangodb::aql::AqlFunctionFeature(server), true); // required for IResearchAnalyzerFeature
features.emplace_back(new arangodb::iresearch::IResearchAnalyzerFeature(server), true);
features.emplace_back(new arangodb::iresearch::IResearchFeature(server), true);
features.emplace_back(new arangodb::iresearch::SystemDatabaseFeature(server, system.get()), false); // required for IResearchAnalyzerFeature
#if USE_ENTERPRISE
features.emplace_back(new arangodb::LdapFeature(server), false); // required for AuthenticationFeature with USE_ENTERPRISE
@ -1221,4 +1221,4 @@ SECTION("createBlockCoordinator") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -33,6 +33,7 @@
#include "Aql/Ast.h"
#include "Basics/files.h"
#include "RestServer/DatabasePathFeature.h"
#include "V8/v8-utils.h"
#include "VocBase/KeyGenerator.h"
#include "Transaction/StandaloneContext.h"
#include "RestServer/QueryRegistryFeature.h"
@ -131,6 +132,27 @@ void init(bool withICU /*= false*/) {
arangodb::transaction::Methods::clearDataSourceRegistrationCallbacks();
}
// @Note: once V8 is initialized all 'CATCH' errors will result in SIGILL
void v8Init() {
struct init_t {
std::shared_ptr<v8::Platform> platform;
init_t() {
platform = std::shared_ptr<v8::Platform>(
v8::platform::CreateDefaultPlatform(),
[](v8::Platform* p)->void {
v8::V8::Dispose();
v8::V8::ShutdownPlatform();
delete p;
}
);
v8::V8::InitializePlatform(platform.get()); // avoid SIGSEGV duing 8::Isolate::New(...)
v8::V8::Initialize(); // avoid error: "Check failed: thread_data_table_"
}
};
static const init_t init;
(void)(init);
}
bool assertRules(
TRI_vocbase_t& vocbase,
std::string const& queryString,

View File

@ -31,6 +31,7 @@
#include <string>
#include <vector>
#undef NO_INLINE // to avoid GCC warning
#include "search/filter.hpp"
////////////////////////////////////////////////////////////////////////////////
@ -62,6 +63,18 @@ class ByExpression;
namespace tests {
void init(bool withICU = false);
template <typename T, typename U>
std::shared_ptr<T> scopedPtr(T*& ptr, U* newValue) {
auto* location = &ptr;
auto* oldValue = ptr;
ptr = newValue;
return std::shared_ptr<T>(oldValue, [location](T* p)->void { *location = p; });
}
// @Note: once V8 is initialized all 'CATCH' errors will result in SIGILL
void v8Init();
v8::Isolate* v8Isolate();
bool assertRules(