A validator that can be set up via a configuration file. More...
#include <ndn-cxx/security/validation-policy-config.hpp>
Public Types | |
using | ValidationContinuation = std::function< void(const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state)> |
Public Member Functions | |
virtual void | checkPolicy (const Certificate &certificate, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) |
Check certificate against the policy. More... | |
ValidationPolicy & | getInnerPolicy () |
Return the inner policy. More... | |
bool | hasInnerPolicy () const |
Check if inner policy is set. More... | |
void | load (const ConfigSection &configSection, const std::string &filename) |
Load policy from configSection . More... | |
void | load (const std::string &filename) |
Load policy from file filename . More... | |
void | load (const std::string &input, const std::string &filename) |
Load policy from direct input . More... | |
void | load (std::istream &input, const std::string &filename) |
Load policy from direct input . More... | |
void | setInnerPolicy (unique_ptr< ValidationPolicy > innerPolicy) |
Set inner policy. More... | |
void | setValidator (Validator &validator) |
Set validator to which the policy is associated. More... | |
Protected Member Functions | |
void | checkPolicy (const Data &data, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) override |
Check data against the policy. More... | |
void | checkPolicy (const Interest &interest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) override |
Check interest against the policy. More... | |
Protected Attributes | |
unique_ptr< ValidationPolicy > | m_innerPolicy |
Validator * | m_validator = nullptr |
A validator that can be set up via a configuration file.
Definition at line 40 of file validation-policy-config.hpp.
|
inherited |
Definition at line 38 of file validation-policy.hpp.
|
inlinevirtualinherited |
Check certificate
against the policy.
Unless overridden by the policy, this check defaults to checkPolicy(const Data&, ...)
.
Depending on implementation of the policy, this check can be done synchronously or asynchronously.
Semantics of checkPolicy has changed from v1::Validator
state->fail
with appropriate error code and error description.Definition at line 137 of file validation-policy.hpp.
|
overrideprotectedvirtual |
Check data
against the policy.
Depending on implementation of the policy, this check can be done synchronously or asynchronously.
Semantics of checkPolicy has changed from v1::Validator
state->fail
with appropriate error code and error description.Implements ndn::security::ValidationPolicy.
Definition at line 232 of file validation-policy-config.cpp.
|
overrideprotectedvirtual |
Check interest
against the policy.
Depending on implementation of the policy, this check can be done synchronously or asynchronously.
Semantics of checkPolicy has changed from v1::Validator
state->fail
with appropriate error code and error description.Implements ndn::security::ValidationPolicy.
Definition at line 263 of file validation-policy-config.cpp.
|
inherited |
Return the inner policy.
If the inner policy was not set, behavior is undefined.
Definition at line 47 of file validation-policy.cpp.
|
inlineinherited |
Check if inner policy is set.
Definition at line 65 of file validation-policy.hpp.
void ndn::security::validator_config::ValidationPolicyConfig::load | ( | const ConfigSection & | configSection, |
const std::string & | filename | ||
) |
Load policy from configSection
.
Definition at line 68 of file validation-policy-config.cpp.
void ndn::security::validator_config::ValidationPolicyConfig::load | ( | const std::string & | filename | ) |
Load policy from file filename
.
Definition at line 37 of file validation-policy-config.cpp.
void ndn::security::validator_config::ValidationPolicyConfig::load | ( | const std::string & | input, |
const std::string & | filename | ||
) |
Load policy from direct input
.
Definition at line 47 of file validation-policy-config.cpp.
void ndn::security::validator_config::ValidationPolicyConfig::load | ( | std::istream & | input, |
const std::string & | filename | ||
) |
Load policy from direct input
.
Definition at line 54 of file validation-policy-config.cpp.
|
inherited |
Set inner policy.
Multiple assignments of the inner policy will create a "chain" of linked policies. The inner policy from the latest invocation of setInnerPolicy will be at the bottom of the policy list.
For example, sequence of this->setInnerPolicy(policy1)
and this->setInnerPolicy(policy2)
, will result in this->m_innerPolicy == policy1
, this->m_innerPolicy->m_innerPolicy == policy2', and this->m_innerPolicy->m_innerPolicy->m_innerPolicy == nullptr
.
std::invalid_argument | exception, if innerPolicy is nullptr. |
Definition at line 28 of file validation-policy.cpp.
|
inherited |
Set validator to which the policy is associated.
Definition at line 53 of file validation-policy.cpp.
|
protectedinherited |
Definition at line 145 of file validation-policy.hpp.
|
protectedinherited |
Definition at line 144 of file validation-policy.hpp.