6 #ifndef IROHA_SHARED_MODEL_FIELD_VALIDATOR_HPP 7 #define IROHA_SHARED_MODEL_FIELD_VALIDATOR_HPP 23 class TxPaginationMeta;
26 namespace validation {
34 using TimeFunction = std::function<iroha::ts64_t()>;
38 TimeFunction time_provider = [] {
42 void validateAccountId(
58 void validatePeerAddress(
65 void validateAccountName(
91 void validateDomainId(
95 void validateAssetName(
99 void validateAccountDetailKey(
103 void validateAccountDetailValue(
107 void validatePrecision(
111 void validateRolePermission(
115 void validateGrantablePermission(
122 void validateCreatorAccountId(
142 void validateSignatures(
147 void validateQueryPayloadMeta(
151 void validateDescription(
164 void validateTxPaginationMeta(
179 const static std::regex account_name_regex_;
180 const static std::regex asset_name_regex_;
181 const static std::regex domain_regex_;
182 const static std::regex ip_v4_regex_;
183 const static std::regex peer_address_regex_;
184 const static std::regex account_id_regex_;
185 const static std::regex asset_id_regex_;
186 const static std::regex detail_key_regex_;
187 const static std::regex role_id_regex_;
192 TimeFunction time_provider_;
196 static constexpr
auto kMaxDelay =
197 std::chrono::hours(24) / std::chrono::milliseconds(1);
199 static constexpr
auto kDefaultFutureGap =
200 std::chrono::minutes(5) / std::chrono::milliseconds(1);
216 #endif // IROHA_SHARED_MODEL_FIELD_VALIDATOR_HPP static const size_t signature_size
Definition: field_validator.hpp:204
uint64_t HeightType
Type of height (for Block, Proposal etc)
Definition: types.hpp:41
Grantable
Definition: permissions.hpp:66
std::string AddressType
Type of peer address.
Definition: types.hpp:43
decltype(iroha::time::now()) time_t
Definition: time.hpp:38
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:51
Definition: amount.hpp:20
static const size_t public_key_size
Definition: field_validator.hpp:203
auto now()
Definition: time.hpp:23
string(REPLACE".""/"CMAKE_SWIG_OUTDIR ${SWIG_JAVA_PKG}) else() set(CMAKE_SWIG_FLAGS"") endif() myswig_add_library(irohajava LANGUAGE java SOURCES bindings.i) unset(CMAKE_SWIG_FLAGS) swig_link_libraries(irohajava $
Definition: CMakeLists.txt:54
boost::any_range< interface::Signature, boost::forward_traversal_tag, const Signature & > SignatureRangeType
Type of signature range, which returns when signatures are invoked.
Definition: range_types.hpp:24
std::string DescriptionType
Type of the transfer message.
Definition: types.hpp:81
std::string AccountDetailKeyType
Type of account detail key.
Definition: types.hpp:75
Role
Definition: permissions.hpp:17
description
Definition: setup.py:71
std::string AccountIdType
Type of account id.
Definition: types.hpp:37
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
Definition: field_validator.hpp:32
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:39
boost::optional< ConcreteReasonType > validatePubkey(const interface::types::PubkeyType &pubkey)
Definition: field_validator.cpp:376
std::string AccountNameType
Type of account name.
Definition: types.hpp:67
static const size_t value_size
limit for the set account detail size in bytes
Definition: field_validator.hpp:206
uint64_t CounterType
Type of counter.
Definition: types.hpp:65
Definition: public_key.hpp:16
static const size_t description_size
Definition: field_validator.hpp:207
static const size_t hash_size
Definition: field_validator.hpp:205
std::pair< ReasonsGroupName, GroupedReasons > ReasonsGroupType
Definition: answer.hpp:22
std::string AccountDetailValueType
Type of account detail value.
Definition: types.hpp:77
Definition: command_executor.hpp:12
uint16_t QuorumType
Type of Quorum used in transaction and set quorum.
Definition: types.hpp:59
std::string AssetNameType
Type of asset name.
Definition: types.hpp:69
std::string RoleIdType
Type of role (i.e admin, user)
Definition: types.hpp:49
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:61
std::string AssetIdType
Type of asset id.
Definition: types.hpp:53