Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
7bdbefb
feat: add stub for security snap-in
august-alt Jul 25, 2023
cff4596
feat: add empty schemas
august-alt Jul 25, 2023
c530466
feat: add security xsd schema
august-alt Jul 31, 2023
70992c4
feat: update security schema
august-alt Aug 1, 2023
087ef1c
feat: add sdml and sdmx plugin files
august-alt Aug 1, 2023
f485735
feat: add generated code to repository
august-alt Aug 2, 2023
ba01c02
chore: refactor security elements
august-alt Aug 3, 2023
b74f992
chore: move files
august-alt Aug 3, 2023
1767003
feat: add ui elements placeholder
august-alt Aug 3, 2023
379d0c8
feat: add security test data
august-alt Aug 4, 2023
51643b4
fix: security definitions
august-alt Aug 4, 2023
f19e65e
feat: add sdmx adapters implementation
august-alt Aug 4, 2023
322dfa9
feat: add sdml code
august-alt Aug 4, 2023
d9868fe
chore: add q_unused to file variable
august-alt Aug 7, 2023
2493fc0
feat: update schema
august-alt Aug 7, 2023
eb33abe
fix: update security definitions
august-alt Aug 7, 2023
a9035e9
feat: add basefile
august-alt Aug 7, 2023
23605a9
chore: refactor sdmx/sdml to use basefile
august-alt Aug 7, 2023
14862b4
fix: update sdml structures
august-alt Aug 7, 2023
395f6c2
fix: add reference in loop
august-alt Aug 7, 2023
cea294c
fix: udpate schema
august-alt Aug 8, 2023
d770b13
fix: update sdmx
august-alt Aug 8, 2023
2e9093b
feat: udpate sdml element
august-alt Aug 8, 2023
a11db05
feat: update sdml format
august-alt Aug 8, 2023
2d89dca
feat: update security widget
august-alt Aug 15, 2023
8653222
feat: implement first version of security proxy model
august-alt Aug 15, 2023
1084238
feat: add presentation builder for security
august-alt Aug 15, 2023
9db06e6
feat!: switch c++ standard to c++17
august-alt Aug 15, 2023
5344269
feat: add security bundle
august-alt Aug 15, 2023
7ecdd4b
feat: update security definitions
august-alt Aug 16, 2023
8301ac4
feat: implement basic security bundle
august-alt Aug 16, 2023
912381c
chore: refactor sdml format
august-alt Aug 17, 2023
0157bd5
feat: update sdml format
august-alt Aug 17, 2023
f7d4353
wip: update sdml format plugin
august-alt Aug 17, 2023
85673b8
chore: update types in sdml format
august-alt Aug 17, 2023
564d84f
feat: add new widgets to presentation widget
august-alt Aug 18, 2023
e866c42
feat: implement radio button
august-alt Aug 18, 2023
9f42129
feat: implement ldap search dialog in sdml plugin
august-alt Aug 21, 2023
fbb63ad
feat: implement radio button in sdml format
august-alt Aug 21, 2023
212a653
feat: implement group box in sdml
august-alt Aug 21, 2023
d3b7ccc
feat: add ldap search widget and browse dialog
august-alt Aug 22, 2023
e8a6869
feat: implement ldap search widget in presentation builder
august-alt Aug 22, 2023
bc8d50b
feat: update groupbox in presentation builder
august-alt Aug 22, 2023
d008418
feat: update multi text element
august-alt Aug 22, 2023
91d8e1f
feat: update browse ldap dialog
august-alt Aug 22, 2023
33edcf0
fix: security widget
august-alt Aug 28, 2023
93da03e
feat: update security bundle
august-alt Aug 28, 2023
9c3d4eb
feat: add ids for security model
august-alt Aug 29, 2023
f1deef7
feat: add translations to security plugin
august-alt Aug 29, 2023
f21f3e1
fix: fix basefile implementation
august-alt Aug 30, 2023
084959c
fix: fix sdml plugin
august-alt Aug 30, 2023
875974f
fix: fix sdmx plugin
august-alt Aug 30, 2023
399018b
chore: update sdml format
august-alt Aug 31, 2023
d11e59d
chore: update sdmx format
august-alt Aug 31, 2023
83654c8
fix: fix multiple schema issues
august-alt Aug 31, 2023
83d6597
fix: fix security schema
august-alt Aug 31, 2023
b7ebebe
fix: fix presentation
august-alt Aug 31, 2023
8db298c
fix: remove label from layout in security widget
august-alt Sep 1, 2023
354e8fb
fix: fix signal name in ldap search widget
august-alt Sep 1, 2023
51884dd
feat: add group box to ldap search widget
august-alt Sep 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gear/gpui.spec
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ LD_PRELOAD=%buildroot%_libdir/gpui/plugins/libadministrative-templates-plugin.so
%_libdir/gpui/plugins/libreg-plugin.so
%_libdir/gpui/plugins/libspol-plugin.so
%_libdir/gpui/plugins/libpol-plugin.so
%_libdir/gpui/plugins/libsdml-plugin.so
%_libdir/gpui/plugins/libsdmx-plugin.so
%_libdir/gpui/plugins/libscripts-plugin.so
%_libdir/gpui/plugins/libsecurity-plugin.so

