Validators class
Small, dependency-free validation helpers shared across layers.
Kept intentionally simple: SIMOSEC avoids pulling in external validation/JSON packages so the engine stays lightweight and easy to embed anywhere.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
extractAmount(
dynamic body) → double? - Extracts a numeric amount from a request body map, checking a few common field names. Returns null if no numeric amount is found.
-
isEmptyPayload(
dynamic value) → bool -
Returns true if
valueis null, an empty string, an empty map, or an empty list/iterable. -
isRestrictedAction(
String? action, Set< String> restrictedActions) → bool -
Returns true if
actionis present inrestrictedActions(case-insensitive). -
isStructurallyValidMap(
dynamic body) → bool -
Returns true if
bodylooks like a well-formed map payload, i.e. it is aMapand every key is a non-emptyString. -
looksLikeSignature(
String? signature) → bool -
A minimal signature format sanity check. This does NOT perform real
cryptographic verification — see
CryptoUtils.verifySignaturefor that. This just guards against obviously malformed values (empty, too short, whitespace-only).