nestjs-security-cli 1.3.0 → 1.3.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/README.md +7 -2
- package/package.json +1 -5
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ npm install nestjs-security-cli
|
|
|
13
13
|
```typescript
|
|
14
14
|
import { Module } from '@nestjs/common';
|
|
15
15
|
import { MongooseModule } from '@nestjs/mongoose';
|
|
16
|
-
import { SecurityModule, BlacklistedIp, BlacklistedIpSchema } from 'nestjs-security-cli';
|
|
16
|
+
import { SecurityModule, BlacklistedIp, BlacklistedIpSchema, SecurityMiddleware } from 'nestjs-security-cli';
|
|
17
17
|
@Module({ imports: [
|
|
18
18
|
// 1. Set up MongoDB connection first MongooseModule.forRoot('mongodb://localhost:27017/myapp'),
|
|
19
19
|
// 2. Register the schema in your app
|
|
@@ -29,7 +29,12 @@ import { SecurityModule, BlacklistedIp, BlacklistedIpSchema } from 'nestjs-secur
|
|
|
29
29
|
}),
|
|
30
30
|
],
|
|
31
31
|
})
|
|
32
|
-
export class AppModule {
|
|
32
|
+
export class AppModule {
|
|
33
|
+
configure(consumer: MiddlewareConsumer) {
|
|
34
|
+
// This protects ALL requests, including non-existent routes
|
|
35
|
+
consumer.apply(SecurityMiddleware).forRoutes('*');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
33
38
|
```
|
|
34
39
|
|
|
35
40
|
## with ConfigService
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestjs-security-cli",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Advanced IP blocking, role-based security, and attack detection for NestJS applications",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,10 +26,6 @@
|
|
|
26
26
|
],
|
|
27
27
|
"author": "Shawn Nolan <shawn@shawnnolan.com>",
|
|
28
28
|
"license": "MIT",
|
|
29
|
-
"repository": {
|
|
30
|
-
"type": "git",
|
|
31
|
-
"url": "https://github.com/shawnnolanjr/nestjs-security-cli.git"
|
|
32
|
-
},
|
|
33
29
|
"peerDependencies": {
|
|
34
30
|
"@nestjs/cache-manager": "^2.0.0 || ^3.0.0",
|
|
35
31
|
"@nestjs/common": "^10.0.0 || ^11.0.0",
|