mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-30 14:42:13 +00:00
refactor(core): use keyed MCP credential reads (#45708)
This commit is contained in:
parent
74f5317489
commit
35231b408e
1 changed files with 2 additions and 4 deletions
|
|
@ -273,14 +273,12 @@ export const layer = (options?: Options) =>
|
|||
return McpOAuth.provider({ ...base, store: McpOAuth.memoryStore() })
|
||||
const credentialID = found.id
|
||||
const methodID = found.value.methodID
|
||||
const integrationID = entry.integrationID
|
||||
// Tracks the refresh token this provider last presented, so invalidate can tell whether the SDK
|
||||
// rejected the currently-stored credential or a snapshot another connection has already rotated past.
|
||||
let presented = found.value.refresh
|
||||
const readOAuthCredential = async () => {
|
||||
const stored = await Effect.runPromise(credentials.list(integrationID))
|
||||
const match = stored.find((credential) => credential.id === credentialID)
|
||||
return match && match.value.type === "oauth" ? match.value : undefined
|
||||
const stored = await Effect.runPromise(credentials.get(credentialID))
|
||||
return stored?.value.type === "oauth" ? stored.value : undefined
|
||||
}
|
||||
return McpOAuth.provider({
|
||||
...base,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue