revert(mcp): drop policy expiry (expires_at) from mcp_policies - #826
Merged
Conversation
Product decision: policy expiry is not a customer requirement — keep the MCP access policy surface minimal. The field shipped in #822 and was never part of a cut release, so no stored documents carry it. - McpPolicy loses expires_at; activity is the enabled flag alone (a disabled policy neither grants nor denies). - ToolAcl::resolve drops its timestamp parameter; the /mcp mount no longer threads a clock into ACL resolution. - Schema regenerated; the expiry test cases collapse into enabled-only equivalents. The e2e suite never used the field. Compatibility: the document schema is closed, so a row carrying expires_at would be rejected after this lands — no released version ever wrote the field and the paired control-plane change stops accepting it, so only a policy saved with an expiry on a dev/main deployment inside the feature's two-day window would need one re-save.
📝 WalkthroughWalkthroughMCP policy expiration support was removed from the model, schemas, and ACL resolution. Policy filtering now uses only ChangesMCP policy expiry removal
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MCPClient
participant dispatch
participant ToolAcl
participant AisixSnapshot
MCPClient->>dispatch: MCP tool request
dispatch->>ToolAcl: resolve(snapshot, key)
ToolAcl->>AisixSnapshot: read enabled policy entries
AisixSnapshot-->>ToolAcl: policy data
ToolAcl-->>dispatch: resolved ACL
dispatch-->>MCPClient: allow or deny tool call
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope trim for the layered MCP access policy (#822, Ref api7/AISIX-Cloud#1034): policy expiry turned out not to be a customer requirement, so the surface is reverted to its minimal shape before any release carries it. A policy's activity is now the
enabledflag alone — a disabled policy neither grants nor denies.McpPolicylosesexpires_at(schema regenerated);ToolAcl::resolvedrops its timestamp parameter and the/mcpmount no longer threads a clock into ACL resolution; the chrono dependency added for this leavesaisix-mcp.deny_unknown_fields), so a stored row carryingexpires_atwould be rejected after this lands. No released version ever wrote the field (0.5.0 predates feat(mcp): layered MCP access policies — env default, team entitlement, key narrowing #822); only a policy saved with an expiry on a dev/main deployment inside the feature's two-day window would need one re-save. The paired control-plane revert (field off the API/UI/projection, and the never-released DB column dropped outright — the additive-only rule protects released shapes only) follows once this is onmain.Summary by CodeRabbit
Transition detail for that window: the loader skips a schema-rejected row and serves the rest, so a stored policy row still carrying
expires_atis dropped whole until re-saved — its grant fails closed (visible immediately), and itsdenyoverlay stops applying until the re-save. Both resolve with one save of the policy.