Run plugin hooks for resource reads - #128
Open
lucarlig wants to merge 5 commits into
Open
Conversation
lucarlig
force-pushed
the
user/luca/issue-6253-cpex-typed-extensions
branch
from
September 3, 2026 09:52
34a2c5b to
e4193e9
Compare
lucarlig
marked this pull request as ready for review
September 3, 2026 09:59
lucarlig
marked this pull request as draft
September 3, 2026 10:23
lucarlig
marked this pull request as ready for review
September 3, 2026 10:27
lucarlig
force-pushed
the
user/luca/issue-6253-cpex-typed-extensions
branch
from
September 4, 2026 15:23
6df91b2 to
cdd1aef
Compare
Signed-off-by: lucarlig <luca.carlig@ibm.com>
Signed-off-by: lucarlig <luca.carlig@ibm.com>
Signed-off-by: lucarlig <luca.carlig@ibm.com>
lucarlig
force-pushed
the
user/luca/issue-6253-cpex-typed-extensions
branch
from
September 4, 2026 15:26
cdd1aef to
4aff72d
Compare
Signed-off-by: lucarlig <luca.carlig@ibm.com>
This was referenced Sep 4, 2026
Signed-off-by: lucarlig <luca.carlig@ibm.com>
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.
Resource reads now run CPEX hooks before the backend fetch and before returning its contents. Plugins can allow or deny reads, rewrite a URI to an unambiguous target in the caller's published resource routes, and transform returned text or binary content.
Result transformations may change URI, MIME type and text/blob format. Existing MCP metadata and unchanged blob wire values are preserved. CMF-only envelope and descriptive fields no longer cause blanket rejection. Text takes precedence when both text and blob are supplied, matching the built-in serializer.
The request-owned hook state preserves the selected runtime across configuration reloads. Authorization checks and errors for content that cannot be converted to MCP remain. Prompt conversion is unchanged from the base branch; this PR adds no prompt-wide payload validation.
Part of IBM/mcp-context-forge#6253 and IBM/mcp-context-forge#6254. Effective policy selection and trusted request extensions remain separate framework work.
Validation: 238 all-feature workspace tests passed, with 13 existing skips. All-feature Clippy and build, formatting, dependency/license audit, cargo shear, and wiki build/test passed. Regression coverage includes direct/aliased routes, text/blob changes, metadata preservation, pre/post denial, allowed URI rewrites, unpublished/ambiguous targets and reload consistency. Focused checks against built-in CPEX 0.1.3 and the pinned gateway serialization source confirm the modified payload behavior; this is not a full two-dataplane parity certification.