@fonderie/auth 7.13.0 → 7.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/brain/signatures.md +1 -1
- package/dist/index.cjs +32 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -11
- package/dist/index.js.map +1 -1
- package/env.json +154 -0
- package/package.json +7 -5
package/brain/signatures.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## @fonderie/auth
|
|
6
6
|
|
|
7
|
-
Subpath exports: `@fonderie/auth/types`, `@fonderie/auth/middleware`, `@fonderie/auth/migrations`
|
|
7
|
+
Subpath exports: `@fonderie/auth/types`, `@fonderie/auth/middleware`, `@fonderie/auth/migrations`, `@fonderie/auth/env.json`
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
10
|
interface IUser {
|
package/dist/index.cjs
CHANGED
|
@@ -3257,20 +3257,27 @@ function collectAuthConfigProblems(config) {
|
|
|
3257
3257
|
problems.push({
|
|
3258
3258
|
module: MODULE,
|
|
3259
3259
|
severity: "error",
|
|
3260
|
-
message: `jwtSecret must be at least ${import_core11.MIN_SECRET_LENGTH} characters (got ${secret.length})
|
|
3260
|
+
message: `jwtSecret must be at least ${import_core11.MIN_SECRET_LENGTH} characters (got ${secret.length})`,
|
|
3261
|
+
domain: "auth",
|
|
3262
|
+
reason: "JWT_SECRET_TOO_SHORT",
|
|
3263
|
+
metadata: { min: import_core11.MIN_SECRET_LENGTH, got: secret.length }
|
|
3261
3264
|
});
|
|
3262
3265
|
} else if (secretProblem === "placeholder") {
|
|
3263
3266
|
problems.push({
|
|
3264
3267
|
module: MODULE,
|
|
3265
3268
|
severity: "error",
|
|
3266
|
-
message: "jwtSecret looks like a placeholder or dev-default value"
|
|
3269
|
+
message: "jwtSecret looks like a placeholder or dev-default value",
|
|
3270
|
+
domain: "auth",
|
|
3271
|
+
reason: "JWT_SECRET_PLACEHOLDER"
|
|
3267
3272
|
});
|
|
3268
3273
|
}
|
|
3269
3274
|
if (config.secureCookies === false) {
|
|
3270
3275
|
problems.push({
|
|
3271
3276
|
module: MODULE,
|
|
3272
3277
|
severity: process.env["NODE_ENV"] === "production" ? "error" : "warning",
|
|
3273
|
-
message: "secureCookies is false \u2014 auth cookies may be sent over non-HTTPS connections in production"
|
|
3278
|
+
message: "secureCookies is false \u2014 auth cookies may be sent over non-HTTPS connections in production",
|
|
3279
|
+
domain: "auth",
|
|
3280
|
+
reason: "INSECURE_COOKIES"
|
|
3274
3281
|
});
|
|
3275
3282
|
}
|
|
3276
3283
|
if (config.google) {
|
|
@@ -3279,13 +3286,17 @@ function collectAuthConfigProblems(config) {
|
|
|
3279
3286
|
problems.push({
|
|
3280
3287
|
module: MODULE,
|
|
3281
3288
|
severity: "error",
|
|
3282
|
-
message: "google OAuth is configured but clientId, clientSecret, or redirectUri is missing"
|
|
3289
|
+
message: "google OAuth is configured but clientId, clientSecret, or redirectUri is missing",
|
|
3290
|
+
domain: "auth",
|
|
3291
|
+
reason: "GOOGLE_INCOMPLETE"
|
|
3283
3292
|
});
|
|
3284
3293
|
} else if (import_core11.PLACEHOLDER_SECRET.test(clientSecret)) {
|
|
3285
3294
|
problems.push({
|
|
3286
3295
|
module: MODULE,
|
|
3287
3296
|
severity: "error",
|
|
3288
|
-
message: "google.clientSecret looks like a placeholder or dev-default value"
|
|
3297
|
+
message: "google.clientSecret looks like a placeholder or dev-default value",
|
|
3298
|
+
domain: "auth",
|
|
3299
|
+
reason: "GOOGLE_SECRET_PLACEHOLDER"
|
|
3289
3300
|
});
|
|
3290
3301
|
}
|
|
3291
3302
|
}
|
|
@@ -3295,20 +3306,26 @@ function collectAuthConfigProblems(config) {
|
|
|
3295
3306
|
problems.push({
|
|
3296
3307
|
module: MODULE,
|
|
3297
3308
|
severity: "error",
|
|
3298
|
-
message: "apple OAuth is configured but clientId, teamId, keyId, privateKey, or redirectUri is missing"
|
|
3309
|
+
message: "apple OAuth is configured but clientId, teamId, keyId, privateKey, or redirectUri is missing",
|
|
3310
|
+
domain: "auth",
|
|
3311
|
+
reason: "APPLE_INCOMPLETE"
|
|
3299
3312
|
});
|
|
3300
3313
|
} else if (!/-----BEGIN [A-Z ]*PRIVATE KEY-----/.test(a.privateKey)) {
|
|
3301
3314
|
problems.push({
|
|
3302
3315
|
module: MODULE,
|
|
3303
3316
|
severity: "error",
|
|
3304
|
-
message: "apple.privateKey does not look like a PEM .p8 key (expected `-----BEGIN PRIVATE KEY-----`)"
|
|
3317
|
+
message: "apple.privateKey does not look like a PEM .p8 key (expected `-----BEGIN PRIVATE KEY-----`)",
|
|
3318
|
+
domain: "auth",
|
|
3319
|
+
reason: "APPLE_KEY_NOT_PEM"
|
|
3305
3320
|
});
|
|
3306
3321
|
}
|
|
3307
3322
|
if (a.nativeClientIds?.some((id) => !id || id.trim() === "" || id.includes("*"))) {
|
|
3308
3323
|
problems.push({
|
|
3309
3324
|
module: MODULE,
|
|
3310
3325
|
severity: "error",
|
|
3311
|
-
message: "apple.nativeClientIds must be exact bundle ids \u2014 empty or wildcard entries would accept identity tokens minted for other apps"
|
|
3326
|
+
message: "apple.nativeClientIds must be exact bundle ids \u2014 empty or wildcard entries would accept identity tokens minted for other apps",
|
|
3327
|
+
domain: "auth",
|
|
3328
|
+
reason: "APPLE_NATIVE_IDS_INVALID"
|
|
3312
3329
|
});
|
|
3313
3330
|
}
|
|
3314
3331
|
}
|
|
@@ -3316,14 +3333,18 @@ function collectAuthConfigProblems(config) {
|
|
|
3316
3333
|
problems.push({
|
|
3317
3334
|
module: MODULE,
|
|
3318
3335
|
severity: process.env["NODE_ENV"] === "production" ? "error" : "warning",
|
|
3319
|
-
message: "mfa is enabled without mfaSecretKey \u2014 TOTP secrets are stored plaintext at rest; set a 32-byte key (openssl rand -hex 32)"
|
|
3336
|
+
message: "mfa is enabled without mfaSecretKey \u2014 TOTP secrets are stored plaintext at rest; set a 32-byte key (openssl rand -hex 32)",
|
|
3337
|
+
domain: "auth",
|
|
3338
|
+
reason: "MFA_KEY_MISSING"
|
|
3320
3339
|
});
|
|
3321
3340
|
}
|
|
3322
3341
|
if (config.mfaSecretKey && !/^[0-9a-fA-F]{64}$/.test(config.mfaSecretKey)) {
|
|
3323
3342
|
problems.push({
|
|
3324
3343
|
module: MODULE,
|
|
3325
3344
|
severity: "error",
|
|
3326
|
-
message: "mfaSecretKey must be 64 hex characters (32 bytes, e.g. `openssl rand -hex 32`)"
|
|
3345
|
+
message: "mfaSecretKey must be 64 hex characters (32 bytes, e.g. `openssl rand -hex 32`)",
|
|
3346
|
+
domain: "auth",
|
|
3347
|
+
reason: "MFA_KEY_INVALID"
|
|
3327
3348
|
});
|
|
3328
3349
|
}
|
|
3329
3350
|
return problems;
|
|
@@ -3535,7 +3556,7 @@ var AuthModule = class {
|
|
|
3535
3556
|
name = "@fonderie/auth";
|
|
3536
3557
|
// Baked in at build time by tsup.base, so the operator's Modules page can
|
|
3537
3558
|
// say what is actually deployed rather than 'not reported'.
|
|
3538
|
-
version = "7.
|
|
3559
|
+
version = "7.14.1";
|
|
3539
3560
|
// Users, sessions, login history, suspend — only through @fonderie/admin.
|
|
3540
3561
|
describeAdmin() {
|
|
3541
3562
|
return { routes: describeAuthAdminRoutes(this.store) };
|