Repository navigation
Conversation
Add `WorkerCallAuthorizer`, which `Worker::with_call_authorizer` installs. The worker hands it each `CoordinatorChannel` and `ExecuteTask` call's request headers and decoded `TaskKey` after the first message decodes and before the task entry is created or read, so an embedder can bind a task to whoever installed it. A refusal is the returned `Status`. Without an authorizer nothing changes. Closes datafusion-contrib#826 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 1, 2026
This branch has not been deployed
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.
Closes #826.
What
An optional
WorkerCallAuthorizeronWorker, installed withWorker::with_call_authorizer. The gRPC service hands it everyCoordinatorChannelandExecuteTaskcall as aWorkerCall- the request headers plus the decodedTaskKey- after the first message is decoded and beforetask_data_entriesis touched. AnErr(Status)is returned to the caller as is. With no authorizer set, nothing changes.Both are exported from
datafusion_distributed::grpc, behind thegrpcfeature.WorkerCallis#[non_exhaustive]so a later RPC can be added without breaking an authorizer, which then has to decide what to do with a call it does not know.Notes
LocalWorkerContext) cross no gRPC and are not asked. That seemed right: they come from the worker's own process.coordinator_channelnow takes the headers it already built frommetadata.into_headers()before the authorizer runs, instead of building them later;execute_tasksplits the request withinto_parts()to keep the headers.Tests
src/protocol/grpc/call_authorizer.rsdrives aWorkerthrough its ownWorkerServiceServerwith an authorizer that admits a call only with anx-admittedheader:a_refused_call_never_reaches_the_task_entries- a refusedSetPlanand a refusedExecuteTaskboth return the authorizer's status, and the worker has no task running afterwards.an_admitted_call_is_served_after_the_authorizer_saw_its_task_key- an admitted pair is served, and the authorizer saw both calls with their task key.Both fail when the two
self.authorize(..)calls are replaced with a no-op.We are running this patch against 4.0.0 now, so a release carrying it would let us go back to the published crate.
🤖 Generated with Claude Code