3x-ui/frontend/src/test
Sanaei 3b5273b1d6
fix(amneziawg): reject obfuscation values amneziawg-go's own UAPI rejects
ValidateObfuscation exists, by its own doc comment, so that a bad manual
entry cannot break the embedded device's IpcSet. It was not covering enough
to do that. Auditing the panel against amneziawg-go v3.1.20260828's full
UAPI surface turned up two holes, both confirmed by driving the values
through a real IpcSet:

  S1 = 70000        upstream parses s1-s4 as uint16
  S2 = 70000        (device/uapi.go)
  Jc = -1           jc/jmin/jmax are uint32, so no negatives
  Jmin/Jmax = -5/-1
  Jc = 5000000000   and nothing wider than uint32
  I1 = <rand 100>   newObfChain hard-fails on an unknown tag
  I1 = <r 100       ... and on a missing '>'
  I1 = <>           ... and on an empty one

All eight passed validation and were then rejected by the device. Only S3
and S4 were bounded, which is why the asymmetry went unnoticed. The inbound
saves, the reconcile fails on every tick, and the interface never comes up
with a single log line to say so.

Bound the five numeric fields to the widths upstream actually parses, and
check the I1-I5 chain's <tag value> structure against a tag set mirroring
upstream's own obfBuilders map. Each tag's value grammar stays amneziawg-go's
to enforce -- that is eight builders across several files, and duplicating
them here would drift. So <r abc> still reaches IpcSet, now as the only
remaining class rather than one of four.

Mirror the same bounds in the Zod schema, next to the max() that s3 and s4
already carried, so the form rejects the value instead of the save doing it.

TestValidatedObfuscationAlwaysApplies pins the contract itself: whatever
ValidateObfuscation accepts, a real amneziawg-go device must accept too. It
covers the specs the new grammar check deliberately allows, not just the ones
it rejects, so the allowlist cannot quietly become stricter than upstream.

The rest of the audit found no gaps: all 17 settable device keys reach
buildUAPIConfig, ServerSettings, the Zod schema and all three .conf
emitters. fwmark and persistent_keepalive_interval remain unemitted, both
deliberately -- the panel models no fwmark anywhere, and keepAlive is carried
client-side where WireGuard puts it.
2026-09-04 14:57:29 +02:00
..
__snapshots__ feat(amneziawg): add native AmneziaWG protocol support (#6105) 2026-08-24 02:41:15 +02:00
golden/fixtures Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
msw Frontend dev tooling (Husky, lint-staged, MSW, Storybook) + full React Hook Form migration (#5859) 2026-07-08 13:28:37 +02:00
amneziawg-conf-injection.test.ts feat(amneziawg): add native AmneziaWG protocol support (#6105) 2026-08-24 02:41:15 +02:00
amneziawg-conf-parity.test.ts feat(amneziawg): add native AmneziaWG protocol support (#6105) 2026-08-24 02:41:15 +02:00
amneziawg-obfuscation.test.ts fix(amneziawg): H1-H4 generator + queue-depth throughput fixes (#6330) 2026-09-03 21:50:23 +02:00
amneziawg-schema-cleared.test.ts fix(amneziawg): reject obfuscation values amneziawg-go's own UAPI rejects 2026-09-04 14:57:29 +02:00
api-token-date.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
app-sidebar.test.tsx fix(ui): reserve space for pinned sidebar 2026-07-30 14:52:38 +08:00
balancer-form-modal.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
balancer-loopback.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
balancer-observatory-sync.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
balancer.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
basics-happy-eyeballs.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
client-card-comment.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
client-external-link-expiry.test.ts Feature/fix external subscription client expiry (#6333) 2026-09-03 22:32:05 +02:00
client-form-flow.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
client-form-modal.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
client-total-bytes.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
client-traffic-display.test.ts feat(clients): restore traffic usage progress bars on Clients page (#5150) 2026-06-11 12:10:49 +02:00
client-tunnel-allowed-ips.test.tsx feat(amneziawg): add native AmneziaWG protocol support (#6105) 2026-08-24 02:41:15 +02:00
clients-query-gating.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
clients-row-cells-memo.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
clients-summary.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
clone-inbound-modal.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
date-time-picker.test.tsx Feature/fix external subscription client expiry (#6333) 2026-09-03 22:32:05 +02:00
default-setting-tag.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
dns-presets.test.ts Add encrypted DNS presets (#5837) 2026-07-09 00:45:35 +02:00
dns-tab.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
dns.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
factory-defaults-contract.test.ts feat(ui): tag settings that sit at their shipped default value (#6128) 2026-07-29 08:03:21 +02:00
finalmask.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
format-validation-error.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
general-tab.test.tsx refactor(ui): share one onNumber handler for numeric setting inputs (#6127) 2026-07-28 23:03:13 +02:00
generated-examples.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
geo-browser-selection.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
geo-tokens.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
headers.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
host-link.test.ts fix(sub): bake Host VLESS Route into subscription UUIDs 2026-06-29 14:32:23 +02:00
host-schema.test.ts fix(sub): bake Host VLESS Route into subscription UUIDs 2026-06-29 14:32:23 +02:00
http-init-msw.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
http-init.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
httpUtil.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
i18n-dead-keys.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
inbound-clone.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
inbound-defaults.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
inbound-form-adapter.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
inbound-form-blocks.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
inbound-form-modal.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
inbound-from-db.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
inbound-full.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
inbound-link.test.ts feat(amneziawg): add native AmneziaWG protocol support (#6105) 2026-08-24 02:41:15 +02:00
inbound-tag.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
input-number-guard.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
language-scope.test.ts fix(frontend): isolate subscription language preference (#6394) 2026-09-03 16:33:37 +02:00
link-label.test.ts feat(amneziawg): add native AmneziaWG protocol support (#6105) 2026-08-24 02:41:15 +02:00
log-parse.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
mtproto-clients-link.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
multi-tunnel-client-config.test.tsx fix(clients): render all tunnel configs for multi-inbound client (#6346) (#6349) 2026-09-03 17:03:48 +02:00
node-list-rowkey.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
nord-modal.test.tsx feat(nord): support multi-server NordLynx outbounds (#6311) 2026-09-02 20:20:10 +02:00
observatory-settings-tab.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
on-number.test.ts refactor(ui): share one onNumber handler for numeric setting inputs (#6127) 2026-07-28 23:03:13 +02:00
openapi-request-bodies.test.ts fix(api-docs): generate request bodies for all encodings (#6296) 2026-09-03 21:20:38 +02:00
outbound-defaults.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
outbound-form-adapter.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
outbound-form-modal.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
outbound-link-parser.test.ts fix(hysteria): standard geco share links and persistent uTLS None (#6325) 2026-09-03 16:35:07 +02:00
outbound-tag-rename.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
outbounds-loopback-index.test.tsx feat(pia): add PIA login-and-add WireGuard outbounds (#6272) 2026-08-22 23:11:06 +02:00
panel-version.test.ts feat(panel): surface dev-build version in UI, bot, and CLI 2026-06-25 02:36:41 +02:00
pia-modal.test.tsx feat(pia): add PIA login-and-add WireGuard outbounds (#6272) 2026-08-22 23:11:06 +02:00
protocol-capabilities.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
protocols.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
qr-panel-readable.test.tsx fix(frontend): improve dense QR readability (#6396) 2026-09-03 16:32:27 +02:00
remark-template-field.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
remark-variables.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
rhf-form-field.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
routing-default-outbound.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
routing-loopback-index.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
routing-reference-cleanup.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
rule-form-preserve-fields.test.tsx feat(routing): add client picker to user rules (#6271) 2026-08-22 23:13:34 +02:00
rule.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
security.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
setting-ldap-skip-verify.test.ts feat: ldap skip tls verify (#5637) 2026-06-28 18:10:38 +02:00
setting-sub-identity.test.ts feat(sub): allow identity tokens on every subscription link (#5935) 2026-07-28 22:12:52 +02:00
setting-sub-updates.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
setup.components.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
setup.msw.ts Frontend dev tooling (Husky, lint-staged, MSW, Storybook) + full React Hook Form migration (#5859) 2026-07-08 13:28:37 +02:00
setup.ts feat: complete Zod migration of frontend + bulk client batching (#4599) 2026-05-27 04:26:50 +02:00
size-formatter.test.ts feat(ui): show per-inbound live speed (#5261) 2026-06-14 22:39:40 +02:00
sniffing-field-resync.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
sockopt.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
speed-tag-stable.test.tsx fix(frontend): stabilize speed tags on inbound and client pages (#5930) 2026-07-14 13:00:25 +02:00
spider-x.test.ts feat(reality): derive a stable per-client spiderX for shared links 2026-07-02 12:53:08 +02:00
storybook-theme.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
stream-wire-normalize.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
stream.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
sub-balancer-form-modal.test.tsx feat(sub): leastLoad member weights for subscription balancers (#6304) 2026-09-02 20:21:27 +02:00
subscription-general-tab.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
test-utils.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
tls-fingerprint-default.test.ts fix(hysteria): standard geco share links and persistent uTLS None (#6325) 2026-09-03 16:35:07 +02:00
tunnel-rewriteport.test.ts fix(inbounds): accept null rewritePort in tunnel settings (#5516) (#5525) 2026-06-24 12:54:05 +02:00
use-all-settings.test.tsx chore: bump dependencies and clear deprecated frontend APIs 2026-08-24 14:56:40 +02:00
use-xray-setting.test.tsx fix(frontend): preserve edited server drafts (#6156) 2026-07-30 02:59:53 +02:00
useServerDraft.test.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
vless-encryption.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
warp-change-ip.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
websocket-bridge-outbounds.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
websocket-shared-client.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
wireguard-client-config.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
wireguard-clients-link.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
xhttp-session-id.test.ts feat(xhttp): support sessionID* rename + sessionIDTable/Length (xray v26.6.22) (#5506) 2026-06-23 17:38:16 +02:00
zodValidate.test.ts Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00