MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / removeClient

Function removeClient

packages/core/sdk/src/oauth-service.ts:666–682  ·  view source on GitHub ↗
(owner: Owner, slug: OAuthClientSlug)

Source from the content-addressed store, hash-verified

664 // op never cascades into connections).
665 // -----------------------------------------------------------------------
666 const removeClient = (owner: Owner, slug: OAuthClientSlug): Effect.Effect<void, StorageFailure> =>
667 Effect.gen(function* () {
668 yield* deps.fuma
669 .use("oauth_client.delete", (db) =>
670 looseDb(db).deleteMany("oauth_client", {
671 where: (b: any) => b.and(b("owner", "=", owner), b("slug", "=", String(slug))),
672 }),
673 )
674 .pipe(Effect.asVoid);
675 // Best-effort: drop the secret from the provider so it isn't orphaned.
676 const provider = deps.defaultWritableProvider();
677 if (provider?.delete) {
678 yield* provider
679 .delete(ProviderItemId.make(clientSecretItemId(owner, slug)))
680 .pipe(Effect.catch(() => Effect.void));
681 }
682 });
683
684 // -----------------------------------------------------------------------
685 // registerDynamicClient — RFC 7591 Dynamic Client Registration.

Callers

nothing calls this directly

Calls 3

looseDbFunction · 0.85
clientSecretItemIdFunction · 0.85
deleteMethod · 0.65

Tested by

no test coverage detected