MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / readAuth

Function readAuth

apps/api/src/config/env/validate.ts:157–186  ·  view source on GitHub ↗
(source: EnvSource)

Source from the content-addressed store, hash-verified

155});
156
157const 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
188const readUrls = (source: EnvSource) => ({
189 FRONTEND_URL: nonEmpty(

Callers 1

readRawFunction · 0.85

Calls 3

nonEmptyFunction · 0.85
toBoolWithDefaultFunction · 0.85
toBoolFunction · 0.85

Tested by

no test coverage detected