%_libdir/gpui/plugins/libsmb-storage-plugin.so

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,7 @@ src/plugins/cmtl/schema/*.cpp
src/plugins/cmtl/schema/*.h
src/plugins/cmtx/schema/*.cpp
src/plugins/cmtx/schema/*.h
src/plugins/security/schema/*.cpp
src/plugins/security/schema/*.h
*.translations.qrc
src/core/version.h
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ execute_process(
OUTPUT_VARIABLE GPUI_GEAR_VERSION
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

string(REPLACE "." ";" GEAR_VERSION_LIST ${GPUI_GEAR_VERSION})
list(GET GEAR_VERSION_LIST 0 GPUI_VERSION_MAJOR)
list(GET GEAR_VERSION_LIST 1 GPUI_VERSION_MINOR)
Expand Down
2 changes: 2 additions & 0 deletions src/io/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
find_package(Qt5 COMPONENTS Core REQUIRED)

set(HEADERS
basefile.h
basefile.inl
genericfile.h
genericfile.inl
genericreader.h
Expand Down
66 changes: 66 additions & 0 deletions src/io/basefile.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/***********************************************************************************************************************
**
** Copyright (C) 2023 BaseALT Ltd. <org@basealt.ru>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
***********************************************************************************************************************/

#ifndef GPUI_BASEFILE_H
#define GPUI_BASEFILE_H

#include "io.h"

#include "genericfile.h"
#include "policyfileformat.h"

#include <memory>

namespace io {
template <typename TContent>
class BaseFilePrivate;

template <typename TContent>
class GPUI_IO_EXPORT BaseFile : public GenericFile<BaseFile<TContent>, PolicyFileFormat<BaseFile<TContent>>>
{
public:
BaseFile();

~BaseFile();

void add(std::shared_ptr<TContent> resources);

void remove(std::shared_ptr<TContent> resources);

std::vector<std::shared_ptr<TContent>> getAll();

size_t count();

std::shared_ptr<TContent> get(const size_t index);

private:
BaseFile(const BaseFile&) = delete; // copy ctor
BaseFile(BaseFile&&) = delete; // move ctor
BaseFile& operator=(const BaseFile&) = delete; // copy assignment
BaseFile& operator=(BaseFile&&) = delete; // move assignment

private:
BaseFilePrivate<TContent>* const d;
};
}

#include "basefile.inl"

#endif // GPUI_BASEFILE_H
112 changes: 112 additions & 0 deletions src/io/basefile.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/***********************************************************************************************************************
**
** Copyright (C) 2023 BaseALT Ltd. <org@basealt.ru>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
***********************************************************************************************************************/

#include <algorithm>

