nest-encrypt-cycle 1.1.0 → 1.1.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 +0 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,12 +29,6 @@ import { APP_INTERCEPTOR } from '@nestjs/core';
|
|
|
29
29
|
|
|
30
30
|
@Module({
|
|
31
31
|
imports: [EncryptModule.register({ key: 'your-secret-key', whiteList: [] })],
|
|
32
|
-
providers: [
|
|
33
|
-
{
|
|
34
|
-
provide: APP_INTERCEPTOR,
|
|
35
|
-
useClass: EncryptInterceptor,
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
32
|
})
|
|
39
33
|
export class AppModule {}
|
|
40
34
|
```
|
|
@@ -52,24 +46,6 @@ export interface EncryptOptions {
|
|
|
52
46
|
}
|
|
53
47
|
```
|
|
54
48
|
|
|
55
|
-
2. Use the interceptor globally or on specific routes
|
|
56
|
-
|
|
57
|
-
Globally
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
import { NestFactory } from '@nestjs/core';
|
|
61
|
-
import { AppModule } from './app.module';
|
|
62
|
-
import { EncryptInterceptor } from 'nest-encrypt-cycle';
|
|
63
|
-
|
|
64
|
-
async function bootstrap() {
|
|
65
|
-
const app = await NestFactory.create(AppModule);
|
|
66
|
-
const encryptService = app.get(EncryptService);
|
|
67
|
-
app.useGlobalInterceptors(new EncryptInterceptor(encryptService));
|
|
68
|
-
await app.listen(3000);
|
|
69
|
-
}
|
|
70
|
-
bootstrap();
|
|
71
|
-
```
|
|
72
|
-
|
|
73
49
|
## Configuration
|
|
74
50
|
|
|
75
51
|
secretKey (string): Your AES encryption key. Must be 16, 24, or 32 bytes long.
|