Skip to content

feat(engine): add per-message authorization to ModelPipeline.transform - #2369

Merged
jfallows merged 1 commit into
developfrom
claude/github-issue-2310-033pjy
Aug 13, 2026
Merged

jfallows merged 1 commit into
developfrom
claude/github-issue-2310-033pjy

Conversation

@jfallows

Copy link
Copy Markdown
Contributor

Description

Adds long authorization to ModelPipeline.transform(...), positioned beside traceId/bindingId where per-operation authorization already sits throughout the engine, 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 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 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.

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 read control.authorization() from within a ModelTransform stage.

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.

Fixes #2310

Test plan

  • ./mvnw checkstyle:check — 0 violations across every touched module
  • ./mvnw test for every touched module (engine, model-core/json/protobuf/avro, binding-sse/http/mqtt/mcp/kafka) — all green
  • Full repo ./mvnw install (including the Docker image build) — green

Generated by Claude Code

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
@jfallows
jfallows merged commit 79e0a55 into develop Aug 13, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

engine: add per-message authorization to ModelPipeline.transform

2 participants