Skip to content

Revise PR #242: bearer token still crosses origins on redirect, plus a missing route - #262

Closed
jaylfc wants to merge 1 commit into
masterfrom
exec/tsk-revvkw
Closed

Revise PR #242: bearer token still crosses origins on redirect, plus a missing route#262
jaylfc wants to merge 1 commit into
masterfrom
exec/tsk-revvkw

Conversation

@jaylfc

@jaylfc jaylfc commented Aug 13, 2026

Copy link
Copy Markdown
Owner

CARD TITLE (intent, not commit subject): Revise PR #242: bearer token still crosses origins on redirect, plus a missing route

Autonomous build of board card tsk-revvkw.

Files:
taosmd/config.py | 47 +++++++++
taosmd/ref_fetch.py | 153 ++++++++++++++++++++++++++++++
taosmd/remote.py | 8 ++
taosmd/service.py | 62 +++++++++++-
tests/test_ref_fetch.py | 247 ++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 516 insertions(+), 1 deletion(-)

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 5 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c4fdc400-df3b-4726-b3e0-8aeae5aaeec3

📥 Commits

Reviewing files that changed from the base of the PR and between 051cf0a and a4f1266.

📒 Files selected for processing (5)
  • taosmd/config.py
  • taosmd/ref_fetch.py
  • taosmd/remote.py
  • taosmd/service.py
  • tests/test_ref_fetch.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.

@gitar-bot

gitar-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

Comment thread taosmd/service.py
headers["Authorization"] = f"Bearer {registry_token}"
req = urllib.request.Request(url, headers=headers, method="GET")
try:
with urllib.request.urlopen(req, timeout=30) as resp:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[WARNING]: urllib.request.urlopen follows redirects by default

The PR title flags "bearer token still crosses origins on redirect". While Python 3.10+ strips the Authorization header on cross-origin redirects, the fetcher still follows the redirect blindly. Consider using a custom HTTPRedirectHandler to prevent cross-origin redirects or explicitly handle them.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread taosmd/service.py
raise UnauthorizedError(f"HTTP {exc.code} from {url}") from exc
if exc.code == 404:
raise NotFoundError(f"HTTP 404 from {url}") from exc
raise

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[WARNING]: raise re-raises raw urllib.error.HTTPError for non-401/403/404 HTTP errors

The docstring promises only RefFetchError subclasses or ValueError, but callers must also handle raw urllib.error.HTTPError for server errors (500, 502, etc.). Consider wrapping them in RefFetchError for API consistency.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread taosmd/ref_fetch.py
)
_reject_dot_segments(path)
encoded_path = urllib.parse.quote(path, safe="/")
base = files_url.rstrip("/") if files_url else files_url

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[WARNING]: base = files_url.rstrip("/") if files_url else files_url does not validate None

When files_url is None (possible for direct callers of the public resolve_ref_uri), the subsequent f-string produces the malformed URL "None/api/projects/..." instead of failing fast. Consider validating files_url at the start of the function.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
taosmd/service.py 385 urllib.request.urlopen follows redirects by default; bearer token may leak on cross-origin redirects
taosmd/service.py 392 raise re-raises raw urllib.error.HTTPError for non-401/403/404 errors instead of wrapping in RefFetchError
taosmd/ref_fetch.py 84 base = files_url.rstrip("/") if files_url else files_url produces malformed URL for None
Files Reviewed (5 files)
  • taosmd/config.py - 0 issues
  • taosmd/ref_fetch.py - 1 issue
  • taosmd/remote.py - 0 issues
  • taosmd/service.py - 2 issues
  • tests/test_ref_fetch.py - 0 issues

Fix these issues in Kilo Cloud


Reviewed by step-3.7-flash · Input: 62.7K · Output: 23.6K · Cached: 471.6K

@jaylfc

jaylfc commented Aug 13, 2026

Copy link
Copy Markdown
Owner Author

BLOCKED and closing. Byte-identical to the branch it revises.

git diff --stat origin/exec/tsk-7xcsh5 origin/exec/tsk-revvkw -- <files the original touched>   ->   empty

Control: the same command on exec/tsk-xuuzct vs exec/tsk-zln2uf reports a real change, so the empty result is a measurement rather than a broken command.

Fourth no-op revision today. STEP 0 carried the work forward and nothing after it ran, so all three blockers from my review of #242 persist: the bearer token still crosses origins on redirect, POST /refs/fetch still has no server route, and the guard and fetch still resolve different base URLs.

Closing rather than leaving it open, because an open exec/<card> PR makes that card unclaimable (next_card.py:32), so this PR would freeze the very card that needs redoing. Nothing is discarded: the content still exists on exec/tsk-7xcsh5, which has its own open PR. tsk-revvkw stays open and becomes dispatchable again, and I have added the non-empty-diff acceptance note to it.

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