@volcanicminds/backend 2.2.12 → 2.2.13
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/README.md +21 -45
- package/dist/lib/api/auth/routes.js +1 -1
- package/dist/lib/api/auth/routes.js.map +1 -1
- package/dist/lib/middleware/postForgotPassword.d.ts +3 -0
- package/dist/lib/middleware/postForgotPassword.d.ts.map +1 -0
- package/dist/lib/middleware/postForgotPassword.js +4 -0
- package/dist/lib/middleware/postForgotPassword.js.map +1 -0
- package/dist/lib/middleware/{preForgotPasswordHandler.d.ts → preForgotPassword.d.ts} +1 -1
- package/dist/lib/middleware/preForgotPassword.d.ts.map +1 -0
- package/dist/lib/middleware/preForgotPassword.js +2 -0
- package/dist/lib/middleware/preForgotPassword.js.map +1 -0
- package/lib/api/auth/routes.ts +1 -1
- package/lib/middleware/postForgotPassword.ts +5 -0
- package/package.json +1 -1
- package/dist/lib/middleware/dispatchForgotPasswordLink.d.ts +0 -3
- package/dist/lib/middleware/dispatchForgotPasswordLink.d.ts.map +0 -1
- package/dist/lib/middleware/dispatchForgotPasswordLink.js +0 -4
- package/dist/lib/middleware/dispatchForgotPasswordLink.js.map +0 -1
- package/dist/lib/middleware/preForgotPasswordHandler.d.ts.map +0 -1
- package/dist/lib/middleware/preForgotPasswordHandler.js +0 -2
- package/dist/lib/middleware/preForgotPasswordHandler.js.map +0 -1
- package/lib/middleware/dispatchForgotPasswordLink.ts +0 -5
- /package/lib/middleware/{preForgotPasswordHandler.ts → preForgotPassword.ts} +0 -0
package/README.md
CHANGED
|
@@ -14,6 +14,16 @@ A Node.js framework based on Fastify to build robust APIs quickly, featuring an
|
|
|
14
14
|
- Increase minimum Node.js version to 24.x.
|
|
15
15
|
- Switched to pure ECMAScript Modules (`NodeNext`). CommonJS/`require` is no longer supported.
|
|
16
16
|
|
|
17
|
+
## Documentation & Guides
|
|
18
|
+
|
|
19
|
+
For advanced usage and enterprise architecture patterns, please refer to the detailed documentation:
|
|
20
|
+
|
|
21
|
+
- **[Advanced Architecture](docs/ADVANCED_ARCHITECTURE.md)**: Service Layer pattern, BaseService abstraction, and dependency injection.
|
|
22
|
+
- **[Data Layer Magic](docs/DATA_LAYER_MAGIC.md)**: How `req.data()` works and how to turn URLs into complex SQL queries with `@volcanicminds/typeorm`.
|
|
23
|
+
- **[Schema Customization](docs/SCHEMA_OVERRIDING.md)**: How to extend core schemas (like Login Response) without forking the framework.
|
|
24
|
+
- **[Security & MFA](docs/SECURITY_MFA.md)**: Deep dive into Multi-Factor Authentication policies, Gatekeeper flow, and emergency resets.
|
|
25
|
+
- **[TypeScript Guide](docs/TYPESCRIPT_GUIDE.md)**: How to properly extend Request types, global scopes, and inject User Contexts.
|
|
26
|
+
|
|
17
27
|
## Based on
|
|
18
28
|
|
|
19
29
|
**Volcanic Backend** is a powerful, opinionated, and extensible Node.js framework for creating robust and scalable RESTful and GraphQL APIs. It's built on modern, high-performance libraries like [Fastify](https://www.fastify.io) and can be optionally paired with [Apollo Server](https://www.apollographql.com).
|
|
@@ -41,8 +51,6 @@ And, what you see in [package.json](package.json).
|
|
|
41
51
|
npm install @volcanicminds/backend
|
|
42
52
|
```
|
|
43
53
|
|
|
44
|
-
````
|
|
45
|
-
|
|
46
54
|
For database interactions, it is highly recommended to also install the companion package:
|
|
47
55
|
|
|
48
56
|
```sh
|
|
@@ -59,7 +67,7 @@ This example demonstrates how to set up a basic server with a single endpoint.
|
|
|
59
67
|
// index.ts
|
|
60
68
|
import { start } from '@volcanicminds/backend'
|
|
61
69
|
import { start as startDatabase, userManager } from '@volcanicminds/typeorm'
|
|
62
|
-
import { myDbConfig } from './src/config/database' // Assume you have a db config file
|
|
70
|
+
import { myDbConfig } from './src/config/database.js' // Assume you have a db config file
|
|
63
71
|
|
|
64
72
|
async function main() {
|
|
65
73
|
// 1. Initialize the database connection (optional but recommended)
|
|
@@ -130,9 +138,11 @@ A typical project using `volcanic-backend` follows a convention-based structure
|
|
|
130
138
|
│ │ └── routes.ts # Route definitions for products
|
|
131
139
|
│ │
|
|
132
140
|
│ ├── config/
|
|
141
|
+
│ │ ├── general.ts # General configuration settings
|
|
133
142
|
│ │ ├── database.ts # Database connection settings
|
|
134
143
|
│ │ ├── plugins.ts # Configuration for Fastify plugins (CORS, Helmet, etc.)
|
|
135
|
-
│ │
|
|
144
|
+
│ │ ├── roles.ts # Custom role definitions
|
|
145
|
+
│ │ └── tracking.ts # Auto tracking changes configuration (sperimental)
|
|
136
146
|
│ │
|
|
137
147
|
│ ├── entities/
|
|
138
148
|
│ │ └── product.e.ts # TypeORM entity definitions
|
|
@@ -143,6 +153,9 @@ A typical project using `volcanic-backend` follows a convention-based structure
|
|
|
143
153
|
│ ├── middleware/
|
|
144
154
|
│ │ └── myMiddleware.ts # Custom middleware functions
|
|
145
155
|
│ │
|
|
156
|
+
│ ├── schedules/
|
|
157
|
+
│ │ └── example.job.ts # Custom Job schedules (cron, interval)
|
|
158
|
+
│ │
|
|
146
159
|
│ └── schemas/
|
|
147
160
|
│ └── product.ts # JSON schemas for validation and Swagger
|
|
148
161
|
│
|
|
@@ -695,23 +708,11 @@ export default {
|
|
|
695
708
|
|
|
696
709
|
## Multi-Factor Authentication (MFA)
|
|
697
710
|
|
|
698
|
-
The framework provides a robust, built-in Multi-Factor Authentication system based on TOTP (Time-Based One-Time Password).
|
|
711
|
+
The framework provides a robust, built-in Multi-Factor Authentication system based on TOTP (Time-Based One-Time Password).
|
|
699
712
|
|
|
700
|
-
|
|
713
|
+
For detailed configuration, security policies, and setup flows, please refer to the **[Security & MFA Guide](docs/SECURITY_MFA.md)**.
|
|
701
714
|
|
|
702
|
-
MFA behavior is controlled via
|
|
703
|
-
|
|
704
|
-
```ts
|
|
705
|
-
// src/config/general.ts
|
|
706
|
-
export default {
|
|
707
|
-
name: 'general',
|
|
708
|
-
enable: true,
|
|
709
|
-
options: {
|
|
710
|
-
// ...
|
|
711
|
-
mfa_policy: process.env.MFA_POLICY || 'OPTIONAL' // 'OPTIONAL' | 'MANDATORY' | 'ONE_WAY'
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
```
|
|
715
|
+
MFA behavior is controlled globally via environment variables (`MFA_POLICY`) or the configuration file `src/config/general.ts`.
|
|
715
716
|
|
|
716
717
|
### MFA Policies
|
|
717
718
|
|
|
@@ -721,31 +722,7 @@ export default {
|
|
|
721
722
|
- Users cannot disable MFA.
|
|
722
723
|
- **ONE_WAY**: MFA is optional to start with, but once enabled, the user cannot disable it themselves. Only an admin can reset it.
|
|
723
724
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
When MFA is required (either because it's enabled for the user or the policy is MANDATORY), the login endpoint does **not** return a standard access token.
|
|
727
|
-
|
|
728
|
-
1. **Temporary Token**: Returns a JWT with a specific role: `pre-auth-mfa`.
|
|
729
|
-
2. **Gatekeeper**: Middleware automatically blocks any request made with a `pre-auth-mfa` token, **except** for specific whitelisted routes:
|
|
730
|
-
- `/auth/mfa/setup`
|
|
731
|
-
- `/auth/mfa/enable`
|
|
732
|
-
- `/auth/mfa/verify`
|
|
733
|
-
- `/auth/logout`
|
|
734
|
-
3. **Verification**: Only after successfully calling `/auth/mfa/verify` (or `enable` during setup) does the server issue the final, fully privileged Access Token.
|
|
735
|
-
|
|
736
|
-
### Emergency Admin Reset
|
|
737
|
-
|
|
738
|
-
If an administrator loses their MFA device and cannot log in, a filesystem/env-based emergency reset mechanism is available. This configuration is **only** available via Environment Variables to ensure security and easy rotation in production environments.
|
|
739
|
-
|
|
740
|
-
1. Set the environment variables in your server configuration (e.g., `.env` or Docker config):
|
|
741
|
-
```bash
|
|
742
|
-
MFA_ADMIN_FORCED_RESET_EMAIL=admin@company.com
|
|
743
|
-
MFA_ADMIN_FORCED_RESET_UNTIL=2025-12-31T18:30:00.000Z # A timestamp slightly in the future
|
|
744
|
-
```
|
|
745
|
-
2. Restart the server.
|
|
746
|
-
|
|
747
|
-
On startup, the server will check these variables. If the email matches an existing user and the current time is before the `UNTIL` timestamp, it will forcibly disable MFA for that specific user, allowing a standard login.
|
|
748
|
-
**Important:** Remove these variables after the reset is complete to avoid security risks.
|
|
725
|
+
**_Note_**: In all cases, an administrator **can** force an MFA reset for a user.
|
|
749
726
|
|
|
750
727
|
## Disable embedded authorization
|
|
751
728
|
|
|
@@ -1010,4 +987,3 @@ A simple note: in the example below, you can see rawBody enabled on the `/exampl
|
|
|
1010
987
|
}
|
|
1011
988
|
}
|
|
1012
989
|
```
|
|
1013
|
-
````
|
|
@@ -74,7 +74,7 @@ export default {
|
|
|
74
74
|
path: '/forgot-password',
|
|
75
75
|
roles: [],
|
|
76
76
|
handler: 'auth.forgotPassword',
|
|
77
|
-
middlewares: ['global.
|
|
77
|
+
middlewares: ['global.preForgotPassword', 'global.postForgotPassword'],
|
|
78
78
|
config: {
|
|
79
79
|
title: 'Forgot password',
|
|
80
80
|
description: 'Forgot password for an existing user given the email or username',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../../lib/api/auth/routes.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,MAAM,EAAE;QACN,KAAK,EAAE,0BAA0B;QACjC,WAAW,EAAE,0BAA0B;QACvC,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,IAAI;KACb;IACD,MAAM,EAAE;QACN;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,EAAE;YACT,OAAO,EAAE,eAAe;YACxB,WAAW,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;YAClD,MAAM,EAAE;gBACN,KAAK,EAAE,mBAAmB;gBAC1B,WAAW,EAAE,qBAAqB;gBAClC,IAAI,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE;gBACzC,QAAQ,EAAE;oBACR,GAAG,EAAE,EAAE,IAAI,EAAE,6BAA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E,MAAM;YACd,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,EAAE;YACT,OAAO,EAAE,gBAAgB;YACzB,WAAW,EAAE,CAAC,wBAAwB,CAAC;YACvC,MAAM,EAAE;gBACN,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,0FAA0F;gBACvG,IAAI,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE;gBAC1C,QAAQ,EAAE;oBACR,GAAG,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE;iBAC1C;aACF;SACF;QACD;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,EAAE;YACT,OAAO,EAAE,gBAAgB;YACzB,WAAW,EAAE,EAAE;YACf,MAAM,EAAE;gBACN,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,mDAAmD;gBAChE,IAAI,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE;gBAC1C,QAAQ,EAAE;oBACR,GAAG,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE;oBACzC,GAAG,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE;iBACzC;aACF;SACF;QACD;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,EAAE;YACT,OAAO,EAAE,iBAAiB;YAC1B,WAAW,EAAE,CAAC,wBAAwB,CAAC;YACvC,MAAM,EAAE;gBACN,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,kCAAkC;gBAC/C,QAAQ,EAAE;oBACR,GAAG,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE;iBAClC;aACF;SACF;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postForgotPassword.d.ts","sourceRoot":"","sources":["../../../lib/middleware/postForgotPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEtD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,KAAA,gBAEvF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postForgotPassword.js","sourceRoot":"","sources":["../../../lib/middleware/postForgotPassword.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAoB,EAAE,IAAkB,EAAE,OAAO;IACtF,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preForgotPassword.d.ts","sourceRoot":"","sources":["../../../lib/middleware/preForgotPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEtD,wBAAsB,UAAU,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,iBAAI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preForgotPassword.js","sourceRoot":"","sources":["../../../lib/middleware/preForgotPassword.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAoB,EAAE,IAAkB,IAAG,CAAC"}
|
package/lib/api/auth/routes.ts
CHANGED
|
@@ -74,7 +74,7 @@ export default {
|
|
|
74
74
|
path: '/forgot-password',
|
|
75
75
|
roles: [],
|
|
76
76
|
handler: 'auth.forgotPassword',
|
|
77
|
-
middlewares: ['global.
|
|
77
|
+
middlewares: ['global.preForgotPassword', 'global.postForgotPassword'],
|
|
78
78
|
config: {
|
|
79
79
|
title: 'Forgot password',
|
|
80
80
|
description: 'Forgot password for an existing user given the email or username',
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dispatchForgotPasswordLink.d.ts","sourceRoot":"","sources":["../../../lib/middleware/dispatchForgotPasswordLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEtD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,KAAA,gBAErF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dispatchForgotPasswordLink.js","sourceRoot":"","sources":["../../../lib/middleware/dispatchForgotPasswordLink.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAmB,EAAE,GAAiB,EAAE,OAAO;IACpF,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preForgotPasswordHandler.d.ts","sourceRoot":"","sources":["../../../lib/middleware/preForgotPasswordHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEtD,wBAAsB,UAAU,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,iBAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preForgotPasswordHandler.js","sourceRoot":"","sources":["../../../lib/middleware/preForgotPasswordHandler.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAoB,EAAE,IAAkB,IAAG,CAAC"}
|
|
File without changes
|