hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
shared_model::validation::FieldValidator Class Reference

#include "field_validator.hpp"

Collaboration diagram for shared_model::validation::FieldValidator:
Collaboration graph

Public Member Functions

 FieldValidator (time_t future_gap=kDefaultFutureGap, TimeFunction time_provider=[]{return iroha::time::now();})
 
void validateAccountId (ReasonsGroupType &reason, const interface::types::AccountIdType &account_id) const
 
void validateAssetId (ReasonsGroupType &reason, const interface::types::AssetIdType &asset_id) const
 
void validatePeer (ReasonsGroupType &reason, const interface::Peer &peer) const
 
void validateAmount (ReasonsGroupType &reason, const interface::Amount &amount) const
 
void validatePubkey (ReasonsGroupType &reason, const interface::types::PubkeyType &pubkey) const
 
void validatePeerAddress (ReasonsGroupType &reason, const interface::types::AddressType &address) const
 
void validateRoleId (ReasonsGroupType &reason, const interface::types::RoleIdType &role_id) const
 
void validateAccountName (ReasonsGroupType &reason, const interface::types::AccountNameType &account_name) const
 
void validateDomainId (ReasonsGroupType &reason, const interface::types::DomainIdType &domain_id) const
 
void validateAssetName (ReasonsGroupType &reason, const interface::types::AssetNameType &asset_name) const
 
void validateAccountDetailKey (ReasonsGroupType &reason, const interface::types::AccountDetailKeyType &key) const
 
void validateAccountDetailValue (ReasonsGroupType &reason, const interface::types::AccountDetailValueType &value) const
 
void validatePrecision (ReasonsGroupType &reason, const interface::types::PrecisionType &precision) const
 
void validateRolePermission (ReasonsGroupType &reason, const interface::permissions::Role &permission) const
 
void validateGrantablePermission (ReasonsGroupType &reason, const interface::permissions::Grantable &permission) const
 
void validateQuorum (ReasonsGroupType &reason, const interface::types::QuorumType &quorum) const
 
void validateCreatorAccountId (ReasonsGroupType &reason, const interface::types::AccountIdType &account_id) const
 
void validateCreatedTime (ReasonsGroupType &reason, interface::types::TimestampType timestamp, interface::types::TimestampType now) const
 
void validateCreatedTime (ReasonsGroupType &reason, interface::types::TimestampType timestamp) const
 
void validateCounter (ReasonsGroupType &reason, const interface::types::CounterType &counter) const
 
void validateSignatures (ReasonsGroupType &reason, const interface::types::SignatureRangeType &signatures, const crypto::Blob &source) const
 
void validateQueryPayloadMeta (ReasonsGroupType &reason, const interface::QueryPayloadMeta &meta) const
 
void validateDescription (ReasonsGroupType &reason, const interface::types::DescriptionType &description) const
 
void validateBatchMeta (ReasonsGroupType &reason, const interface::BatchMeta &description) const
 
void validateHeight (ReasonsGroupType &reason, const interface::types::HeightType &height) const
 
void validateHash (ReasonsGroupType &reason, const crypto::Hash &hash) const
 
void validateTxPaginationMeta (ReasonsGroupType &reason, const interface::TxPaginationMeta &tx_pagination_meta) const
 

Static Public Attributes

static constexpr auto kMaxDelay
 
static constexpr auto kDefaultFutureGap
 
static const size_t public_key_size
 
static const size_t signature_size
 
static const size_t hash_size
 
static const size_t value_size = 4 * 1024 * 1024
 limit for the set account detail size in bytes More...
 
static const size_t description_size = 64
 

Detailed Description

Class that validates fields of commands, concrete queries, transaction, and query

Constructor & Destructor Documentation

shared_model::validation::FieldValidator::FieldValidator ( time_t  future_gap = kDefaultFutureGap,
TimeFunction  time_provider = [] { return iroha::time::now(); } 
)

Member Function Documentation

