Repository navigation
fix(frontend/auth): cap dashboard password at 72 UTF-8 bytes - #647
Merged
Soju06 merged 1 commit intoMay 17, 2026
Merged
Conversation
) The backend caps dashboard passwords at 72 UTF-8 bytes (bcrypt's input ceiling) and returns HTTP 422 `password_too_long` when callers exceed it (`app/modules/dashboard_auth/api.py:159`). The OpenSpec admin-auth change requires the same contract on the client. Until now the PasswordSetupRequestSchema and PasswordChangeRequestSchema only enforced the 8-character minimum, so users typing a long password would only discover the limit after a round-trip. Add a shared dashboardPasswordSchema that mirrors the backend rule by measuring `new TextEncoder().encode(value).length` (so emoji and other multi-byte characters are weighed by their UTF-8 byte count, not their visible character count) and rejecting anything past 72 bytes with the same wording the backend uses. Wire the new schema into the password setup and password change request schemas without changing the existing 8-character minimum or any other field. Coverage in frontend/src/features/auth/schemas.test.ts: - 72-byte ASCII password is accepted on PasswordSetupRequestSchema. - 73-byte ASCII password fails with the "72 bytes" message. - A 19-emoji password (76 UTF-8 bytes) fails. - The 8-character minimum is still enforced. - PasswordChangeRequestSchema rejects a 73-byte newPassword and points the validation issue at the newPassword path. - 72-byte newPassword is accepted on PasswordChangeRequestSchema.
Collaborator
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Soju06
added a commit
that referenced
this pull request
May 17, 2026
Release 1.18.0 — v1.17.0 → main, 27 PR. ## Pre-merge verification (release-gate e2e) - ✅ CI 18/18 (mergeStateStatus CLEAN) - ✅ baseline release-gate-smoke: 10/10 (`v1.models`, chat non-stream/stream/tool_call, responses non-stream/stream, unknown-msg-key drop, transient codes, dashboard 72-byte, alembic index) - ✅ per-PR e2e extra: 14/14 (#658 strict tool × chat valid/invalid/type-omitted + responses invalid, #650-652 trim replay markers, #516 prev-resp miss mask, #558 prolite plan, #600 token_expired, #635 device poll, #647 frontend 72B, #594 account selection, #640 alembic head, #653/#654 conv archive, #655/#656 weekly pace) - ✅ pytest 562 passed / 3 PG-only skip (unit + integration suite) - ✅ SDK e2e 20/20 (`tests/e2e/test_openai_sdk_compat.py` + `tests/e2e/test_v1_responses_openai_sdk.py`) - ✅ `scripts/verify_v1_responses_openai_sdk.py` 5/5 against live container with real account - ✅ ruff check + ruff format --check + uv run ty check — All clean - ✅ prod parity probe: #637 (unknown-key drop) + #658 (strict tool 400) both confirmed fixed vs prod 1.17.0 ## Behavior change to note in announcements - **#658**: `strict: true` function tool schemas missing `additionalProperties: false` (or other strict-mode requirements) now return a local **400 `invalid_function_parameters`** with `param=tools[N].function.parameters` (chat) / `tools[N].parameters` (responses). Pre-1.18.0 these were silently forwarded upstream; 1.18.0 enforces OpenAI's documented strict-mode contract locally before forwarding. OpenSpec changes shipped in this release (to be archived after tag publish): - deactivate-on-token-expired (#600) - drop-unknown-message-fields (#637) - mask-single-http-previous-response-miss (#516) - normalize-v1-responses-openai-sdk-stream (#639) - start-device-oauth-polling (#635) - support-prolite-plan-capacity (#558) - treat-upstream-overloaded-as-retryable (#601) - validate-password-length (#598) - validate-strict-function-tool-schema (#658)
4 tasks
6 tasks
vitalNohj
pushed a commit
to vitalNohj/codex-lb
that referenced
this pull request
Jul 17, 2026
) (Soju06#647) The backend caps dashboard passwords at 72 UTF-8 bytes (bcrypt's input ceiling) and returns HTTP 422 `password_too_long` when callers exceed it (`app/modules/dashboard_auth/api.py:159`). The OpenSpec admin-auth change requires the same contract on the client. Until now the PasswordSetupRequestSchema and PasswordChangeRequestSchema only enforced the 8-character minimum, so users typing a long password would only discover the limit after a round-trip. Add a shared dashboardPasswordSchema that mirrors the backend rule by measuring `new TextEncoder().encode(value).length` (so emoji and other multi-byte characters are weighed by their UTF-8 byte count, not their visible character count) and rejecting anything past 72 bytes with the same wording the backend uses. Wire the new schema into the password setup and password change request schemas without changing the existing 8-character minimum or any other field. Coverage in frontend/src/features/auth/schemas.test.ts: - 72-byte ASCII password is accepted on PasswordSetupRequestSchema. - 73-byte ASCII password fails with the "72 bytes" message. - A 19-emoji password (76 UTF-8 bytes) fails. - The 8-character minimum is still enforced. - PasswordChangeRequestSchema rejects a 73-byte newPassword and points the validation issue at the newPassword path. - 72-byte newPassword is accepted on PasswordChangeRequestSchema.
vitalNohj
pushed a commit
to vitalNohj/codex-lb
that referenced
this pull request
Jul 17, 2026
Release 1.18.0 — v1.17.0 → main, 27 PR. ## Pre-merge verification (release-gate e2e) - ✅ CI 18/18 (mergeStateStatus CLEAN) - ✅ baseline release-gate-smoke: 10/10 (`v1.models`, chat non-stream/stream/tool_call, responses non-stream/stream, unknown-msg-key drop, transient codes, dashboard 72-byte, alembic index) - ✅ per-PR e2e extra: 14/14 (Soju06#658 strict tool × chat valid/invalid/type-omitted + responses invalid, Soju06#650-652 trim replay markers, Soju06#516 prev-resp miss mask, Soju06#558 prolite plan, Soju06#600 token_expired, Soju06#635 device poll, Soju06#647 frontend 72B, Soju06#594 account selection, Soju06#640 alembic head, Soju06#653/Soju06#654 conv archive, Soju06#655/Soju06#656 weekly pace) - ✅ pytest 562 passed / 3 PG-only skip (unit + integration suite) - ✅ SDK e2e 20/20 (`tests/e2e/test_openai_sdk_compat.py` + `tests/e2e/test_v1_responses_openai_sdk.py`) - ✅ `scripts/verify_v1_responses_openai_sdk.py` 5/5 against live container with real account - ✅ ruff check + ruff format --check + uv run ty check — All clean - ✅ prod parity probe: Soju06#637 (unknown-key drop) + Soju06#658 (strict tool 400) both confirmed fixed vs prod 1.17.0 ## Behavior change to note in announcements - **Soju06#658**: `strict: true` function tool schemas missing `additionalProperties: false` (or other strict-mode requirements) now return a local **400 `invalid_function_parameters`** with `param=tools[N].function.parameters` (chat) / `tools[N].parameters` (responses). Pre-1.18.0 these were silently forwarded upstream; 1.18.0 enforces OpenAI's documented strict-mode contract locally before forwarding. OpenSpec changes shipped in this release (to be archived after tag publish): - deactivate-on-token-expired (Soju06#600) - drop-unknown-message-fields (Soju06#637) - mask-single-http-previous-response-miss (Soju06#516) - normalize-v1-responses-openai-sdk-stream (Soju06#639) - start-device-oauth-polling (Soju06#635) - support-prolite-plan-capacity (Soju06#558) - treat-upstream-overloaded-as-retryable (Soju06#601) - validate-password-length (Soju06#598) - validate-strict-function-tool-schema (Soju06#658)
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.
Summary
Fixes #615.
The backend caps dashboard passwords at 72 UTF-8 bytes — bcrypt's input ceiling — and returns HTTP 422
password_too_longwhen callers exceed it (app/modules/dashboard_auth/api.py:159). The OpenSpecvalidate-password-lengthadmin-auth change locks that contract in (openspec/changes/validate-password-length/specs/admin-auth/spec.md:5). Until nowPasswordSetupRequestSchemaandPasswordChangeRequestSchemaonly enforced the 8-character minimum, so a user typing a 73-byte (or longer-than-72-bytes-after-emoji-expansion) password would only learn the rule after the form had already round-tripped.This change adds a shared
dashboardPasswordSchemathat mirrors the backend rule by measuringnew TextEncoder().encode(value).length— so emoji and other multi-byte glyphs are weighed by their UTF-8 byte count, not by visible character count — and rejects anything past 72 bytes with the same wording the backend uses. Wires the schema into the setup and change request schemas without altering the 8-character minimum or other fields.Tests
frontend/src/features/auth/schemas.test.ts(bun test src/features/auth/schemas.test.ts→ 11 pass / 0 fail):PasswordSetupRequestSchema.PasswordChangeRequestSchemarejects a 73-bytenewPasswordand points the validation issue at thenewPasswordpath.newPasswordis accepted onPasswordChangeRequestSchema.OpenSpec
Per the issue: behavior-preserving on the backend; the frontend is mirroring an already-specified backend contract. No new OpenSpec change folder. Existing
validate-password-lengthadmin-auth spec already requires the 72-byte cap.Closes #615