@dismissible/nestjs-jwt-auth-hook 1.0.2 → 1.0.3-alpha.064e57a.0
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 +20 -5
- package/package.json +17 -16
- package/src/jwt-auth-hook.module.d.ts +1 -1
- package/src/jwt-auth-hook.module.js +1 -1
- package/src/jwt-auth.hook.d.ts +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://dismissible.io" target="_blank"><img src="../../docs/images/dismissible_logo.png" width="120" alt="Dismissible" /></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">Never Show The Same Thing Twice!</p>
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://www.npmjs.com/package/@dismissible/nestjs-jwt-auth-hook" target="_blank"><img src="https://img.shields.io/npm/v/@dismissible/nestjs-jwt-auth-hook.svg" alt="NPM Version" /></a>
|
|
8
|
+
<a href="https://github.com/dismissibleio/dismissible-api/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/npm/l/@dismissible/nestjs-jwt-auth-hook.svg" alt="Package License" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/@dismissible/nestjs-jwt-auth-hook" target="_blank"><img src="https://img.shields.io/npm/dm/@dismissible/nestjs-jwt-auth-hook.svg" alt="NPM Downloads" /></a>
|
|
10
|
+
<a href="https://github.com/dismissibleio/dismissible-api" target="_blank"><img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/dismissibleio/dismissible-api/release.yml"></a>
|
|
11
|
+
<a href="https://paypal.me/joshstuartx" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
Dismissible manages the state of your UI elements across sessions, so your users see what matters, once! No more onboarding messages reappearing on every tab, no more notifications haunting users across devices. Dismissible syncs dismissal state everywhere, so every message is intentional, never repetitive.
|
|
15
|
+
|
|
1
16
|
# @dismissible/nestjs-jwt-auth-hook
|
|
2
17
|
|
|
3
18
|
JWT authentication hook for Dismissible applications using OpenID Connect (OIDC) well-known discovery.
|
|
4
19
|
|
|
5
20
|
## Overview
|
|
6
21
|
|
|
7
|
-
This library provides a lifecycle hook that integrates with the `@dismissible/nestjs-
|
|
22
|
+
This library provides a lifecycle hook that integrates with the `@dismissible/nestjs-core` module to authenticate requests using JWT bearer tokens. It validates tokens using JWKS (JSON Web Key Set) fetched from an OIDC well-known endpoint.
|
|
8
23
|
|
|
9
24
|
## Installation
|
|
10
25
|
|
|
@@ -18,7 +33,7 @@ npm install @dismissible/nestjs-jwt-auth-hook @nestjs/axios axios
|
|
|
18
33
|
|
|
19
34
|
```typescript
|
|
20
35
|
import { Module } from '@nestjs/common';
|
|
21
|
-
import { DismissibleModule } from '@dismissible/nestjs-
|
|
36
|
+
import { DismissibleModule } from '@dismissible/nestjs-core';
|
|
22
37
|
import { JwtAuthHookModule, JwtAuthHook } from '@dismissible/nestjs-jwt-auth-hook';
|
|
23
38
|
|
|
24
39
|
@Module({
|
|
@@ -47,7 +62,7 @@ When configuration values come from environment variables or other async sources
|
|
|
47
62
|
```typescript
|
|
48
63
|
import { Module } from '@nestjs/common';
|
|
49
64
|
import { ConfigService } from '@nestjs/config';
|
|
50
|
-
import { DismissibleModule } from '@dismissible/nestjs-
|
|
65
|
+
import { DismissibleModule } from '@dismissible/nestjs-core';
|
|
51
66
|
import { JwtAuthHookModule, JwtAuthHook } from '@dismissible/nestjs-jwt-auth-hook';
|
|
52
67
|
|
|
53
68
|
@Module({
|
|
@@ -104,7 +119,7 @@ When using the Dismissible API Docker image or the standalone API, these environ
|
|
|
104
119
|
```bash
|
|
105
120
|
docker run -p 3001:3001 \
|
|
106
121
|
-e DISMISSIBLE_JWT_AUTH_ENABLED=false \
|
|
107
|
-
-e
|
|
122
|
+
-e DISMISSIBLE_STORAGE_POSTGRES_CONNECTION_STRING="postgresql://..." \
|
|
108
123
|
dismissibleio/dismissible-api:latest
|
|
109
124
|
```
|
|
110
125
|
|
|
@@ -116,7 +131,7 @@ docker run -p 3001:3001 \
|
|
|
116
131
|
-e DISMISSIBLE_JWT_AUTH_WELL_KNOWN_URL="https://your-tenant.auth0.com/.well-known/openid-configuration" \
|
|
117
132
|
-e DISMISSIBLE_JWT_AUTH_ISSUER="https://your-tenant.auth0.com/" \
|
|
118
133
|
-e DISMISSIBLE_JWT_AUTH_AUDIENCE="your-api-identifier" \
|
|
119
|
-
-e
|
|
134
|
+
-e DISMISSIBLE_STORAGE_POSTGRES_CONNECTION_STRING="postgresql://..." \
|
|
120
135
|
dismissibleio/dismissible-api:latest
|
|
121
136
|
```
|
|
122
137
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dismissible/nestjs-jwt-auth-hook",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3-alpha.064e57a.0",
|
|
4
4
|
"description": "JWT authentication hook for Dismissible applications using OIDC well-known discovery",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -13,26 +13,27 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"src",
|
|
16
|
-
"README.md"
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE.md"
|
|
17
18
|
],
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@nestjs/axios": "
|
|
20
|
-
"@dismissible/nestjs-
|
|
21
|
-
"@dismissible/nestjs-
|
|
22
|
-
"@dismissible/nestjs-logger": "
|
|
23
|
-
"@dismissible/nestjs-validation": "
|
|
24
|
-
"jwks-rsa": "
|
|
25
|
-
"jsonwebtoken": "
|
|
20
|
+
"@nestjs/axios": "4.0.1",
|
|
21
|
+
"@dismissible/nestjs-hooks": "1.0.3-alpha.064e57a.0",
|
|
22
|
+
"@dismissible/nestjs-request": "1.0.3-alpha.064e57a.0",
|
|
23
|
+
"@dismissible/nestjs-logger": "1.0.3-alpha.064e57a.0",
|
|
24
|
+
"@dismissible/nestjs-validation": "1.0.3-alpha.064e57a.0",
|
|
25
|
+
"jwks-rsa": "3.2.0",
|
|
26
|
+
"jsonwebtoken": "9.0.3"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@types/jsonwebtoken": "
|
|
29
|
+
"@types/jsonwebtoken": "9.0.10"
|
|
29
30
|
},
|
|
30
31
|
"peerDependencies": {
|
|
31
|
-
"@nestjs/common": "
|
|
32
|
-
"@nestjs/core": "
|
|
33
|
-
"class-validator": "
|
|
34
|
-
"class-transformer": "
|
|
35
|
-
"rxjs": "
|
|
32
|
+
"@nestjs/common": "10.0.0 || ^11.0.0",
|
|
33
|
+
"@nestjs/core": "10.0.0 || ^11.0.0",
|
|
34
|
+
"class-validator": "0.14.3",
|
|
35
|
+
"class-transformer": "0.5.1",
|
|
36
|
+
"rxjs": "7.8.2"
|
|
36
37
|
},
|
|
37
38
|
"peerDependenciesMeta": {
|
|
38
39
|
"@nestjs/common": {
|
|
@@ -70,4 +71,4 @@
|
|
|
70
71
|
"access": "public"
|
|
71
72
|
},
|
|
72
73
|
"type": "commonjs"
|
|
73
|
-
}
|
|
74
|
+
}
|
|
@@ -12,7 +12,7 @@ export interface IJwtAuthHookModuleAsyncOptions {
|
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```typescript
|
|
15
|
-
* import { DismissibleModule } from '@dismissible/nestjs-
|
|
15
|
+
* import { DismissibleModule } from '@dismissible/nestjs-core';
|
|
16
16
|
* import { JwtAuthHookModule, JwtAuthHook } from '@dismissible/nestjs-jwt-auth-hook';
|
|
17
17
|
*
|
|
18
18
|
* @Module({
|
|
@@ -13,7 +13,7 @@ const jwt_auth_hook_config_1 = require("./jwt-auth-hook.config");
|
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```typescript
|
|
16
|
-
* import { DismissibleModule } from '@dismissible/nestjs-
|
|
16
|
+
* import { DismissibleModule } from '@dismissible/nestjs-core';
|
|
17
17
|
* import { JwtAuthHookModule, JwtAuthHook } from '@dismissible/nestjs-jwt-auth-hook';
|
|
18
18
|
*
|
|
19
19
|
* @Module({
|
package/src/jwt-auth.hook.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IDismissibleLifecycleHook, IHookResult } from '@dismissible/nestjs-
|
|
2
|
-
import { IRequestContext } from '@dismissible/nestjs-
|
|
1
|
+
import { IDismissibleLifecycleHook, IHookResult } from '@dismissible/nestjs-hooks';
|
|
2
|
+
import { IRequestContext } from '@dismissible/nestjs-request';
|
|
3
3
|
import { IDismissibleLogger } from '@dismissible/nestjs-logger';
|
|
4
4
|
import { JwtAuthService } from './jwt-auth.service';
|
|
5
5
|
import { JwtAuthHookConfig } from './jwt-auth-hook.config';
|