Forward access token in Orbit GraphQL status request context

What does this MR do and why?

!264924 (merged) added the token_type claim but wired it through the REST Orbit API only. GraphQL status queries still don't send the token type or the Duo Workflow source type to the Orbit server. This passes both through, as REST does, so they are correct if those calls start being recorded for analytics. Nothing user-visible changes today.

Related to gitlab-org/orbit/knowledge-graph#310 (closed)

Testing

Extended the Orbit namespace request spec: a PAT-authenticated query sends personal_access_token, a session-authenticated one sends none, and an ai_workflows OAuth token sends oauth_access_token with source type dws. The PAT and OAuth examples fail without the change.

Agent context
  • Resolvers::Analytics::Orbit::StatusResolvable#orbit_request_context now passes access_token: context[:access_token] to RequestContext.from_request, and the OauthAccessToken (when it is one) as oauth_access_token: to SourceType.for_orbit_request, mirroring API::Orbit::Data#orbit_request_context. GraphqlController already sets context[:access_token].
  • This is a consistency fix. The token_type claim comes from !264924 (merged) and is analytics only. GKG records it on execute_query events, and these status resolvers never call execute_query.
  • Out of scope: the other RequestContext sites (API::Orbit::McpHandlers::Base, Analytics::KnowledgeGraph::InfoService, Mcp::Tools::Orbit::CommandCatalog).
  • Specs run on a Caproni slot: namespace_spec.rb 102 examples, 0 failures (2 pending, existing). Rubocop clean.
  • Title carries [skip ci], so no MR pipeline runs. Branch pipelines are not covered by it.
Edited by Dmitry Gruzd

Merge request reports

Loading
Loading