mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-17 21:50:53 +08:00
Migration 0005 creates traffic_rewrite_rules. The matchers and actions columns are two JSON secret columns of db/secrets.go: InitSecrets, which runs after the migrations, checks the key against them and encrypts any plaintext row, as it does for the existing columns. The CRUD lists rules in execution order and enforces 100 rules, 50 of them enabled, under a table lock so concurrent writers cannot pass a limit. UpdateTrafficRewriteRule hands the stored rule to an edit callback inside the transaction, which is where a caller keeps a value it was not sent. InitSecrets also derives the sub-key that fingerprints sensitive values in the rewrite trace (HMAC-SHA256 of "artex-traffic-trace" under the secret key).