← 所有消息

Apps stop checking what the engine already checks

A review of the fleet looked for code that did the work of the engine a second time, and found it in the same places in every app: a CSRF check at the top of each POST route, a webhook that read its own headers and computed its own HMAC, an error screen that rewrote data/errors.json by hand, a CMS that saved past the hooks of the model.

Each of those now has one place. The CSRF guard of security/CSRF refuses a change without its token before any route runs, and %CSRF.refused lets an app answer that refusal in its own words, so the checks in the routes can go. security/webhook checks the signature and the time of a request. public_address() decides whether an address may be fetched. phlo_error_clear() takes one error or all of them out of the log under the same lock that writes it, and keeps the log as it was beside it. The CMS saves through the model's own objSave, inside the transaction that also writes its relations, a BI search reads only as a database user that may only read, and signing out is a POST.

Two small things came along. \%name keeps a %name as written, for an SQL LIKE or a text with a percent sign before a word. And classes whose names differ only in case are a finding of build::lint instead of a build error, so an app keeps running while it renames.

我们使用必要的cookie来使该网站正常工作。在您的许可下,我们还使用分析工具来改善网站。