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

Function removeClient

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

Source from the content-addressed store, hash-verified

681 // op never cascades into connections).
682 // -----------------------------------------------------------------------
683 const removeClient = (owner: Owner, slug: OAuthClientSlug): Effect.Effect<void, StorageFailure> =>
684 Effect.gen(function* () {
685 yield* deps.fuma
686 .use("oauth_client.delete", (db) =>
687 looseDb(db).deleteMany("oauth_client", {
688 where: (b: any) => b.and(b("owner", "=", owner), b("slug", "=", String(slug))),
689 }),
690 )
691 .pipe(Effect.asVoid);
692 // Best-effort: drop the secret from the provider so it isn't orphaned.
693 const provider = deps.defaultWritableProvider();
694 if (provider?.delete) {
695 yield* provider
696 .delete(ProviderItemId.make(clientSecretItemId(owner, slug)))
697 .pipe(Effect.catch(() => Effect.void));
698 }
699 });
700
701 // -----------------------------------------------------------------------
702 // 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