fix: Reject non-HTTPS Alibaba Token Plan overrides#1104
Conversation
# Conflicts: # Sources/CodexBar/UsageStore.swift # Sources/CodexBarCore/Generated/CodexParserHash.generated.swift
|
Codex review: needs real behavior proof before merge. Latest ClawSweeper review: 2026-05-22 11:31 UTC / May 22, 2026, 7:31 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Source inspection on current main shows quotaURL accepts any parsed scheme, hostOverride returns the cleaned override unchanged, and the fetcher consumes those values as request targets. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the narrow HTTPS-only Token Plan override hardening after redacted terminal or log proof is added and maintainers accept that explicit non-HTTPS Token Plan endpoint overrides are unsupported. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main shows quotaURL accepts any parsed scheme, hostOverride returns the cleaned override unchanged, and the fetcher consumes those values as request targets. Is this the best way to solve the issue? Mostly yes. Validating schemes at the settings-reader boundary is a narrow maintainable hardening path that preserves bare-host HTTPS inference, but the silent fallback and Token Plan-only policy need maintainer acceptance. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 68a6b23ba641. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
Summary
ALIBABA_TOKEN_PLAN_HOSTandALIBABA_TOKEN_PLAN_QUOTA_URLvalues.https://for quota URL overrides without a scheme.Implementation Notes
hostOverridenow returnsnilwhen the override includes a scheme other thanhttps.quotaURLnow returnsnilfor explicit non-HTTPS schemes instead of accepting them as-is.http://or other schemes for Token Plan endpoints.Validation
swift test --filter AlibabaTokenPlan- passed.git diff --check- passed.make check- SwiftFormat/SwiftLint reported 0 violations; the command exited non-zero because the sandbox could not write the SwiftLint cache plist.CODEXBAR_SIGNING=adhoc CODEXBAR_WIDGET_METADATA_MODE=skip ./.build/codexbar-package-app-nosandbox.sh release- passed; producedCodexBar.app.codesign --verify --deep --strict --verbose=2 CodexBar.app- passed.Risk