[SILO-964] chore: route all /auth/o/token calls to internal api base url#65
[SILO-964] chore: route all /auth/o/token calls to internal api base url#65Prashant-Surya merged 11 commits intocanaryfrom
Conversation
* fix: added build check workflow * chore: typo fixes
- Update Dockerfile to use uv sync --frozen instead of uv pip install - Ensures exact dependency versions from lock file are used Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
📝 Walkthrough🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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. Comment |
- Add plane_internal_base_url for server-to-server calls (token exchange, API verification) - Authorization endpoint uses external URL (user's browser) - Token endpoint uses internal URL (optimized for internal network) - Add Redis storage logging and fix port type casting - Falls back to external URL if internal not configured Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
722f075 to
78e2005
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@Dockerfile`:
- Around line 19-20: The Dockerfile currently runs "uv sync --frozen --no-cache
--no-dev" which creates /app/.venv but the ENTRYPOINT ["python", "-m",
"plane_mcp"] invokes the base image Python, causing missing deps; fix by either
(A) exporting PATH to prioritize the venv bin directory before the ENTRYPOINT so
the venv's python is used, or (B) change the ENTRYPOINT to invoke "uv run" so
the environment is auto-activated, or (C) run uv sync with the --system flag to
install into the system Python; update the Dockerfile accordingly and keep the
existing ENTRYPOINT symbol name ("ENTRYPOINT" invoking python -m plane_mcp) or
replace it with the uv-run variant.
🧹 Nitpick comments (4)
plane_mcp/auth/plane_oauth_provider.py (1)
126-129: Pre-existing: token prefix is logged at INFO level.Line 129 logs the first 20 characters of the bearer token. Even partial tokens can be exploited if logs are compromised. Consider removing this or gating it behind DEBUG level in a follow-up.
plane_mcp/server.py (2)
15-17: Moveimport loggingto the module level.Function-scoped imports of standard library modules are unconventional and add slight overhead on every call.
loggingis a standard import that belongs at the top of the file alongsideos.Proposed fix
At the top of the file:
import logging import osThen inside the function, just:
logger = logging.getLogger(__name__)Or even better, use the same
get_loggerutility imported in the auth module for consistency.
41-42: Empty-string defaults bypass theNotSetsentinel in the provider.When the env var is unset,
os.getenv("PLANE_INTERNAL_BASE_URL", "")passes""to the provider, which then has to rely on the falsy-ness of""to fall through to its own env-var lookup. This works today but is fragile — if the provider ever tightens validation (e.g., URL format check), an empty string would fail differently thanNotSet.Prefer passing
None(or omitting the kwarg) so the provider'sNotSet/ env-var fallback logic is exercised cleanly:Suggested change
- plane_base_url=os.getenv("PLANE_BASE_URL", ""), - plane_internal_base_url=os.getenv("PLANE_INTERNAL_BASE_URL", ""), + plane_base_url=os.getenv("PLANE_BASE_URL") or NotSet, + plane_internal_base_url=os.getenv("PLANE_INTERNAL_BASE_URL") or NotSet,This requires importing
NotSetfromfastmcp.utilities.types. Alternatively, simply omit the kwargs when the env vars aren't set, or let the provider handle the env vars entirely (it already does viaos.getenvfallback in lines 327–334 of the provider).Dockerfile (1)
13-13: Consider pinning theuvversion for reproducible builds.Using
:latestfor the uv image means builds are not fully reproducible — a future uv release with breaking changes could silently break the build. Since this PR is already improving reproducibility by addinguv.lock, pinning the uv version would complete that story. The current latest version is 0.10.0.Suggested change
-COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv +COPY --from=ghcr.io/astral-sh/uv:0.10.0 /uv /usr/local/bin/uv
Description
Type of Change
Test Scenarios
References
[SILO-964]
Summary by CodeRabbit
New Features
Refactor
Chores