t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/GCP/FirebaseAppCheck/fixtures/bindings-host.ts
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00

30 lines
1,005 B
TypeScript

import * as GCP from "@/GCP";
import * as Effect from "effect/Effect";
import { serveProbes } from "../../bindingHost.ts";
import { lifecycleAppId } from "../common.ts";
/** Debug token registered on the `GCP_TEST_FIREBASE_APP_ID` app. */
export const Local = GCP.FirebaseAppCheck.AppsDebugToken("Local", {
app: lifecycleAppId ?? "",
displayName: "alchemy-exchange",
});
/**
* Effect-native Cloud Run service exercising every App Check binding as its
* own runtime service account. Deployed from {@link ../Bindings.test.ts}.
*/
export default class AppCheckBindingsHost extends GCP.Function<AppCheckBindingsHost>()(
"AppCheckBindingsHost",
{ main: import.meta.url, invokerIamDisabled: true },
Effect.gen(function* () {
const exchange = yield* GCP.FirebaseAppCheck.ExchangeDebugToken(
yield* Local,
);
return {
fetch: serveProbes({
exchangeDebugToken: exchange(),
}),
};
}).pipe(Effect.provide(GCP.FirebaseAppCheck.ExchangeDebugTokenHttp)),
) {}