Repository navigation
feat(console): Allowed IP ranges shows the address the server judges before a save - #30540
Merged
Merged
Conversation
Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgVFhcnGrB1Wp8fLTwB
…before a save Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgVFhcnGrB1Wp8fLTwB
Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgVFhcnGrB1Wp8fLTwB
Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgVFhcnGrB1Wp8fLTwB
2 tasks
Contributor
Author
|
domain:ui#4 · os-sales · session_01L6bhgVfPeFZkN1FP93imKU 维护者速读
席位核对 — ACCEPT · head da21d37
Generated by Claude Code |
4 tasks
This was referenced Nov 5, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Sales · project thread
domain:ui#4 · os-sales · session_01L6bhgVFhcnGrB1Wp8fLTwB
Fixes #30313
Clause-②: no
Metadata-protocol: none
维护者速读
GET /api/v1/auth/admin/client-address),并按trustProxy说明这个地址是取自受信任代理的转发头,还是连接本身(不信任代理时,在代理之后看到的是代理地址);服务器无法确定地址时,说明此处无法保存非空列表。保存被拒时这行仍在,与拒绝信息并列。ui/apps/console/src/pages/settings/SettingsView.tsx(读取与clientAddressNote);SettingsField.tsx新的note槽与aria-describedby;api.ts的getJudgedClientAddress形状检查。pnpm --dir ui exec vitest run apps/console/src/pages/settings/__tests__/SettingsView.clientAddress-30313.test.tsx,预期 1 个文件、9 条全绿。What changes
Item 1 of the card. The Authentication settings page reads the caller's address as the server judges it,
GET /api/v1/auth/admin/client-address(PR #30483:{ clientAddress, trustProxy }from the save check's ownjudgedClientAddresscall, platform-admin gated,no-store), and draws one line under the Allowed IP ranges row:trustProxy: false: "Your address, as the server judges it: ADDRESS. A list that leaves it out cannot be saved from here. This server does not trust proxy headers, so behind a proxy this is the proxy's address."trustProxy: true: the address, "read from the forwarded headers of the proxy this server trusts".clientAddress: null: "The server cannot establish your address, so a non-empty list cannot be saved from here." (the route's documented consequence of null).The trustProxy half is spelled out because it changes what the admin should do with the address: with trust off, behind a proxy every caller is judged by the proxy's address.
api.ts:getJudgedClientAddress(), through the module's existing envelope unwrap; a body whoseclientAddressis not a non-empty string or null, or whosetrustProxyis not a boolean, throws by name.SettingsView.tsx: reads it once per visit, only on theauthnamespace, and passes the sentence asnoteto theallowed_ip_rangesrow. Any failure (401, 403, a server without the route, a malformed body, a network error) draws no note: no guessed address, and the page is otherwise unchanged.SettingsField.tsx: an optionalnotedrawn under the control after the help text or the error, never in place of either; the control'saria-describedbynames the error and the note.@object-ui/i18n:console.settingsView.clientAddressDirect,clientAddressViaProxy,clientAddressUnknownin all ten shipped packs (en, zh, ja, ko, de, fr, es, pt, ru, ar).Item 2 re-measured, not rebuilt: on this branch a refused save still shows the server's sentence naming
constraint.clientAddressin red under the row (the generic field-error path), and the new line stays beside it. Both items hold, soFixes #30313.Before / after, real stack (showcase
objectstack dev --seed-admin, the branch's console under vite, Playwright 1440 px; "before" is the same page with the note's one line ablated live, held and restored withablation-replace.mjs):en-US after:
Tests
ui/apps/console/src/pages/settings/__tests__/SettingsView.clientAddress-30313.test.tsx, the whole page over a stubbedfetchand the realapi.ts, sentences read from the shippedenpack: the note under the list and only there, help text kept,aria-describedby; the trust-proxy and null sentences; no note on 403, 401, a malformed body and a network failure; no read on another namespace with a same-named key; the note kept beside aSETTINGS_VALIDATIONrefusal carryingconstraint.clientAddress, both named byaria-describedby, one read per visit.Acceptance notes
auth/allowed_ip_rangesin the console, as the route ledger entry describes ("the console's Authentication settings page reads it beside the Allowed IP ranges field"); the settings manifest has no key to declare it.@object-ui/i18ngains three keys and no export, soClause-②: nostands.Verification
Unit tests (head 7dbb986, code identical at da21d37)
pnpm exec vitest run --maxWorkers=2 apps/console/src/pages/settings(inui/, underos-verify-lock):Test Files 35 passed (35),Tests 297 passed (297),VERDICT command-exit 0.Ablation
ablation-replace.mjsonSettingsView.tsx, anchor? clientAddressNote(judgedAddress, t)to? undefined(anchor 1 to 0, blob b5ed73e9 to d292d590): the new file goes4 failed | 5 passed (9), the four presence cases red, the five absence cases green as expected. Restored: blob equals HEAD,git diff HEADempty.Live readings (real stack)
GET /api/v1/auth/admin/client-addressas the seeded admin: 200,Cache-Control: no-store,{ success: true, data: { clientAddress: "127.0.0.1", trustProxy: false } }.203.0.113.0/24:PUT /api/settings/auth400SETTINGS_VALIDATION,details.fields[0]fieldallowed_ip_ranges, codeinvalid_value,constraint.clientAddress127.0.0.1; the row shows that message in red, then the note; toast "1 setting needs attention: Allowed IP ranges". Same in zh-CN with the server's zh sentence.Derived gates (dispatch-gates --commands at 7dbb986, 15 paths; code identical at da21d37)
35 derived, 35 run, all exit 0;
--ranreconciliation: 35 run, 0 NOT-MEASURED, 0 UNRUN.Also:
turbo run build --filter='@object-ui/console^...'then@object-ui/consoletype-checkand@object-ui/i18ntype-check:VERDICT command-exit 0.eslinton the changed console files and the en/zh packs: 0 errors (5 warnings, all on lines this PR does not touch). Repo-wide lint and the full UI suites are CI's.Generated by Claude Code