Repository navigation
read MCP credentials only in the shape they have now, and tidy what #383 and #384 left - #390
Merged
Merged
Conversation
…only in the data migration, run again for what an instance from before wrote while #384 rolled over * the old shapes, a key as {auth: 'key', key} and a sign-in's tokens bare, move from mcp-credential.ts into unify-credentials.ts: the session reads a built-in integration's credential with builtInCredentialSchema alone * the migration runs again as unify-mcp-credentials-again: an instance from before #384 could still write the old shapes while its deploy rolled over, after the first run was noted as done * Sendable in mcp-session.ts was BuiltInCredential under another name
…thMcpSignIn is withMcpCredential * connectServer in custom/route.ts asks the server for its tools and saves the connection, or begins the sign-in it asks for, for a new connection and for one moved on its page alike; what differs is its Destination * withMcpSignIn sends a token or key as well as a sign-in's access token, so it is withMcpCredential
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.
Follow-up to #383 and #384, removing what #384 kept only for the deploy to roll over, and tidying two things they left.
Old credential shapes
{auth: 'key', key}and a sign-in's tokens bare, are read only by the data migration now (unify-credentials.ts);mcp-session.tsreads withbuiltInCredentialSchemaalone, andstoredBuiltInCredentialSchemais gone.unify-mcp-credentials-again. The first run is noted as done once per database, but an instance from before store every MCP credential in one shape, {auth: 'none' | 'token' | 'oauth', …} #384 could still write the old shapes (a key connected, a sign-in finished) while store every MCP credential in one shape, {auth: 'none' | 'token' | 'oauth', …} #384's deploy rolled over; this run rewrites those, as only the migration can read them now.The migration itself stays: a self-hosted instance upgrading from before #384 still needs it (
data-migrations/run.ts). Until it has run on start, which takes a moment, such an instance's built-in connections in the old shape can't be used.Tidying
connectServerincustom/route.ts: ask the server for its tools and save the connection, or begin the sign-in it asks for. What differs, the name and sharing of a new connection or the connection a move renews, is itsDestination.withMcpSignIniswithMcpCredential: it sends a token or key as well as a sign-in's access token.Sendableinmcp-session.tswasBuiltInCredentialunder another name.Merge once #384 is deployed on every instance, so that no instance writing the old shapes is still running when this one's migration runs.