mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Extends the direct access model to other collections
This commit is contained in:
committed by
Felipe Zimmerle
parent
ca24b6bb06
commit
f2d149fc5f
@@ -50,7 +50,7 @@ class Collection {
|
||||
|
||||
virtual void del(const std::string& key) = 0;
|
||||
|
||||
virtual std::string* resolveFirst(const std::string& var) = 0;
|
||||
virtual std::unique_ptr<std::string> resolveFirst(const std::string& var) = 0;
|
||||
|
||||
virtual void resolveSingleMatch(const std::string& var,
|
||||
std::vector<const Variable *> *l) = 0;
|
||||
@@ -83,7 +83,7 @@ class Collection {
|
||||
del(nkey);
|
||||
}
|
||||
|
||||
virtual std::string* resolveFirst(const std::string& var,
|
||||
virtual std::unique_ptr<std::string> resolveFirst(const std::string& var,
|
||||
std::string compartment) {
|
||||
std::string nkey = compartment + "::" + var;
|
||||
return resolveFirst(nkey);
|
||||
|
@@ -56,8 +56,8 @@ class Collections :
|
||||
bool storeOrUpdateFirst(const std::string &key, const std::string &value);
|
||||
bool updateFirst(const std::string &key, const std::string &value);
|
||||
void del(const std::string& key);
|
||||
std::string* resolveFirst(const std::string& var);
|
||||
std::string* resolveFirst(const std::string& collectionName,
|
||||
std::unique_ptr<std::string> resolveFirst(const std::string& var);
|
||||
std::unique_ptr<std::string> resolveFirst(const std::string& collectionName,
|
||||
const std::string& var);
|
||||
|
||||
void resolveSingleMatch(const std::string& var,
|
||||
|
@@ -40,22 +40,28 @@ class Variable {
|
||||
m_key(key),
|
||||
m_value(),
|
||||
m_dynamic_value(false),
|
||||
m_dynamic_key(false),
|
||||
m_dynamic(true) { }
|
||||
Variable(const std::string *key, const std::string *value) :
|
||||
m_key(key),
|
||||
m_value(value),
|
||||
m_dynamic_value(false),
|
||||
m_dynamic_key(false),
|
||||
m_dynamic(true) { }
|
||||
|
||||
~Variable() {
|
||||
if (m_dynamic_value) {
|
||||
delete m_value;
|
||||
}
|
||||
if (m_dynamic_key) {
|
||||
delete m_key;
|
||||
}
|
||||
}
|
||||
|
||||
const std::string *m_key;
|
||||
const std::string *m_value;
|
||||
bool m_dynamic_value;
|
||||
bool m_dynamic_key;
|
||||
bool m_dynamic;
|
||||
std::list<std::unique_ptr<VariableOrigin>> m_orign;
|
||||
};
|
||||
|
Reference in New Issue
Block a user