namespace io
{

template <typename TContent>
class BaseFilePrivate
{
public:
std::vector<std::shared_ptr<TContent>> definitions = {};
};

/*!
* \class BaseFile BaseFile.h
* \brief The BaseFile class represents a policy file.
* \ingroup io
*
* The BaseFile class provides a container for definitions.
*/
template <typename TContent>
BaseFile<TContent>::BaseFile()
: GenericFile<BaseFile, PolicyFileFormat<BaseFile>>()
, d(new BaseFilePrivate<TContent>())
{}

template <typename TContent>
BaseFile<TContent>::~BaseFile()
{
delete d;
}

/*!
* \brief BaseFile<TContent>::addPolicyDefinitions Adds definitions to the file.
* \param policyDefinitions Policy definitions to add.
*/
template <typename TContent>
void BaseFile<TContent>::add(std::shared_ptr<TContent> definitions)
{
d->definitions.emplace_back(definitions);
}

/*!
* \brief BaseFile<TContent>::removePolicyDefinitions Removes policy definitions from the file.
* \param policyDefinitions Policy definitions to remove.
*/
template <typename TContent>
void BaseFile<TContent>::remove(std::shared_ptr<TContent> definitions)
{
d->definitions.erase(std::remove_if(d->definitions.begin(),
d->definitions.end(),
[definitions](std::shared_ptr<TContent> currentPolicy) {
return currentPolicy == definitions;
}));
}

/*!
* \brief BaseFile<TContent>::getAllPolicyDefinitions Returns all definitions from the file.
* \return
*/
template <typename TContent>
std::vector<std::shared_ptr<TContent>> BaseFile<TContent>::getAll()
{
return d->definitions;
}

/*!
* \brief BaseFile<TContent>::policyDefinitionsCount Return number of definitions in current file.
* \return Amount of policy definitions in current file.
*/
template <typename TContent>
size_t BaseFile<TContent>::count()
{
return d->definitions.size();
}

/*!
* \brief BaseFile<TContent>::getPolicyDefinitions Returns a definition by index.
* \param index Index of a definitions.
* \return If definitions are found than returns definitions otherwise retruns null pointer.
*/
template <typename TContent>
std::shared_ptr<TContent> BaseFile<TContent>::get(const size_t index)
{
if (index < d->definitions.size())
{
return d->definitions[index];
}

return std::shared_ptr<TContent>(nullptr);
}

} // namespace io
3 changes: 3 additions & 0 deletions src/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ add_subdirectory(ini)
add_subdirectory(pol)
add_subdirectory(preferences)
add_subdirectory(reg)
add_subdirectory(sdml)
add_subdirectory(sdmx)
add_subdirectory(scripts)
add_subdirectory(security)
add_subdirectory(spol)
add_subdirectory(storage)
4 changes: 4 additions & 0 deletions src/plugins/scripts/scriptstreemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ void ScriptsTreeModel::populateModel()
machineNamespace->setProperty(ScriptsFolderItem::CATEGORY, true);

auto machineSystemSettings = insertItem<ScriptsFolderItem>(machineNamespace);
auto machineSystemUuid = QUuid("{123e4567-e89b-12d3-a456-426652340010}");
machineSystemSettings->setDisplayName(QObject::tr("System settings").toStdString());
machineSystemSettings->setProperty(ScriptsFolderItem::NODE_ID, machineSystemUuid);
machineSystemSettings->setProperty(ScriptsFolderItem::PARENT_ID, machineUuid);
machineSystemSettings->setProperty(ScriptsFolderItem::HELP_MSG,
QObject::tr("System settings for computer").toStdString());
Expand All @@ -110,7 +112,9 @@ void ScriptsTreeModel::populateModel()
userNamespace->setProperty(ScriptsFolderItem::CATEGORY, true);

auto userSystemSetting = insertItem<ScriptsFolderItem>(userNamespace);
auto userSystemUuid = QUuid("{123e4567-e89b-12d3-a456-426652340011}");
userSystemSetting->setDisplayName(QObject::tr("System settings").toStdString());
userSystemSetting->setProperty(ScriptsFolderItem::NODE_ID, userSystemUuid);
userSystemSetting->setProperty(ScriptsFolderItem::PARENT_ID, userUuid);
userSystemSetting->setProperty(ScriptsFolderItem::HELP_MSG,
QObject::tr("System settings for user").toStdString());
Expand Down
24 changes: 24 additions & 0 deletions src/plugins/sdml/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
find_package(GPUI COMPONENTS core io REQUIRED)
include_directories(${GPUI_INCLUDE_DIRS})

find_package(Qt5 COMPONENTS Core REQUIRED)

set(PLUGIN_NAME "sdml-plugin")

set(HEADERS
sdmlformat.h
)

set(SOURCES
sdmlformat.cpp
sdmlplugin.cpp
)

set(SOURCES ${SOURCES} ${HEADERS})

add_gpui_plugin(${PLUGIN_NAME} ${SOURCES})
target_link_libraries(${PLUGIN_NAME} Qt5::Core)
target_link_libraries(${PLUGIN_NAME} ${GPUI_LIBRARIES})
target_link_libraries(${PLUGIN_NAME} policy-common)
target_link_libraries(${PLUGIN_NAME} security_static_xsd_library)
target_link_libraries(${PLUGIN_NAME} xerces-c)
Loading