Repository navigation
feat(host-cloudflare): los hosts internos reciben x-executor-origin (direct o service) - #25
Merged
Merged
Conversation
Alongside x-executor-account-id, internal hosts now receive x-executor-origin: direct for a person whose own client reached Access, and service for everything else (service-binding door, delegated runs, service tokens). Any incoming value is deleted first; the value comes from the verified principal only. Claude-Session: https://claude.ai/code/session_017gbcpUnzDxK1ztNW8exWzi
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.
Qué cambia
Junto con
x-executor-account-id, las llamadas a hosts internos ahora llevanx-executor-origin, con uno de dos valores:direct: una persona cuyo propio cliente MCP llegó a Executor por la puerta de Access.service: todo lo demás (puerta de service binding, ejecuciones delegadas, service tokens).El valor lo decide el servidor a partir del principal verificado. Nunca se lee de los headers de la solicitud ni de los argumentos de una herramienta:
routeInternalHostselimina cualquierx-executor-originentrante antes de fijar el valor, así que unx-executor-origin: directfalsificado en una llamada de servicio llega comoservice.Dónde se decide
apps/host-cloudflare/src/auth/cloudflare-access.ts:principalFromAccessClaims(persona con email =direct, service token =service),bindSubjecteinternalPrincipal(siempreservice).packages/core/sdk/src/hosted-http-client.ts:routeInternalHostsborra y fija el header.Principal.originhasta la sesión MCP y hasta el executor con alcance. Si falta, se asumeservice.Pruebas
hosted-http-client.test.ts:direct,service, header falsificado reemplazado y header ausente sin la opción.cloudflare-access.test.ts: persona, service token, delegado, puerta interna y header falsificado ignorado.