My 11th 2023 update

This commit is contained in:
Ned Wright
2023-05-11 18:54:44 +00:00
parent 240f58217a
commit 29bd82d125
92 changed files with 9301 additions and 135 deletions

View File

@@ -39,6 +39,8 @@ public:
Package::ChecksumTypes checksum_type,
const std::string &service_name
) const = 0;
virtual std::string getProfileFromMap(const std::string &tenant_id) const = 0;
};
#endif // __I_DOWNLOADER_H__

View File

@@ -0,0 +1,30 @@
#ifndef ___I_KEYWORDS_RULE_H__
#define ___I_KEYWORDS_RULE_H__
#include <memory>
#include <string>
#include "maybe_res.h"
class I_KeywordsRule
{
public:
class VirtualRule
{
public:
virtual ~VirtualRule() {};
virtual bool isMatch() const = 0;
};
virtual Maybe<std::shared_ptr<VirtualRule>> genRule(const std::string &rule) = 0;
static const std::string & getKeywordsRuleTag() { return keywords_tag; }
protected:
virtual ~I_KeywordsRule() {}
private:
static std::string keywords_tag;
};
#endif // ___I_KEYWORDS_RULE_H__

View File

@@ -111,6 +111,10 @@ public:
virtual bool removeFile(const std::string &path) const = 0;
virtual bool copyFile(const std::string &src_path, const std::string &dst_path) const = 0;
virtual bool doesFileExist(const std::string &file_path) const = 0;
virtual void fillKeyInJson(
const std::string &filename,
const std::string &_key,
const std::string &_val) const = 0;
virtual bool createDirectory(const std::string &directory_path) const = 0;
virtual bool doesDirectoryExist(const std::string &dir_path) const = 0;
virtual bool executeCmd(const std::string &cmd) const = 0;

View File

@@ -0,0 +1,35 @@
#ifndef __IPS_COMP_H__
#define __IPS_COMP_H__
#include "singleton.h"
#include "i_keywords_rule.h"
#include "i_table.h"
#include "i_http_manager.h"
#include "i_environment.h"
#include "http_inspection_events.h"
#include "i_generic_rulebase.h"
#include "component.h"
class IPSComp
:
public Component,
Singleton::Consume<I_KeywordsRule>,
Singleton::Consume<I_Table>,
Singleton::Consume<I_Environment>,
Singleton::Consume<I_GenericRulebase>
{
public:
IPSComp();
~IPSComp();
void preload();
void init();
void fini();
private:
class Impl;
std::unique_ptr<Impl> pimpl;
};
#endif // __IPS_COMP_H__

View File

@@ -0,0 +1,28 @@
#ifndef __KEYWORD_COMP__
#define __KEYWORD_COMP__
#include <memory>
#include "singleton.h"
#include "i_environment.h"
#include "i_table.h"
#include "i_keywords_rule.h"
#include "component.h"
class KeywordComp
:
public Component,
Singleton::Provide<I_KeywordsRule>,
Singleton::Consume<I_Table>,
Singleton::Consume<I_Environment>
{
public:
KeywordComp();
~KeywordComp();
private:
class Impl;
std::unique_ptr<Impl> pimpl;
};
#endif // __KEYWORD_COMP__

View File

@@ -0,0 +1,13 @@
#ifndef __OUTPUT_H__
#define __OUTPUT_H__
#include <string>
namespace infra
{
std::string printChar(char ch);
} // namespace infra
#endif // __OUTPUT_H__