fix(policy): add tls: terminate to telegram preset - #2126
Conversation
The telegram.yaml preset was missing tls: terminate on the api.telegram.org endpoint. The baseline openclaw-sandbox.yaml has it, but the preset omitted it. After PR #2098 changed how the gateway handles the tls field, the omission causes the L7 proxy to return 403 for live policy-add requests (TC-NET-03).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
The original test asserted all messaging presets must not contain tls: terminate. After OpenShell v0.0.15 changed TLS auto-termination behavior, REST-only presets like telegram need tls: terminate for the L7 proxy to work. Discord and Slack use tls: skip on their WebSocket endpoints only. Split the assertion: WebSocket presets (discord, slack) must not use terminate; the telegram REST preset must use it.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/policies.test.ts`:
- Around line 609-621: Update the two tests that call policies.loadPreset so
they assert TLS settings on the specific endpoint host blocks rather than via a
global substring check: for the "messaging WebSocket presets use tls: skip, not
terminate" test iterate the presets ("discord","slack"), load the preset via
policies.loadPreset(name) and parse/inspect the host/gateway block for that
service to assert the host block explicitly contains tls: skip (or does not
contain tls: terminate) for that host entry; for the "telegram REST preset uses
tls: terminate for L7 proxy" test load policies.loadPreset("telegram") and
locate the api.telegram.org endpoint block and assert it explicitly contains
tls: terminate. Use the same symbols (policies.loadPreset and the test names) to
locate and change the assertions so they check the endpoint-level block rather
than a simple substring search.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9dbcea90-8cb3-42ff-99f3-75c149c24443
📒 Files selected for processing (1)
test/policies.test.ts
Use regex patterns that match host + tls on the same endpoint block so regressions in one endpoint cannot be masked by a correct sibling. Addresses CodeRabbit review feedback.
|
not quite follow, seems "tls: terminate" is deprecated, and is actually the default behavior of openshell now. |
|
On top of that that setting is now ignored... It's the wrong fix. |
Summary
telegram.yamlpreset was missingtls: terminateon theapi.telegram.orgendpointopenclaw-sandbox.yamlhas it, but the preset omitted itTest plan
network-policy-e2ejob passes (TC-NET-03)Fixes regression from #2098.
Summary by CodeRabbit