# Script validators (validationScript)

Lightweight script validators are scripts that do not require connection to external services. Scripts can be written in the repository and then used on the application.

The script code should be written in **plain JavaScript (ES6 or earlier)**. The code must be compatible with the version of the JavaScript engine **provided by Rhino** (<http://mozilla.github.io/rhino/compat/engines.html> ). In addition **have been disabled** such elements as "eval".

{% hint style="danger" %}
**Timeout**

Note! The script execution time is limited to **1 second**, in order to eliminate cases of an infinite loop/unbounded recursion. After one second, an exception will be thrown.
{% endhint %}

{% hint style="info" %}
Validator scripts are cached after being retrieved. The lifetime is controlled by the configuration key **repository\_script\_validator\_cache\_ttl** and **settings\["REPOSITORY\_SCRIPT\_VALIDATOR\_CACHE\_TTL"]**
{% endhint %}
