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

Function removeClient

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

Source from the content-addressed store, hash-verified

607 // op never cascades into connections).
608 // -----------------------------------------------------------------------
609 const removeClient = (owner: Owner, slug: OAuthClientSlug): Effect.Effect<void, StorageFailure> =>
610 Effect.gen(function* () {
611 yield* deps.fuma
612 .use("oauth_client.delete", (db) =>
613 looseDb(db).deleteMany("oauth_client", {
614 where: (b: any) => b.and(b("owner", "=", owner), b("slug", "=", String(slug))),
615 }),
616 )
617 .pipe(Effect.asVoid);
618 // Best-effort: drop the secret from the provider so it isn't orphaned.
619 const provider = deps.defaultWritableProvider();
620 if (provider?.delete) {
621 yield* provider
622 .delete(ProviderItemId.make(clientSecretItemId(owner, slug)))
623 .pipe(Effect.catch(() => Effect.void));
624 }
625 });
626
627 // -----------------------------------------------------------------------
628 // 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