Skip to content

Scan HTTP API endpoints without changing policy precedence - #46

Open
yui-stingray wants to merge 1 commit into
masterfrom
codex/scan-http-api-urls
Open

Scan HTTP API endpoints without changing policy precedence#46
yui-stingray wants to merge 1 commit into
masterfrom
codex/scan-http-api-urls

Conversation

@yui-stingray

Copy link
Copy Markdown
Owner

Summary

  • extract both HTTP and HTTPS endpoint candidates
  • treat URL schemes and hostnames case-insensitively while preserving userinfo, ports, path, and query case
  • evaluate existing regex policies against both the original trimmed URL and a scheme/host canonical form so case-sensitive policies remain compatible
  • preserve allow-before-deny behavior and existing sanitized public CLI finding payloads

Verification

  • core regressions for HTTP, HTTPS, mixed-case schemes and hosts, scheme-specific policies, raw-policy compatibility, and allow precedence
  • CLI regressions confirm raw endpoint details, token-shaped query values, and matched-policy details stay out of stdout and stderr
  • targeted pytest passed
  • independent review found no remaining actionable findings in this scoped change

No release is cut or published by this PR.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@yui-stingray, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 114 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e0c33ee5-2b6f-45eb-9c22-c34998f7305c

📥 Commits

Reviewing files that changed from the base of the PR and between 41d08b5 and 2918a62.

📒 Files selected for processing (3)
  • src/agent_guard/api_guard.py
  • tests/cli/test_api.py
  • tests/test_api_guard.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@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 automated review suggestions for this pull request.

Reviewed commit: 2918a626a8

ℹ️ 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
  • 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 address that feedback".

url = normalize_url(match.group(0))

if any(pattern.search(url) for pattern in allowed_patterns):
url = match.group(0).rstrip(".,);]")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve bare IPv6 host brackets

For a newly supported bare IPv6 endpoint such as http://[::1], this character-set rstrip removes the host's required closing bracket, producing http://[::1. Consequently, an exact forbidden rule such as ^http://\[::1\]$ is bypassed, and broader rules return a corrupted ApiGuardFinding.url; trim surrounding punctuation without consuming a bracket that belongs to an IPv6 authority.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant