Repository navigation
feat(plugins): a Skilled OpenAPI binding can send each caller's own connected credential - #1096
Merged
frontegg-david merged 3 commits intoNov 4, 2026
Conversation
…onnected credential A server serving many callers sent every caller the same credential for a binding: the resolver was told only the vaultRef and the bundle id. - The new authProviders option maps a binding's vaultRef to the auth provider each caller connected it as. Each request reads that caller's credential from the vaults @tool({ authProviders }) reads (this.authProviders, else the session credential vault), and never falls back to credentials, a resolver or another caller's credential. - A caller who hasn't connected it gets ToolCredentialsRequiredError (-32001) with the session vault's connect URL as authUrl, and nothing is sent. run_workflow raises it when the run fails on it; the message leaves the URL out, since the URL lets its holder connect a credential for the caller. - A SkilledOpenApiCredentialResolver is told the caller as opts.authInfo, so it can pick a per-tenant credential. Existing resolvers keep working.
…nd one who hasn't connected it is asked to A local-mode entry of the Skilled OpenAPI e2e app maps the bundle's billing binding to the billing credential each caller connects at sign-in. The https mock accepts each caller's token and records which one arrived: two callers running the same action each send their own, and a caller who connected none gets -32001 with a connect URL while nothing reaches the API, though the server's own billing token is still configured.
…feat/skilled-caller-credentials
frontegg-david
marked this pull request as ready for review
November 4, 2026 19:54
Contributor
Author
|
@coderabbitai review |
Contributor
|
Warning Review limit reachedYour organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Next included review available in 22 minutes. View limit details
|
Contributor
Action not completed
|
alexmercerpo
approved these changes
Nov 4, 2026
Contributor
Performance Test ResultsStatus: ✅ All tests passed Summary
Total: 101 tests across 21 projects 📊 View full report in workflow run Generated at: 2026-11-04T20:10:44.854Z |
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.
What and why
Stacks on #1095.
When one server serves many callers, each caller should send the API their own credential. Up to now every caller of a Skilled OpenAPI server sent the same one: the credential resolver was told only a binding's
vaultRefand the bundle id, so it had no way to tell callers apart. This PR adds two ways to send each caller's own credential, without changing what a bundle holds.A binding can send the credential the caller connected. The new
authProvidersplugin option maps a binding'svaultRefto the auth provider each caller connects it as:On each request, the plugin reads that caller's credential from the vaults
@Tool({ authProviders })already reads:this.authProviders):oauthandoauth_pkcesend their access token,bearerits token,api_keyits key;this.credentials), wherelocalandremotemodes keep whatauthenticate()returns at sign-in or through the connect link.The mapping is a server option, not part of the bundle, so a signed bundle stays portable. It names only the
vaultRef, and each server decides where that credential comes from, the same waycredentialsdoes today. Putting provider names in the bundle would tie a signed artifact to one server's auth wiring.A caller who hasn't connected the credential is asked to connect it. The plugin uses the SDK's standard path for this, the error the
@Tool({ authProviders })credential gate raises:ToolCredentialsRequiredError(JSON-RPC-32001), withdata: { tool, providers, authUrl }.authUrlis the session vault's signed/oauth/connectlink (requireConnect) when the server has that vault;vaultRefnever falls back tocredentials, to a resolver, or to another caller's credential;run_workflowraises the error when the run fails because of it. The sandbox keeps only an error's message, so the tool keeps the error it saw. A script can't fix a missing credential, so the run ends even when the script passes{ throwOnError: false }. An in-processthis.callTool()of the operation tool throws the same error;data.authUrl, the same way the SDK'sAuthorizationRequiredErrorcarries its URL. The SDK's own gate message does include the link.The SDK has no URL-mode elicitation, so
-32001withauthUrlis the auth layer's connect path today.A custom resolver is told the caller.
SkilledOpenApiCredentialResolver.resolve(ref, opts)now getsopts.authInfo: the caller's token,userclaims andsessionId. A vault adapter can use it to pick a per-tenant credential, for example by atenantclaim. Existing resolvers that read onlybundleIdkeep working unchanged. The newCredentialResolveOptionsandCallerAuthInfotypes are exported.No credential is shared between callers. The plugin keeps nothing between requests: a credential is read on each request, and the vault accessors are built for that request. The README says that a resolver that caches must key its cache by the caller, and that a
global-scope auth provider is shared by design.The static
credentialsoption is unchanged for single-tenant servers, and so ispassthroughCallerToken.User-facing change
authProviders(Record<vaultRef, providerName>);SkilledOpenApiCredentialResolver.resolve'soptsgainsauthInfo;ToolCredentialsRequiredError(-32001,data: { tool, providers, authUrl });CredentialResolveOptionsandCallerAuthInfo.authProviderssends each caller's own connected credential, and a caller without one is asked to connect it. Every resolver is told the caller.create-tool/references/auth-providers.md;frontmcp-config/references/configure-auth.md(per-session credential vault);frontmcp-development/references/openapi-adapter.md(Authentication).Tests
executor/__tests__/caller-credentials.spec.ts(13 tests):-32001error, with and without a connect URL, and without the URL in its message;vaultRefthat never reaches the resolver orcredentials;{ bundleId, authInfo };credentialswithout a custom resolver.__tests__/caller-credentials.integration.spec.ts(6 tests), on a real server with the real auth providers accessor and a user-scoped vault built per request:ToolCredentialsRequiredErrorand nothing is sent, also withthrowOnError: false;this.callTool()path;credentials;authInfo.openapi-runtime.spec.ts: two new tests (the resolver is asked with the bundle and the caller; a missing credential throws without sending). The existing tests moved fromcallerTokentoauthInfo.demo-e2e-skilled-openapi/e2e/caller-credentials.e2e.spec.ts(2 tests): a local-mode entry whoseauthenticate()connects the caller's billing token. The https mock now accepts each caller's token and records which one arrived:-32001with a/oauth/connectauthUrl, a message without it, and no request at the API. The server's own billing token stays configured through its resolver and is never sent.npx nx run-many -t build -p sdk,auth,adapters,plugin-skilled-openapi,testing;npx nx test demo-e2e-skilled-openapi: 6 suites, 54 tests passed;demo-e2e-cli-execcli-skilled-openapi.e2e.spec.ts: 11 tests passed;nx test skills: 249 tests passed;nx run plugin-skilled-openapi:typecheckandnx run demo-e2e-skilled-openapi:typecheckpassed, as did plugintsc --noEmitand lint (0 errors, plus one existing warning inhost-concurrency.ts).libs/sdkorlibs/auth, so the bundle size is unchanged.