Skip to content

resources-file mode: support mcp_policies (or reject mcp_access) in the declarative document #823

Description

@jarvis9443

Follow-up to #822, which added the layered MCP access policy (etcd kind mcp_policies + the api_keys mcp_access block).

The resources-file source (crates/aisix-core/src/filesource/mod.rs KINDS) does not accept a top-level mcp_policies: collection, while an api_keys entry in the same file happily carries mcp_access (the file source validates keys with the canonical validate_apikey). A standalone operator can therefore write mcp_access: {mode: inherit} on a key with no way to define the policy it inherits from — the key resolves to zero MCP access. Fail-closed, so not a security issue, but a silent dead-end knob.

Options, in order of preference:

  1. Add ("mcp_policies", IdentityField::…) to KINDS and wire typed parsing like rate_limit_policies (identity: scope_ref for team rows, a fixed env identity for the default row).
  2. Alternatively, reject mcp_access in file-mode api_keys with a load error naming it managed-only.

Until then the layered policy is a managed-mode (control-plane) surface only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions