Repository navigation
feat(engine): add per-message authorization to ModelPipeline.transform - #2369
Merged
Merged
Conversation
Add long authorization to ModelPipeline.transform(...), positioned beside traceId/bindingId, and a matching ModelController.authorization() read accessor so a per-field ModelTransform stage can read the authorization in effect for the message it is processing rather than a stream-open snapshot. Threads the new parameter through every ModelPipeline implementation (model-core, model-json, model-protobuf, model-avro, engine's TestModelPipeline) and every call site (binding-sse, binding-http, binding-mqtt, binding-mcp, and binding-kafka's cache read/write paths). ModelFieldBridge.start(...) and AvroModelTransform gain the plumbing needed to expose the value to a wired ModelTransform via ModelController.authorization(). The Kafka fetch-from-broker cache-population path has no per-consumer authorization to thread (it populates the shared cache from the topic itself, ahead of any consumer's authorized read), so it passes a documented NO_AUTHORIZATION constant; the produce path threads the producing client's actual authorization. Adds unit coverage for authorization threading through TestModelPipeline, a changed authorization value observed on the next transform call, and a ModelTransform stage reading control.authorization() via ModelFieldBridge. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EoZdsAEjwf7oLcpi1rS3j
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.
Description
Adds
long authorizationtoModelPipeline.transform(...), positioned besidetraceId/bindingIdwhere per-operation authorization already sits throughout the engine, and a matchingModelController.authorization()read accessor so a per-fieldModelTransformstage can read the authorization in effect for the message it is processing, rather than a snapshot taken when the stream opened. Guards expire and reauthorize mid-stream, and Kafka consume streams are long-lived, so a stale stream-open snapshot is a reachable authorization bug in normal operation.Threads the new parameter through every
ModelPipelineimplementation (model-core,model-json,model-protobuf,model-avro, engine'sTestModelPipeline) and every call site (binding-sse,binding-http,binding-mqtt,binding-mcp, andbinding-kafka's cache read/write paths).ModelFieldBridge.start(...)andAvroModelTransformgain the plumbing needed to expose the value to a wiredModelTransformviaModelController.authorization().The Kafka fetch-from-broker cache-population path has no per-consumer authorization to thread — it populates the shared cache from the topic itself, ahead of any consumer's authorized read — so it passes a documented
NO_AUTHORIZATIONconstant; the produce path threads the producing client's actual authorization.This is the widest change in the "Data Privacy Protection" epic (zilla-platform#383) — it touches Apache-licensed
engine, every model implementation, and every binding that uses a model — split out of #1680 because of that scope. Consumers of this channel (#1689 and its produce-path equivalent) will readcontrol.authorization()from within aModelTransformstage.Adds unit coverage for authorization threading through
TestModelPipeline, a changed authorization value observed on the nexttransform()call, and aModelTransformstage readingcontrol.authorization()viaModelFieldBridge.Fixes #2310
Test plan
./mvnw checkstyle:check— 0 violations across every touched module./mvnw testfor every touched module (engine, model-core/json/protobuf/avro, binding-sse/http/mqtt/mcp/kafka) — all green./mvnw install(including the Docker image build) — greenGenerated by Claude Code