-
Notifications
You must be signed in to change notification settings - Fork 0
π‘οΈ Sentinel: [MEDIUM] μ λ ₯ λ¬Έμμ΄μ μ μ΄ λ¬Έμ κ²μ¦ λλ½ μμ #1068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,7 +190,7 @@ class IndexRedundancyOut(BaseModel): | |
| class DiagramViewCreateIn(BaseModel): | ||
| """Request body for saving an ERD canvas view.""" | ||
|
|
||
| name: str = Field(min_length=1, max_length=200) | ||
| name: str = Field(min_length=1, max_length=200, pattern=r"^[^\x00-\x1F\x7F]+$") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π Maintainability & Code Quality | π Major | β‘ Quick win π Supported by static analysisπ Script executed: #!/usr/bin/env bash
set -euo pipefail
mapfile -t test_files < <(
fd -t f -e py . |
rg '(^|/)(test_.*|.*_test|.*tests?)\.py$'
)
if ((${`#test_files`[@]} == 0)); then
echo "No Python test files found"
exit 1
fi
rg -n \
'DiagramViewCreateIn|TableAnnotationUpsertIn|ApiKeyCreateIn|\\x00|\\x1b|\\x7f|multiline' \
"${test_files[@]}"Repository: ContextualWisdomLab/pg-erd-cloud Length of output: 222 π Script executed: #!/usr/bin/env bash
set -euo pipefail
git diff -- backend/app/schemas.py
printf '\n--- schema context ---\n'
sed -n '175,230p' backend/app/schemas.py
sed -n '295,320p' backend/app/schemas.py
printf '\n--- focused tests ---\n'
mapfile -t test_files < <(git ls-files '*test*.py' '*tests*.py')
if ((${`#test_files`[@]})); then
rg -n -S \
'DiagramViewCreateIn|TableAnnotationUpsertIn|ApiKeyCreateIn|\\\\x00|\\\\x1b|\\\\x7f|multiline' \
"${test_files[@]}" || true
else
echo "No Python test files found"
fiRepository: ContextualWisdomLab/pg-erd-cloud Length of output: 2332 π Script executed: #!/usr/bin/env bash
set -u
printf '%s\n' '--- Python test files ---'
test_files="$(git ls-files | rg '(^|/)(test_.*|.*_test|.*tests?)\.py$' || true)"
if [ -z "$test_files" ]; then
echo "No Python test files found"
else
printf '%s\n' "$test_files"
printf '%s\n' '--- focused test references ---'
printf '%s\n' "$test_files" | xargs -r rg -n -S \
'DiagramViewCreateIn|TableAnnotationUpsertIn|ApiKeyCreateIn|\\x00|\\x1b|\\x7f|multiline' || true
fiRepository: ContextualWisdomLab/pg-erd-cloud Length of output: 3971 π Script executed: #!/usr/bin/env bash
set -u
printf '%s\n' '--- repository state ---'
git status --short
git diff --stat
printf '%s\n' '--- annotation tests ---'
sed -n '1,110p' backend/tests/test_api_annotations.py
printf '%s\n' '--- diagram-view tests ---'
sed -n '1,105p' backend/tests/test_api_diagram_views.py
printf '%s\n' '--- API-key tests ---'
sed -n '1,85p' backend/tests/test_api_keys.py
printf '%s\n' '--- schema-validation tests ---'
sed -n '1,75p' backend/tests/test_schema_validation.pyRepository: ContextualWisdomLab/pg-erd-cloud Length of output: 10807 π Script executed: #!/usr/bin/env bash
set -u
printf '%s\n' '--- generic schema tests ---'
sed -n '1,210p' backend/tests/test_fuzz_properties.py
printf '%s\n' '--- relevant field constructions in tests ---'
rg -n -S \
'schema_name\s*=|relation_name\s*=|key_name\s*=|body\s*=.*\\n|name\s*=.*\\n' \
backend/tests/test_*.py || trueRepository: ContextualWisdomLab/pg-erd-cloud Length of output: 8884 λ€ νλμ μ λ ₯ κ³μ½μ λν νκ· ν μ€νΈλ₯Ό μΆκ°νμΈμ.
π€ Prompt for AI AgentsSource: Coding guidelines |
||
| # Opaque client layout (node positions, hidden tables, viewport). The API | ||
| # bounds the serialized size in the endpoint to prevent abuse. | ||
| layout_json: dict | ||
|
|
@@ -214,8 +214,12 @@ class DiagramViewDetailOut(DiagramViewOut): | |
| class TableAnnotationUpsertIn(BaseModel): | ||
| """Request body for creating/updating a table annotation.""" | ||
|
|
||
| schema_name: str = Field(min_length=1, max_length=255) | ||
| relation_name: str = Field(min_length=1, max_length=255) | ||
| schema_name: str = Field( | ||
| min_length=1, max_length=255, pattern=r"^[^\x00-\x1F\x7F]+$" | ||
| ) | ||
| relation_name: str = Field( | ||
| min_length=1, max_length=255, pattern=r"^[^\x00-\x1F\x7F]+$" | ||
| ) | ||
| body: str = Field(min_length=1, max_length=10_000) | ||
|
|
||
|
|
||
|
|
@@ -302,7 +306,7 @@ class DbmlConvertOut(BaseModel): | |
| class ApiKeyCreateIn(BaseModel): | ||
| """Request body for creating an API key.""" | ||
|
|
||
| key_name: str = Field(min_length=1, max_length=128) | ||
| key_name: str = Field(min_length=1, max_length=128, pattern=r"^[^\x00-\x1F\x7F]+$") | ||
|
|
||
|
|
||
| class ApiKeyOut(BaseModel): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π Validation change lacks regression tests
Four public fields gain new rejection rules without tests for control boundaries or valid Unicode. Repository policy requires tests for behavior changes.
Was this helpful? React with π or π to provide feedback.