Conversation
Signed-off-by: yosrixp <yosrixp@yahoo.com>
Signed-off-by: yosrixp <yosrixp@yahoo.com>
Signed-off-by: yosrixp <yosrixp@yahoo.com>
MartinTrojans
approved these changes
May 21, 2026
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.
Add Linear MCP provider integration
Adds
linearas an upstream MCP provider in MoP, mirroring the Datadog rollout. Linear is exposed athttps://(dev-)mcp-gateway.ouryahoo.com/v1/linear/mcp.Linear-specific deltas vs Datadog
client-secret-keyplaceholder is configured but ignored byLinearUpstreamRefreshClientandTokenExchangeServiceLinearImpl; tests assert noclient_secretin body and noAuthorizationheader.comments:create,issues:create,read,timeSchedule:write,writejoined with commas. Forced viaextra-params.scope(Quarkus'authentication.scopeslist space-joins).actor=userextra-param on/authorize(deliberately noprompt=consent).storeTokensoverload (Linear AT exceeds the global ~8h cap)./internal/linear/oauth-userinfoPOSTsquery { viewer { id name email } }tohttps://api.linear.app/graphqland flattens to top-levelemail/id/name/sub.Workflow
flowchart TB user[User browser] authorize["AuthorizeResource /authorize"] liCb["LinearResource /linear/authorize @Authenticated"] liSynth["/internal/linear/oauth-userinfo flattens GraphQL viewer"] tokenEp["TokenResource /token"] refreshSvc[UpstreamRefreshService.refreshUpstream] liClient[LinearUpstreamRefreshClient public PKCE] authorizerSvc[AuthorizerService.storeTokens L2 seed] L2[("mcp-oauth-proxy-upstream-tokens row linear#sub")] L1[("mcp-oauth-proxy-tokens row client#linear#sub")] liAuthz[https://linear.app/oauth/authorize] liToken[https://api.linear.app/oauth/token] liGraph[https://api.linear.app/graphql] user -->|"/authorize?resource=.../v1/linear/mcp"| authorize authorize -->|"redirect /linear/authorize"| liCb liCb -->|"PKCE + actor=user + comma scopes"| liAuthz liAuthz -->|"code"| liCb liCb -->|"POST code+verifier (no client_secret)"| liToken liToken -->|"AT 24h + RT rotating"| liCb liCb -->|"Quarkus auto userinfo"| liSynth liSynth -->|"POST viewer query, Bearer AT"| liGraph liSynth -->|"flat email, id, name, sub"| liCb liCb -->|"storeTokens linear lifetime=86399"| authorizerSvc authorizerSvc -->|"seed canonical RT"| L2 authorizerSvc -->|"per-client AT"| L1 tokenEp -->|"refresh_token grant"| refreshSvc refreshSvc -->|"resolveRefreshTokenClient(linear)"| liClient liClient -->|"POST grant_type=refresh_token client_id only"| liTokenFiles
New (production)
LinearResource.java—/linear/authorizecallback, 8-argstoreTokens.LinearUserInfoResource.java— synthetic GraphQL viewer flattener.LinearUpstreamRefreshClient.java— canonical L2 refresh client (public PKCE, RT rotation, carry-forward fallback,TODO(linear-confidential)hook).TokenExchangeServiceLinearImpl.java— legacy passthrough impl.Modified (production)
UpstreamProviderClassifier.java— Linear added toPROMOTED_PROVIDERS+ dispatch.TokenExchangeServiceProducer.java—case "linear".OauthProviderLabel.java— addedLINEAR.Config
application.yaml,application.dev.yaml,configmap.yaml, chartvalues.yaml, stage + both prod values files —quarkus.oidc.lineartenant,/linear/*and/internal/linear/*permissions,server.token-exchange.linear,upstream-token.expiry-seconds-by-provider.linear=15552000, resource-mapping for/v1/linear/mcp.application.dev.yaml— also renamedembrace-local-insecure→dev-local-insecure(generic) and reused for Datadog/Linear/Embrace tenants whose synthetic userinfo runs onhttps://localhost.Tests (195 pass)
LinearUpstreamRefreshClientTest,TokenExchangeServiceLinearImplTest,LinearResourceTest,LinearUserInfoResourceTest.UpstreamProviderClassifierTest,UpstreamTokenConfigTest,TokenExchangeServiceProducerTest.client_secretin body, noAuthorizationheader on refresh.TTL summary
mcp-oauth-proxy-tokens(bare row)storeTokens(matches Linear AT)mcp-oauth-proxy-upstream-tokensRisks / assumptions
LinearUpstreamRefreshClientuses the public-client Nimbus overload.TODO(linear-confidential)hook documents the future flip toClientSecretBasic. Tests assert no secret leaks onto the wire.extra-params.scope.authentication.scopes: []+add-openid-scope: falseensures Quarkus emits no scope of its own. Verify the assembled/authorizeURL in stage.