fix(config): migrate bundled private-network aliases#60862
Conversation
Greptile SummaryThis PR centralizes private-network opt-in semantics across five bundled channel plugins (Matrix, BlueBubbles, Mattermost, Nextcloud Talk, Tlon) by making Key changes:
Confidence Score: 4/5Safe to merge — the migration is backward-compatible, preserves existing private-network opt-in semantics, and the core logic is well-tested. The implementation is consistent across all five channel adapters, the OR-based migration logic handles all realistic config combinations correctly, and
Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/mattermost/src/doctor.ts
Line: 77-142
Comment:
**Missing doctor test for Mattermost**
All four other channels modified in this PR (Matrix, BlueBubbles, Nextcloud Talk, Tlon) received new or updated `doctor.test.ts` files covering the `normalizeCompatibilityConfig` migration. Mattermost's `normalizeMattermostCompatibilityConfig` function is new in this PR but has no corresponding test.
This isn't a correctness issue — the implementation mirrors the other four adapters — but it's a coverage gap that is inconsistent with the rest of the PR. A minimal smoke test like the ones added for the other channels would confirm the top-level and account-level migrations both produce the expected output (e.g., `allowPrivateNetwork: true` → `network.dangerouslyAllowPrivateNetwork: true`).
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/plugin-sdk/ssrf-policy.test.ts
Line: 134-153
Comment:
**Conflict case only tested in one direction**
The existing test covers `{ allowPrivateNetwork: true, network: { dangerouslyAllowPrivateNetwork: false } }` → `true` (legacy wins over new-key `false`). The symmetric case — `{ allowPrivateNetwork: false, network: { dangerouslyAllowPrivateNetwork: true } }` → `true` (new key wins over legacy `false`) — is not covered but is equally valid. Both branches exercise the same OR logic, and the omission is unlikely to hide a bug, but adding the reverse case would make the test table complete and the contract explicit.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "Merge branch 'main' into vk/allow-privat..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 393af03cc8
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92b01313d3
ℹ️ 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".
| if ( | ||
| typeof legacyAllowPrivateNetwork === "boolean" || | ||
| typeof currentDangerousAllowPrivateNetwork === "boolean" | ||
| ) { | ||
| // Preserve current effective posture while collapsing to the canonical key. | ||
| resolvedDangerousAllowPrivateNetwork = | ||
| legacyAllowPrivateNetwork === true || currentDangerousAllowPrivateNetwork === true; |
There was a problem hiding this comment.
Honor explicit false when migrating conflicting network keys
When both allowPrivateNetwork and network.dangerouslyAllowPrivateNetwork are present, this migration collapses them with a boolean OR, which can silently turn a disabled config into enabled private-network access. In mixed/stale configs (for example legacy allowPrivateNetwork: false plus a leftover/new network.dangerouslyAllowPrivateNetwork: true), upgrade now rewrites to true, widening SSRF scope unexpectedly. The conflict resolution should be deterministic (prefer one source key) rather than OR-merging.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be33869ec7
ℹ️ 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".
be33869 to
26d63b9
Compare
* refactor(plugin-sdk): centralize private-network opt-in semantics * fix(config): migrate bundled private-network aliases * fix(config): add bundled private-network doctor adapters * fix(config): expose bundled channel migration hooks * fix(config): prefer canonical private-network key * test(config): refresh rebased private-network outputs
* refactor(plugin-sdk): centralize private-network opt-in semantics * fix(config): migrate bundled private-network aliases * fix(config): add bundled private-network doctor adapters * fix(config): expose bundled channel migration hooks * fix(config): prefer canonical private-network key * test(config): refresh rebased private-network outputs
* refactor(plugin-sdk): centralize private-network opt-in semantics * fix(config): migrate bundled private-network aliases * fix(config): add bundled private-network doctor adapters * fix(config): expose bundled channel migration hooks * fix(config): prefer canonical private-network key * test(config): refresh rebased private-network outputs
* refactor(plugin-sdk): centralize private-network opt-in semantics * fix(config): migrate bundled private-network aliases * fix(config): add bundled private-network doctor adapters * fix(config): expose bundled channel migration hooks * fix(config): prefer canonical private-network key * test(config): refresh rebased private-network outputs
Summary
network.dangerouslyAllowPrivateNetworkallowPrivateNetworkas compat-only input via channel doctor normalization on loadChannels
Verification
git diff --checkpnpm plugin-sdk:api:genpnpm config:channels:genpnpm config:docs:genpnpm plugin-sdk:api:checkpnpm config:channels:checkpnpm config:docs:checkpnpm buildnode --import tsxsmoke for helper + all five doctor adaptersNotes
false/ unset posture is preserved. Only explicit opt-in continues to emit private-network SSRF allowance.