void shared_model::validation::FieldValidator::validateAccountDetailKey ( ReasonsGroupType reason,
const interface::types::AccountDetailKeyType key 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateAccountDetailValue ( ReasonsGroupType reason,
const interface::types::AccountDetailValueType value 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateAccountId ( ReasonsGroupType reason,
const interface::types::AccountIdType account_id 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateAccountName ( ReasonsGroupType reason,
const interface::types::AccountNameType account_name 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateAmount ( ReasonsGroupType reason,
const interface::Amount amount 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateAssetId ( ReasonsGroupType reason,
const interface::types::AssetIdType asset_id 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateAssetName ( ReasonsGroupType reason,
const interface::types::AssetNameType asset_name 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateBatchMeta ( ReasonsGroupType reason,
const interface::BatchMeta description 
) const
void shared_model::validation::FieldValidator::validateCounter ( ReasonsGroupType reason,
const interface::types::CounterType counter 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateCreatedTime ( ReasonsGroupType reason,
interface::types::TimestampType  timestamp,
interface::types::TimestampType  now 
) const

Validate timestamp against now

Here is the call graph for this function:

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateCreatedTime ( ReasonsGroupType reason,
interface::types::TimestampType  timestamp 
) const

Validate timestamp against time_provider_

Here is the call graph for this function:

void shared_model::validation::FieldValidator::validateCreatorAccountId ( ReasonsGroupType reason,
const interface::types::AccountIdType account_id 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateDescription ( ReasonsGroupType reason,
const interface::types::DescriptionType description 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateDomainId ( ReasonsGroupType reason,
const interface::types::DomainIdType domain_id 
) const

Check if the given string domain_id is in valid domain syntax defined in the RFC 1035 and 1123. Return the result of the validation.

The domain syntax in RFC 1035 is given below:

<domain> ::= <subdomain> | ” ” <subdomain> ::= <label> | <subdomain> “.” <label> <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ] <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str> <let-dig-hyp> ::= <let-dig> | “-” <let-dig> ::= <letter> | <digit> <letter> ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case <digit> ::= any one of the ten digits 0 through 9

And the subsequent RFC 1123 disallows the root white space.

If the validation is not successful reason is updated with corresponding message

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateGrantablePermission ( ReasonsGroupType reason,
const interface::permissions::Grantable permission 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateHash ( ReasonsGroupType reason,
const crypto::Hash hash 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateHeight ( ReasonsGroupType reason,
const interface::types::HeightType height 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validatePeer ( ReasonsGroupType reason,
const interface::Peer peer 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validatePeerAddress ( ReasonsGroupType reason,
const interface::types::AddressType address 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validatePrecision ( ReasonsGroupType reason,
const interface::types::PrecisionType precision 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validatePubkey ( ReasonsGroupType reason,
const interface::types::PubkeyType pubkey 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateQueryPayloadMeta ( ReasonsGroupType reason,
const interface::QueryPayloadMeta meta 
) const
void shared_model::validation::FieldValidator::validateQuorum ( ReasonsGroupType reason,
const interface::types::QuorumType quorum 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateRoleId ( ReasonsGroupType reason,
const interface::types::RoleIdType role_id 
) const

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateRolePermission ( ReasonsGroupType reason,
const interface::permissions::Role permission 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

void shared_model::validation::FieldValidator::validateSignatures ( ReasonsGroupType reason,
const interface::types::SignatureRangeType signatures,
const crypto::Blob source 
) const

Here is the call graph for this function:

void shared_model::validation::FieldValidator::validateTxPaginationMeta ( ReasonsGroupType reason,
const interface::TxPaginationMeta tx_pagination_meta 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const size_t shared_model::validation::FieldValidator::description_size = 64
static
const size_t shared_model::validation::FieldValidator::hash_size
static
constexpr auto shared_model::validation::FieldValidator::kDefaultFutureGap
static
Initial value:
=
std::chrono::minutes(5) / std::chrono::milliseconds(1)
constexpr auto shared_model::validation::FieldValidator::kMaxDelay
static
Initial value:
=
std::chrono::hours(24) / std::chrono::milliseconds(1)
const size_t shared_model::validation::FieldValidator::public_key_size
static
const size_t shared_model::validation::FieldValidator::signature_size
static
const size_t shared_model::validation::FieldValidator::value_size = 4 * 1024 * 1024
static

limit for the set account detail size in bytes


The documentation for this class was generated from the following files: