docs(examples): use semantic owned database names - #1086
Open
seonghobae wants to merge 10 commits into
Open
Conversation
|
Warning Review limit reachedNext included review available in 23 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Naming repair
The AppGuardrail Next.js/Supabase teaching fixtures used organization-owned persistence with generic one-word database objects and fields:
projects(id, user_id, name, data). That conflicts with the ContextualWisdomLab naming contract and teaches generated applications an ambiguous owned schema even when the security behavior is the lesson.The fixed and intentionally vulnerable examples now use
project_records(project_id, owner_user_id, project_name, project_payload)and semantic internal identifiers. Vendor-owned NextAuth/Supabase/Zod fields such assession.user.id,auth.users(id), and parse-resultdataremain at explicit adapter boundaries. The vulnerable fixture keeps its intentional security failures; naming ambiguity is no longer coupled to those failures.Security-review repairs
Current-head review findings were repaired directly rather than delegated: the fixed sample preserves the existing
urlcheckout response and/api/admin/userspath, validates project UUID and checkout JSON input, rejects unsupported admin query input, authenticates the admin handler before processing that input, and derives the Python test fixture path from the repository root. Focused regressions pin these contracts and their order.Database boundary
These are fresh illustrative schemas, not AppGuardrail production persistence. Existing applications already deployed with
projects(id, user_id, name, data)require an explicit forward migration covering foreign keys, indexes, ORM/query mappings, RLS policies, UPSERT paths, locks/read-write behavior, rollback, and deployed consumers; this PR does not pretend a documentation rename is a safe live migration.TDD / regression evidence
tests/test_fixed_example_naming_contract.pypins semantic DB/query names, request-validation contracts, authentication-before-input handling, and existing sample API compatibility.tests/test_vulnerable_example_naming_contract.pyrequires the same semantic project vocabulary while explicitly asserting that the vulnerable fixture still lacks authentication/ownership and RLS.CHANGELOG.d/semantic-fixed-example-database-names.mdrecords both fixtures and the compatibility boundary.Exact identity
develop@e71d37e7c58118e6764c96ab7c4492fe33eed6f8e8a6b7a2b47d0deab02975f464587536eddf5526fix/fixed-example-semantic-database-namesAll observed review threads through the prior head were repaired/resolved. Fresh exact-head Tests, Security Process, Security Scan, SAST Semgrep, OpenSSF evidence, retention, pinned-HTTPS, and scan-path verification are required before ordinary merge. No predecessor/base evidence transfers, force update, self-approval, or protection bypass is requested.