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

Function serveTokenEndpoint

packages/core/sdk/src/oauth-ema.test.ts:413–424  ·  view source on GitHub ↗
(body: Readonly<Record<string, unknown>>)

Source from the content-addressed store, hash-verified

411// ---------------------------------------------------------------------------
412
413const serveTokenEndpoint = (body: Readonly<Record<string, unknown>>) =>
414 Effect.gen(function* () {
415 const requests = yield* Ref.make<readonly string[]>([]);
416 const server = yield* serveTestHttpApp((request) =>
417 Effect.gen(function* () {
418 const text = yield* request.text.pipe(Effect.catch(() => Effect.succeed("")));
419 yield* Ref.update(requests, (all) => [...all, text]);
420 return HttpServerResponse.jsonUnsafe(body, { status: 200 });
421 }),
422 );
423 return { tokenUrl: `${server.baseUrl}/token`, requests: Ref.get(requests) };
424 });
425
426describe("enterprise-managed authorization: token exchange response contract", () => {
427 it.effect("rejects a response whose issued_token_type is not an ID-JAG", () =>

Callers 1

oauth-ema.test.tsFile · 0.70

Calls 3

serveTestHttpAppFunction · 0.90
updateMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected