Skip to content

Add allowlist for hardcoded URL checker#69

Merged
csecrestjr merged 1 commit into
codex/create-hardcoded-url-check-scriptfrom
codex/fix-comment
Aug 31, 2025
Merged

Add allowlist for hardcoded URL checker#69
csecrestjr merged 1 commit into
codex/create-hardcoded-url-check-scriptfrom
codex/fix-comment

Conversation

@csecrestjr

Copy link
Copy Markdown
Collaborator

Summary

  • ignore known localhost references via scripts/hardcoded-url-allowlist.txt
  • mention allowlist in README

Testing

  • ./scripts/list-hardcoded-urls.sh
  • npm test (backend)
  • npm test (frontend)`

https://chatgpt.com/codex/tasks/task_e_68b4cfc741388321a48faf1f551e700f

@csecrestjr
csecrestjr merged commit 8d6c9d8 into codex/create-hardcoded-url-check-script Aug 31, 2025
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

matches=$(grep -R --line-number --exclude-dir=node_modules --exclude-dir=.git -E "http://localhost|localhost:5000" || true)
matches=$(echo "$matches" | grep -v 'scripts/list-hardcoded-urls.sh' || true)

if [[ -f "$ALLOWLIST_FILE" ]]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Filter only file paths when applying allowlist

The allowlist is applied with grep -F -v -f "$ALLOWLIST_FILE" against the entire file:line:content string produced by the previous grep. This causes false negatives when the line’s contents mention any string from the allowlist even if the file itself is not allowlisted (for instance, a comment that says “see README.md” and also contains a new http://localhost URL). In such cases the checker silently drops the match and will not fail the build, defeating the purpose of the safeguard. Filtering should be applied solely to the path portion before the first colon.

Useful? React with 👍 / 👎.

@csecrestjr
csecrestjr deleted the codex/fix-comment branch November 11, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant