(source: EnvSource)
| 155 | }); |
| 156 | |
| 157 | const readAuth = (source: EnvSource) => ({ |
| 158 | JWT_SECRET: nonEmpty( |
| 159 | source.JWT_SECRET, |
| 160 | source.NODE_ENV === "test" |
| 161 | ? "test-only-jwt-secret-padded-to-thirty-two-chars" |
| 162 | : "" |
| 163 | ), |
| 164 | JWT_REVOCATION_FAIL_CLOSED: toBoolWithDefault( |
| 165 | source.JWT_REVOCATION_FAIL_CLOSED, |
| 166 | false, |
| 167 | "JWT_REVOCATION_FAIL_CLOSED" |
| 168 | ), |
| 169 | /* |
| 170 | * Deterministic test-only key so MFA round-trip tests don't need an |
| 171 | * env file. 32 bytes base64 = 44 chars. Production deploys must set |
| 172 | * this to a freshly generated value before any user enables MFA. |
| 173 | */ |
| 174 | MFA_ENCRYPTION_KEY: nonEmpty( |
| 175 | source.MFA_ENCRYPTION_KEY, |
| 176 | source.NODE_ENV === "test" |
| 177 | ? "MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY=" |
| 178 | : "" |
| 179 | ), |
| 180 | SUPERUSER_EMAIL: source.SUPERUSER_EMAIL ?? "", |
| 181 | SUPERUSER_PASSWORD: source.SUPERUSER_PASSWORD ?? "", |
| 182 | E2E_TEST_ENDPOINTS_ENABLED: toBool( |
| 183 | source.E2E_TEST_ENDPOINTS_ENABLED, |
| 184 | "E2E_TEST_ENDPOINTS_ENABLED" |
| 185 | ), |
| 186 | }); |
| 187 | |
| 188 | const readUrls = (source: EnvSource) => ({ |
| 189 | FRONTEND_URL: nonEmpty( |
no test coverage detected