Skip to content

Enforce authorization in tf.data service RPC handlers. - #130331

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
exported_pr_1021247208
Draft

copybara-service[bot] wants to merge 1 commit into
masterfrom
exported_pr_1021247208

Conversation

@copybara-service

Copy link
Copy Markdown

Enforce authorization in tf.data service RPC handlers.

Add a virtual Authorize(const grpc::AuthContext*) hook to
CredentialsFactory and invoke it in the RPC handler macros of
GrpcDispatcherImpl, GrpcWorkerImpl, and FastrakGrpcService before
dispatching requests. Implement Loas2CredentialsFactory::Authorize to
require an authenticated peer whose GRPC_LOAS_MDB_USER_PROPERTY_NAME
matches the server process owner, and route in-process state queries in
DispatchGrpcDataServer and WorkerGrpcDataServer directly through
impl() instead of constructing unauthenticated ServerContext
instances.

Add a virtual `Authorize(const grpc::AuthContext*)` hook to
`CredentialsFactory` and invoke it in the RPC handler macros of
`GrpcDispatcherImpl`, `GrpcWorkerImpl`, and `FastrakGrpcService` before
dispatching requests. Implement `Loas2CredentialsFactory::Authorize` to
require an authenticated peer whose `GRPC_LOAS_MDB_USER_PROPERTY_NAME`
matches the server process owner, and route in-process state queries in
`DispatchGrpcDataServer` and `WorkerGrpcDataServer` directly through
`impl()` instead of constructing unauthenticated `ServerContext`
instances.

PiperOrigin-RevId: 1021247208
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.

1 participant