Repository navigation
docs(permissions): state the allowed_ip_ranges save refusal, the live clear and the env recovery - #30382
Merged
Conversation
… clear and the env recovery The authentication page's allowed_ip_ranges row now links a short subsection that says what the merged code does: a settings save whose list matches none of the saving request's own address (resolved under server.trustProxy) is refused with 400 SETTINGS_VALIDATION, a clear applies at once and returns to the deployment's declared list, and an empty OS_AUTH_ALLOWED_IP_RANGES is an env override in force that opens the gate at the next restart while it locks the field. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2ebbZkr2QAEG1x7UC8
Contributor
Author
|
domain:devx#2 · marchtian · session_017ihL2ebbZkr2QAEG1x7UC8 席位核对 — ACCEPT ·
|
This was referenced Nov 5, 2026
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 田騏 · project thread
Fixes #30314
Clause-②: no
Metadata-protocol: none
维护者速读
allowed_ip_ranges一行加了一句话并链到一个短小节,写明三件事:保存一份不匹配自己当前地址的列表会被拒(400SETTINGS_VALIDATION,提示里写明你的地址和救援办法);清空字段立即生效、回到部署自己声明的列表;已被锁在外面时把OS_AUTH_ALLOWED_IP_RANGES设为空值并重启。content/docs/permissions/authentication.mdx的 Network 表格那一行,以及紧跟在“How enforcement works”引用块后面的新小节 “Saving, clearing and lockout recovery”。pnpm check:doc-anchors,预期 exit 0(行内链接指向的新小节锚点存在)。What changes
content/docs/permissions/authentication.mdxonly. Theallowed_ip_rangesrow gains one sentence that links a new short subsection, Saving, clearing and lockout recovery, under Network. Each statement was read from the code merged by PR #30309 (atfdad1786e8), not from its description:PUT /api/settings/:namespace(packages/services/service-settings/src/settings-routes.ts:320, called by the console atui/apps/console/src/pages/settings/api.ts:172) hands the request's peer address and headers tosetMany(settings-routes.ts:354-368). The write predicate registered forauth.allowed_ip_ranges(packages/plugins/plugin-auth/src/auth-plugin.ts:2551-2556) resolves the caller's address with the auth manager's ownresolveClientAddressand matches it with the gate's ownipMatchesRange(packages/plugins/plugin-auth/src/allowed-ip-ranges.ts:148-152). A refusal becomesSettingsValidationError(packages/services/service-settings/src/settings-service.ts:2722), answered400 SETTINGS_VALIDATIONwithdetails.fields(settings-routes.ts:397), field codeinvalid_valueandconstraint.clientAddress. The message is the copy atallowed-ip-ranges.ts:85-123, in the caller's language, ending with the recovery sentence (allowed-ip-ranges.ts:93).default;applySettingsthen puts back the deployment's declared list, or none (auth-plugin.ts:2328-2334). That list is captured after theauth:configurehook (auth-plugin.ts:750,:792). The pass re-runs on every auth settings change (auth-plugin.ts:2569), so no restart. A clear is never refused (allowed-ip-ranges.ts:145).effectiveEnvOverridetreats any string as an override, the empty string included (settings-service.ts:1378-1379); the key has no default, socoerceEnvValuekeeps''(settings-service.ts:3843-3857,packages/services/service-settings/src/manifests/auth.manifest.ts:366-372). The value is thensource: 'env', soisExplicitholds andparseAllowedIpRanges('')gives no list (auth-plugin.ts:2094,:2328-2329). An override in force also locks the key against writes (settings-service.ts:2406-2408, answered409 SETTINGS_LOCKEDatsettings-routes.ts:378-379).Where the code says more than, or something other than, the card's Wanted lines:
ipMatchesRangematches IPv4 CIDR and exact addresses only, so the page says "no entry matches". It also states two cases the Wanted line does not: when the server cannot establish the caller's address, any non-empty list is refused (allowed-ip-ranges.ts:152-156); and only a change is judged, so saving the list already in force again is not refused (settings-service.ts:2695). Writes inside the server carry no request and are not judged (allowed-ip-ranges.ts:143).PUT /api/settings/auth. The console calls it, and so can any HTTP client, which gets the same refusal.OS_AUTH_ALLOWED_IP_RANGESis set, the stored list is kept but not used, and a save to the field is refused with409 SETTINGS_LOCKED. When the variable is removed, the stored list applies again at the next restart. The page states this as it is.Tests
None: a docs-only change. No code, test or i18n file is touched. No changeset:
content/docs/ships in no published package, so this PR carriesskip-changeset.Acceptance notes
lockout_thresholdormax_concurrent_sessions_per_userkeeps the last stored value until a restart. That family is the seat's (named there); this PR does not touch the intro.check:livenessis red on this tree, frommain.pnpm --filter @objectstack/spec run check:livenessexits 1: the ledger entryquery/searchFieldscitespackages/objectql/src/engine.ts, which no longer names the key after f672e0d moved its docblocks out. This diff does not touch that file or the ledger.Verification
Derived gates: 45 derived, 45 run, 44 exit 0, 1 exit 1 (from main)
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 45 commands for the one changed path, at heade4fc7bccf3.PREREQUISITE NOT MET(exit 3:check:doc-formula-expressions,check:doc-security-posture,check:skill-examples,check:docs-transcript-drift) or a missingpackages/spec/json-schema(check:docs, exit 1). After building@objectstack/spec,@objectstack/formula,@objectstack/lint, and the@objectstack/client/@objectstack/client-reactclosures under the verify lock (VERDICT command-exit 0both times), all five re-ran to exit 0.pnpm --filter @objectstack/spec run check:liveness: exit 1, themainfinding above.--ranreconciliation: "45 derived famil(ies) accounted for — 45 run, 0 NOT-MEASURED".git merge origin/main: already up to date (origin/main=fdad1786e8).Build DocsandPlan Test Core shardsjobs the paths schedule.🤖 Generated with Claude Code