| 1 | import * as Effect from "effect/Effect"; |
| 2 | import { MinimumLogLevel } from "effect/References"; |
| 3 | |
| 4 | export const logLevel = Effect.provideService( |
| 5 | MinimumLogLevel, |
| 6 | process.env.DEBUG ? "Debug" : "Info", |
| 7 | ); |
| 8 | |
| 9 | export const customer = |
| 10 | process.env.GCP_CLOUDIDENTITY_CUSTOMER?.trim() || "customers/my_customer"; |
| 11 | |
| 12 | export const domain = process.env.GCP_CLOUDIDENTITY_DOMAIN?.trim() || undefined; |
| 13 | |
| 14 | export 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. |
| 22 | export const runLifecycle = |
| 23 | !process.env.FAST && !!process.env.GCP_TEST_CLOUDIDENTITY; |
| 24 | |
| 25 | export const runGroupLifecycle = runLifecycle && !!domain; |
| 26 | |
| 27 | export const runMembershipLifecycle = runGroupLifecycle && !!memberEmail; |