1import * as Effect from "effect/Effect";
2import { MinimumLogLevel } from "effect/References";
3
4export const logLevel = Effect.provideService(
5 MinimumLogLevel,
6 process.env.DEBUG ? "Debug" : "Info",
7);
8
9export const customer =
10 process.env.GCP_CLOUDIDENTITY_CUSTOMER?.trim() || "customers/my_customer";
11
12export const domain = process.env.GCP_CLOUDIDENTITY_DOMAIN?.trim() || undefined;
13
14export const memberEmail =
15 process.env.GCP_CLOUDIDENTITY_MEMBER?.trim() || undefined;
16
17// Cloud Identity needs a Workspace/Cloud Identity customer: the testing
18// project's creates fail with ServiceDisabled "Cloud Identity API has not been used
19// in project ... before or it is disabled" (Device: "Request had insufficient
20// authentication scopes."). Set GCP_TEST_CLOUDIDENTITY=1 plus the
21// GCP_CLOUDIDENTITY_* fixtures on an entitled customer.
22export const runLifecycle =
23 !process.env.FAST && !!process.env.GCP_TEST_CLOUDIDENTITY;
24
25export const runGroupLifecycle = runLifecycle && !!domain;
26
27export const runMembershipLifecycle = runGroupLifecycle && !!memberEmail;