Repository navigation
fix: pre-release review blocking batch (P0 form-encoded mutations + 4 P1s) - #245
Merged
Merged
Conversation
The axios instance defaults to form-urlencoded; six calls posted plain objects to handlers that hard-require getJsonObject() — create org, invite, accept invitation, nominate successor, create application and profile PATCH all 400'd against the real backend. The mock-based e2e suite cannot catch this (postDataJSON parses either shape), so the same spec now asserts request Content-Type + parsed JSON body on the org and application create flows (forced-password-change precedent). Also replaces the 14 bg-white uses in the three new account pages with bg-surface (semantic token; fixes white inputs in dark mode — v1.3.2 baseline had zero bg-white).
…est, cache ordering (P1s) Pre-release review P1 batch: - Audit actor attribution: logFromRequest now falls back to the auth filter's userId attribute when actorId is empty — the org/open-platform mutation audit rows (consent decisions, succession, ownership transfer, secret rotation, application ops) previously recorded actor=anonymous. Callers passing an explicit actor are unaffected. - V036 org dimension lands: AuditEvent gains orgId; AuditLogger writes audit_logs.org_id; every org-scoped audit site (13 in OrgMemberService, transfer-ownership, succession auto-effect, org-owned application create/rotate/transfer/delete) passes the numeric org id. - Invitation tokens are now stored hashed (SHA-256 hex, V009 password-reset pattern) instead of plaintext: a DB dump can no longer redeem org invitations (they grant membership up to role=admin). The raw token exists only in the creating request frame (mail body + one-time response); accept looks up by hash. Pending dev rows written before this change hold plaintext and are unredeemable (table is unreleased; no production data exists). Deliberate deviation from the review's token_hash-column suggestion: renaming the column would require a migration + ORM regen (drogon_ctl needs a live DB) while storing the hash in the existing column delivers the full security fix with zero schema churn; a cosmetic rename is registered as an optional follow-up. - ApplicationService::update() now invalidates the client cache AFTER the write (success callback / post-scope-write), matching insertApplication's #219 commit-callback ordering and rotateSecret — the pre-commit DEL could let a concurrent read re-cache the stale row for a full TTL (removed redirect URIs / grant types kept working). api-diff baseline force-ratified per policy (source-compatible trailing default argument on DrogonAuditSink::logFromRequest — the documented precedent; every existing caller compiles unchanged, build verified). Verified: fulla-server/fulla-tests Release build; 17 targeted org/ succession/consent/open-platform/baseline tests all pass (incl. the create-invite-accept round-trip on the hashed lookup); five local gates green.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
wangrh0909
approved these changes
Sep 30, 2026
This was referenced Sep 30, 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.
Summary
Pre-release blocking batch from the comprehensive v1.3.2..master review (five-track adversarial review ahead of the v1.4.0 release): the single P0 and all four P1s. P2 ride-alongs follow in a second PR; leftover P2s will be registered as tracking issues.
P0 — six self-service mutations sent form-encoded bodies to JSON-only endpoints
The user SPA's axios instance defaults to
x-www-form-urlencoded(axios URL-encodes plain objects under that content type), and six calls posted plain objects to handlers that hard-requiregetJsonObject()— every headline self-service mutation 400'd against the real backend: create org, invite member, accept invitation, nominate successor, create application, profile PATCH. The mock-based e2e suite structurally cannot catch this (Playwright'spostDataJSONparses both shapes — the exact PR #140 trap recorded in frontend-contract.md).Fix:
JSON.stringify(body)+ explicitapplication/jsonheader (the established convention; the same diff's rotate-secret call already did it). Regression guard: the org/application create specs now assert request Content-Type and the parsed JSON body (forced-password-change.spec.tsprecedent).P1s (backend)
actor=anonymous: the four file-local audit helpers passed an empty actorId.logFromRequestnow falls back to the auth filter'suserIdrequest attribute when actorId is empty (explicit-actor callers unaffected).AuditEvent.orgId+AuditLoggerwritesaudit_logs.org_id; all org-scoped audit sites pass the numeric org id (13 sites in OrgMemberService incl. the create-org callback chain, transfer-ownership, SuccessionGuard auto-effect, org-owned application ops via the owner row).organization_invitations.tokencolumn held redeemable plaintext for up to 72h (grants membership up torole=admin); now stores SHA-256 hex; accept looks up by hash; raw token exists only in the creating frame (mail body + one-time response). Deviation from the review suggestion (rename column totoken_hash): a rename needs a migration + ORM regen against a live DB, while hashing into the existing column delivers the identical security property with zero schema churn — cosmetic rename registered as an optional follow-up. Pending dev rows with plaintext become unredeemable (table unreleased; no production data).ApplicationService::update()invalidated the Redis client cache BEFORE the DB write; a concurrent read could re-cache the stale row for a full TTL (removed redirect URIs / grant types kept being accepted). Now invalidates in the update success callback / after the scope write, matchinginsertApplication's Quota/rate-limit TOCTOU on open-platform creation paths #219 commit-callback ordering androtateSecret.Also: the 14
bg-whiteuses in the three new account pages →bg-surface(semantic token; fixes white inputs in dark mode).Verification
fulla-server+fulla-testsRelease build green (MSVC).npm run build, vitest 37/37, Playwright 145 passed / 2 skipped (incl. the two new Content-Type assertions),check-ui-syncin sync.DrogonAuditSink::logFromRequest(documented precedent; every existing caller compiles unchanged).Review-finding mapping
Out of scope here (second PR / tracking issues): slug 404 folding, transaction guards, consent-request error-vs-no-row, config completeness, rule-file backfill, frontend micro-fixes, transfer-ownership yaml codes.