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

Function removeClient

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

Source from the content-addressed store, hash-verified

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