mirror of
https://github.com/QuasarApp/SecretService.git
synced 2025-04-26 22:04:33 +00:00
use simple tool instead service
This commit is contained in:
parent
b66dab26bc
commit
e73ec2adc4
@ -35,7 +35,6 @@ set(SECRETSERVICE_VERSION "0.${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH}")
|
||||
set(SECRETSERVICE_PACKAGE_ID "quasarapp.core.secretservice")
|
||||
|
||||
option(SECRETSERVICE_TESTS "This option disables or enables tests of the ${PROJECT_NAME} project" ON)
|
||||
option(SECRETSERVICE_EXAMPLE "This option disables or enables example app of the ${PROJECT_NAME} project" ON)
|
||||
|
||||
if (ANDROID OR IOS OR QA_WASM32)
|
||||
set(SECRETSERVICE_TESTS OFF CACHE BOOL "This option force disbled for ANDROID IOS QA_WASM32 and Not Qt projects" FORCE)
|
||||
@ -56,13 +55,8 @@ add_subdirectory(src/db)
|
||||
add_subdirectory(src/core)
|
||||
|
||||
set(PATRONUM_TESTS OFF)
|
||||
add_subdirectory(submodules/Patronum)
|
||||
add_subdirectory(src/service)
|
||||
|
||||
if (DEFINED SECRETSERVICE_EXAMPLE)
|
||||
add_subdirectory(src/example)
|
||||
endif()
|
||||
|
||||
if (SECRETSERVICE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
else()
|
||||
|
@ -27,11 +27,7 @@ SecretDataBase::SecretDataBase() {
|
||||
}
|
||||
|
||||
QVariantMap SecretDataBase::defaultDbParams() const {
|
||||
return {
|
||||
{QH_DB_DRIVER, "QSQLITE"},
|
||||
{QH_DB_FILE_PATH, QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/QASecret.sqlite" },
|
||||
{QH_DB_BACKUP_PATH, QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/QASecretBackUps"}
|
||||
};
|
||||
return QH::DataBase::defaultDbParams();
|
||||
}
|
||||
|
||||
QSharedPointer<iRecord>
|
||||
|
@ -1,42 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2024-2024 QuasarApp.
|
||||
# Distributed under the GPLv3 software license, see the accompanying
|
||||
# Everyone is permitted to copy and distribute verbatim copies
|
||||
# of this license document, but changing it is not allowed.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
get_filename_component(CURRENT_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
|
||||
set(CURRENT_PROJECT "${PROJECT_NAME}_${CURRENT_PROJECT_DIR}")
|
||||
option(SIGN_APP "This option enable od disabled sign apk and aab files" ON)
|
||||
|
||||
file(GLOB_RECURSE SOURCE_CPP
|
||||
"*.cpp" "*.h"
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE SOURCE_QRC
|
||||
"*.qrc"
|
||||
)
|
||||
|
||||
set(ALL_SOURCES ${SOURCE_CPP} ${SOURCE_QRC})
|
||||
|
||||
set(PUBLIC_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
set(PRIVATE_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/private")
|
||||
|
||||
updateGitVars()
|
||||
|
||||
qt_add_executable(${CURRENT_PROJECT} ${ALL_SOURCES})
|
||||
|
||||
target_link_libraries(${CURRENT_PROJECT} PUBLIC ${PROJECT_NAME})
|
||||
|
||||
target_include_directories(${CURRENT_PROJECT} PUBLIC ${PUBLIC_INCUDE_DIR})
|
||||
target_include_directories(${CURRENT_PROJECT} PRIVATE ${PRIVATE_INCUDE_DIR})
|
||||
|
||||
SET(TARGET_DIR "${CMAKE_SOURCE_DIR}/Distro")
|
||||
file(MAKE_DIRECTORY ${TARGET_DIR})
|
||||
|
||||
|
||||
|
@ -1,35 +0,0 @@
|
||||
//#
|
||||
//# Copyright (C) 2024-2024 QuasarApp.
|
||||
//# Distributed under the GPLv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
//#
|
||||
|
||||
#include "params.h"
|
||||
#include <QASecret.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
#include <QASecret/keystorage.h>
|
||||
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
|
||||
QCoreApplication app(argc, argv);
|
||||
QASecret::init();
|
||||
|
||||
auto service = QASecret::KeyStorage::instance();
|
||||
|
||||
QTimer::singleShot(0, nullptr, [service]() {
|
||||
auto hash = service->add("val");
|
||||
auto val = service->get(hash);
|
||||
|
||||
if (val == "val") {
|
||||
QuasarAppUtils::Params::log("All is fine!", QuasarAppUtils::Info);
|
||||
}
|
||||
|
||||
QCoreApplication::quit();
|
||||
});
|
||||
|
||||
|
||||
return app.exec();
|
||||
}
|
@ -30,7 +30,7 @@ updateGitVars()
|
||||
|
||||
qt_add_executable(${CURRENT_PROJECT} ${ALL_SOURCES})
|
||||
|
||||
target_link_libraries(${CURRENT_PROJECT} PUBLIC ${PROJECT_NAME} Patronum)
|
||||
target_link_libraries(${CURRENT_PROJECT} PUBLIC ${PROJECT_NAME})
|
||||
|
||||
target_include_directories(${CURRENT_PROJECT} PUBLIC ${PUBLIC_INCUDE_DIR})
|
||||
target_include_directories(${CURRENT_PROJECT} PRIVATE ${PRIVATE_INCUDE_DIR})
|
||||
|
@ -2,21 +2,9 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Service is stoped. Please use the start command.</source>
|
||||
<source>Service is not initialized.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -31,44 +19,27 @@
|
||||
<source>You forget a data. please use the next command add -data yourDataString</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of removable data. Please use the next command remove -hash yourHash or remove -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<message>
|
||||
<source>This is description of the ping command</source>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Returns state</source>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Adds new value into seret storage, and return a hash key after adding.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove data from storage by hash key or alias.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>return secret from database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alias name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data that will be saved</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hash kay of data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -2,21 +2,9 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Service is stoped. Please use the start command.</source>
|
||||
<source>Service is not initialized.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -31,44 +19,27 @@
|
||||
<source>You forget a data. please use the next command add -data yourDataString</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of removable data. Please use the next command remove -hash yourHash or remove -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<message>
|
||||
<source>This is description of the ping command</source>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Returns state</source>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Adds new value into seret storage, and return a hash key after adding.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove data from storage by hash key or alias.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>return secret from database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alias name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data that will be saved</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hash kay of data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -2,21 +2,9 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Service is stoped. Please use the start command.</source>
|
||||
<source>Service is not initialized.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -31,44 +19,27 @@
|
||||
<source>You forget a data. please use the next command add -data yourDataString</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of removable data. Please use the next command remove -hash yourHash or remove -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<message>
|
||||
<source>This is description of the ping command</source>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Returns state</source>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Adds new value into seret storage, and return a hash key after adding.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove data from storage by hash key or alias.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>return secret from database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alias name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data that will be saved</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hash kay of data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -2,21 +2,9 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Service is stoped. Please use the start command.</source>
|
||||
<source>Service is not initialized.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -31,44 +19,27 @@
|
||||
<source>You forget a data. please use the next command add -data yourDataString</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of removable data. Please use the next command remove -hash yourHash or remove -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<message>
|
||||
<source>This is description of the ping command</source>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Returns state</source>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Adds new value into seret storage, and return a hash key after adding.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove data from storage by hash key or alias.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>return secret from database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alias name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data that will be saved</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hash kay of data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -2,21 +2,9 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Service is stoped. Please use the start command.</source>
|
||||
<source>Service is not initialized.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -31,44 +19,27 @@
|
||||
<source>You forget a data. please use the next command add -data yourDataString</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of removable data. Please use the next command remove -hash yourHash or remove -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<message>
|
||||
<source>This is description of the ping command</source>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Returns state</source>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Adds new value into seret storage, and return a hash key after adding.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove data from storage by hash key or alias.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>return secret from database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alias name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data that will be saved</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hash kay of data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -2,21 +2,9 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Service is stoped. Please use the start command.</source>
|
||||
<source>Service is not initialized.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -31,44 +19,27 @@
|
||||
<source>You forget a data. please use the next command add -data yourDataString</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of removable data. Please use the next command remove -hash yourHash or remove -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<message>
|
||||
<source>This is description of the ping command</source>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Returns state</source>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Adds new value into seret storage, and return a hash key after adding.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove data from storage by hash key or alias.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>return secret from database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alias name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data that will be saved</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hash kay of data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -2,21 +2,9 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Service is stoped. Please use the start command.</source>
|
||||
<source>Service is not initialized.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -31,44 +19,27 @@
|
||||
<source>You forget a data. please use the next command add -data yourDataString</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of removable data. Please use the next command remove -hash yourHash or remove -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<message>
|
||||
<source>This is description of the ping command</source>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Returns state</source>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Adds new value into seret storage, and return a hash key after adding.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove data from storage by hash key or alias.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>return secret from database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alias name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data that will be saved</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hash kay of data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -2,21 +2,9 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Service is stoped. Please use the start command.</source>
|
||||
<source>Service is not initialized.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -31,44 +19,27 @@
|
||||
<source>You forget a data. please use the next command add -data yourDataString</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of removable data. Please use the next command remove -hash yourHash or remove -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<message>
|
||||
<source>This is description of the ping command</source>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Returns state</source>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Adds new value into seret storage, and return a hash key after adding.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove data from storage by hash key or alias.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>return secret from database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alias name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data that will be saved</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hash kay of data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -2,21 +2,9 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Service is stoped. Please use the start command.</source>
|
||||
<source>Service is not initialized.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -31,44 +19,27 @@
|
||||
<source>You forget a data. please use the next command add -data yourDataString</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of removable data. Please use the next command remove -hash yourHash or remove -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<message>
|
||||
<source>This is description of the ping command</source>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Returns state</source>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Adds new value into seret storage, and return a hash key after adding.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove data from storage by hash key or alias.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>return secret from database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alias name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data that will be saved</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hash kay of data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -2,21 +2,9 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Service is stoped. Please use the start command.</source>
|
||||
<source>Service is not initialized.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -31,44 +19,27 @@
|
||||
<source>You forget a data. please use the next command add -data yourDataString</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of removable data. Please use the next command remove -hash yourHash or remove -alias yourAlias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QuasarAppUtils::Locales</name>
|
||||
<message>
|
||||
<source>This is description of the ping command</source>
|
||||
<source>This bot is still under development.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Returns state</source>
|
||||
<source>We are working very hard on our new delivery service to make it as easy as possible for you to be with us wherever you are.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Adds new value into seret storage, and return a hash key after adding.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove data from storage by hash key or alias.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>return secret from database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alias name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data that will be saved</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hash kay of data</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You forget a hash key of alias of getting data. Please use the next command get -hash yourHash or get -alias yourAlias</source>
|
||||
<source>Thank you for your wait.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -5,14 +5,111 @@
|
||||
//# of this license document, but changing it is not allowed.
|
||||
//#
|
||||
|
||||
#include <secretservice.h>
|
||||
#include <QASecret.h>
|
||||
#include <QASecret/keystorage.h>
|
||||
#include <QTimer>
|
||||
#include <QCoreApplication>
|
||||
#include "params.h"
|
||||
|
||||
bool processRequest() {
|
||||
auto storage = QASecret::KeyStorage::instance();
|
||||
|
||||
if (!storage) {
|
||||
QuasarAppUtils::Params::log(QObject::tr("Service is not initialized."));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fAdd = QuasarAppUtils::Params::isEndable("add");
|
||||
bool fRemove = QuasarAppUtils::Params::isEndable("remove");
|
||||
bool fGet = QuasarAppUtils::Params::isEndable("get");
|
||||
|
||||
int actionsCount = fAdd + fRemove + fGet;
|
||||
if (actionsCount > 1) {
|
||||
QuasarAppUtils::Params::log(QObject::tr("You are try to run multiple commands. please choose some of pleas choose one."),
|
||||
QuasarAppUtils::Error);
|
||||
return false;
|
||||
} else if (!actionsCount) {
|
||||
QuasarAppUtils::Params::log(QObject::tr("please choose one of available actions add/remove/get"),
|
||||
QuasarAppUtils::Error);
|
||||
return false;
|
||||
};
|
||||
|
||||
if (fAdd) {
|
||||
const auto&& dataVal = QuasarAppUtils::Params::getArg("data");
|
||||
const auto&& aliasVal = QuasarAppUtils::Params::getArg("alias");
|
||||
|
||||
if (dataVal.isEmpty()) {
|
||||
QuasarAppUtils::Params::log(QObject::tr("You forget a data. please use the next command add -data yourDataString"),
|
||||
QuasarAppUtils::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
QuasarAppUtils::Params::log(storage->add(dataVal.toLatin1(), aliasVal),
|
||||
QuasarAppUtils::VerboseLvl::Info);
|
||||
|
||||
} else if ( fGet) {
|
||||
|
||||
const auto&& hashVal = QuasarAppUtils::Params::getArg("hash");
|
||||
const auto&& aliasVal = QuasarAppUtils::Params::getArg("alias");
|
||||
|
||||
if (hashVal.isEmpty() && aliasVal.isEmpty()) {
|
||||
QuasarAppUtils::Params::log(QObject::tr("You forget a hash key of alias of getting data. "
|
||||
"Please use the next command get -hash yourHash or "
|
||||
"get -alias yourAlias"), QuasarAppUtils::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hashVal.size()) {
|
||||
QuasarAppUtils::Params::log(storage->get(hashVal.toLatin1()),
|
||||
QuasarAppUtils::VerboseLvl::Info);
|
||||
} else if (aliasVal.size()) {
|
||||
QuasarAppUtils::Params::log(storage->get(aliasVal),
|
||||
QuasarAppUtils::VerboseLvl::Info);
|
||||
}
|
||||
|
||||
} else if (fRemove) {
|
||||
|
||||
const auto&& hashVal = QuasarAppUtils::Params::getArg("hash");
|
||||
const auto&& aliasVal = QuasarAppUtils::Params::getArg("alias");
|
||||
|
||||
if (hashVal.isEmpty() && aliasVal.isEmpty()) {
|
||||
QuasarAppUtils::Params::log(QObject::tr("You forget a hash key of alias of removable data. "
|
||||
"Please use the next command remove -hash yourHash or "
|
||||
"remove -alias yourAlias"), QuasarAppUtils::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hashVal.size()) {
|
||||
storage->remove(hashVal.toLatin1());
|
||||
} else if (aliasVal.size()) {
|
||||
storage->remove(aliasVal);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
QCoreApplication::setApplicationName("QASecret");
|
||||
QCoreApplication::setOrganizationName("QuasarApp");
|
||||
|
||||
SecretService service(argc, argv);
|
||||
QuasarAppUtils::Params::parseParams(argc, argv);
|
||||
QCoreApplication app(argc, argv);
|
||||
QASecret::init();
|
||||
|
||||
return service.exec();
|
||||
QTimer::singleShot(0, nullptr, []() {
|
||||
|
||||
if (!processRequest()) {
|
||||
QCoreApplication::exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
QCoreApplication::quit();
|
||||
});
|
||||
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
@ -1,143 +0,0 @@
|
||||
//#
|
||||
//# Copyright (C) 2024-2024 QuasarApp.
|
||||
//# Distributed under the GPLv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
//#
|
||||
|
||||
#include "secretservice.h"
|
||||
#include <QASecret.h>
|
||||
#include <SecretDB.h>
|
||||
#include <QASecret/keystorage.h>
|
||||
|
||||
SecretService::SecretService(int argc, char **argv):
|
||||
Patronum::Service<QCoreApplication>(argc, argv) {
|
||||
|
||||
}
|
||||
|
||||
bool SecretService::onStart() {
|
||||
// call on server started
|
||||
QASecret::init();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SecretService::onStop() {
|
||||
// call on server stoped
|
||||
QASecret::KeyStorage::deinitService();
|
||||
|
||||
}
|
||||
|
||||
void SecretService::handleReceiveData(const QHash<QString, Patronum::Feature> &data) {
|
||||
auto storage = QASecret::KeyStorage::instance();
|
||||
|
||||
if (!storage) {
|
||||
sendResuylt(QuasarAppUtils::Locales::tr("Service is stoped. Please use the start command."));
|
||||
return;
|
||||
}
|
||||
|
||||
bool fAdd = data.contains("add");
|
||||
bool fRemove = data.contains("remove");
|
||||
bool fGet = data.contains("get");
|
||||
|
||||
int actionsCount = fAdd + fRemove + fGet;
|
||||
if (actionsCount > 1) {
|
||||
sendResuylt(QuasarAppUtils::Locales::tr("You are try to run multiple commands. please choose some of pleas choose one."));
|
||||
return;
|
||||
} else if (data.isEmpty()) {
|
||||
sendResuylt(QuasarAppUtils::Locales::tr("please choose one of available actions add/remove/get"));
|
||||
return;
|
||||
};
|
||||
|
||||
if (fAdd) {
|
||||
const auto&& dataVal = data.value("data").arg();
|
||||
const auto&& aliasVal = data.value("alias").arg();
|
||||
|
||||
if (dataVal.isEmpty()) {
|
||||
sendResuylt(QuasarAppUtils::Locales::tr("You forget a data. please use the next command add -data yourDataString"));
|
||||
return;
|
||||
}
|
||||
|
||||
sendRawResuylt(storage->add(dataVal.toLatin1(), aliasVal));
|
||||
|
||||
} else if ( fGet) {
|
||||
|
||||
const auto&& hashVal = data.value("hash").arg();
|
||||
const auto&& aliasVal = data.value("alias").arg();
|
||||
|
||||
if (hashVal.isEmpty() && aliasVal.isEmpty()) {
|
||||
sendResuylt(QuasarAppUtils::Locales::tr("You forget a hash key of alias of getting data. "
|
||||
"Please use the next command get -hash yourHash or "
|
||||
"get -alias yourAlias"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (hashVal.size()) {
|
||||
sendRawResuylt(storage->get(hashVal.toLatin1()));
|
||||
} else if (aliasVal.size()) {
|
||||
sendRawResuylt(storage->get(aliasVal));
|
||||
}
|
||||
|
||||
} else if (fRemove) {
|
||||
|
||||
const auto&& hashVal = data.value("hash").arg();
|
||||
const auto&& aliasVal = data.value("alias").arg();
|
||||
|
||||
if (hashVal.isEmpty() && aliasVal.isEmpty()) {
|
||||
sendResuylt(QuasarAppUtils::Locales::tr("You forget a hash key of alias of removable data. "
|
||||
"Please use the next command remove -hash yourHash or "
|
||||
"remove -alias yourAlias"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (hashVal.size()) {
|
||||
storage->remove(hashVal.toLatin1());
|
||||
} else if (aliasVal.size()) {
|
||||
storage->remove(aliasVal);
|
||||
}
|
||||
|
||||
} else {
|
||||
Patronum::Service<QCoreApplication>::handleReceiveData(data);
|
||||
}
|
||||
}
|
||||
|
||||
bool SecretService::handleReceive(const Patronum::Feature &data) {
|
||||
|
||||
if (data.cmd() == "ping") {
|
||||
sendResuylt("Pong");
|
||||
} else if (data.cmd() == "state") {
|
||||
auto storage = QASecret::KeyStorage::instance();
|
||||
|
||||
if (storage) {
|
||||
sendResuylt("application status: Active");
|
||||
} else {
|
||||
sendResuylt("application status: Stoped");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QSet<Patronum::Feature> SecretService::supportedFeatures() {
|
||||
QSet<Patronum::Feature> data;
|
||||
|
||||
data << Patronum::Feature("ping", {}, QuasarAppUtils::Locales::tr("This is description of the ping command"));
|
||||
data << Patronum::Feature("state", {}, QuasarAppUtils::Locales::tr("Returns state"));
|
||||
data << Patronum::Feature("add",
|
||||
{},
|
||||
QuasarAppUtils::Locales::tr("Adds new value into seret storage, and return a hash key after adding."),
|
||||
"QASecret add -data mysecretString -alias myCustomKey ");
|
||||
data << Patronum::Feature("remove",
|
||||
{},
|
||||
QuasarAppUtils::Locales::tr("Remove data from storage by hash key or alias."),
|
||||
"QASecret remove -hash hashKey or QASecret remove -alias myCustomKey");
|
||||
data << Patronum::Feature("get",
|
||||
{},
|
||||
QuasarAppUtils::Locales::tr("return secret from database"),
|
||||
"QASecret get -hash hashKey or QASecret get -alias myCustomKey ");
|
||||
data << Patronum::Feature("-alias", {"aliasName"}, QuasarAppUtils::Locales::tr("Alias name"));
|
||||
data << Patronum::Feature("-data", {"data"}, QuasarAppUtils::Locales::tr("Data that will be saved"));
|
||||
data << Patronum::Feature("-hash", {"hash"}, QuasarAppUtils::Locales::tr("Hash kay of data"));
|
||||
|
||||
return data;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
//#
|
||||
//# Copyright (C) 2024-2024 QuasarApp.
|
||||
//# Distributed under the GPLv3 software license, see the accompanying
|
||||
//# Everyone is permitted to copy and distribute verbatim copies
|
||||
//# of this license document, but changing it is not allowed.
|
||||
//#
|
||||
|
||||
#ifndef SECRETSERVICE_H
|
||||
#define SECRETSERVICE_H
|
||||
|
||||
#include <patronum.h>
|
||||
|
||||
/**
|
||||
* @brief The SecretService class main class
|
||||
*/
|
||||
class SecretService: public Patronum::Service<QCoreApplication>
|
||||
{
|
||||
|
||||
public:
|
||||
SecretService(int argc, char **argv);
|
||||
|
||||
bool onStart() override;
|
||||
|
||||
void onStop() override;
|
||||
|
||||
void handleReceiveData(const QHash<QString, Patronum::Feature> &data) override;
|
||||
bool handleReceive(const Patronum::Feature &data) override;
|
||||
QSet<Patronum::Feature> supportedFeatures() override;
|
||||
|
||||
};
|
||||
|
||||
#endif // SECRETSERVICE_H
|
Loading…
x
Reference in New Issue
Block a user