@bull-board/nestjs 6.7.10 → 6.8.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.
Files changed (2) hide show
  1. package/README.md +54 -0
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -62,6 +62,60 @@ The following options are available.
62
62
  - `boardOptions` options as provided by the bull-board package, such as `uiBasePath` and `uiConfig`
63
63
  - `middleware` optional middleware for the express adapter (e.g. basic authentication)
64
64
 
65
+
66
+ ### Express Authentication
67
+
68
+ For Express, install `express-basic-auth`:
69
+
70
+ ```bash
71
+ $ npm install --save express-basic-auth
72
+ ```
73
+
74
+ Modify the `BullBoardModule.forRoot()` method:
75
+
76
+ ```typescript
77
+ import basicAuth from "express-basic-auth";
78
+
79
+ BullBoardModule.forRoot({
80
+ route: "/queues",
81
+ adapter: ExpressAdapter,
82
+ middleware: basicAuth({
83
+ challenge: true,
84
+ users: { admin: "passwordhere" },
85
+ }),
86
+ }),
87
+ ```
88
+
89
+ ### Fastify Authentication
90
+
91
+ For Fastify, you can use `fastify-basic-auth`:
92
+
93
+ ```bash
94
+ $ npm install --save fastify-basic-auth
95
+ ```
96
+
97
+ Then apply it using middleware:
98
+
99
+ ```typescript
100
+ import fastifyBasicAuth from "fastify-basic-auth";
101
+
102
+ BullBoardModule.forRoot({
103
+ route: "/queues",
104
+ adapter: FastifyAdapter,
105
+ middleware: (req, res, next) => {
106
+ fastifyBasicAuth({
107
+ validate: async (username, password, req, reply) => {
108
+ if (username === "admin" && password === "passwordhere") {
109
+ return;
110
+ }
111
+ throw new Error("Unauthorized");
112
+ },
113
+ })(req, res, next);
114
+ },
115
+ }),
116
+ ```
117
+
118
+
65
119
  ## Register your queues
66
120
  To register a new queue, you need to register `BullBoardModule.forFeature` in the same module as where your queues are registered.
67
121
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bull-board/nestjs",
3
- "version": "6.7.10",
3
+ "version": "6.8.1",
4
4
  "description": "A NestJS module for Bull-Board dashboard.",
5
5
  "keywords": [
6
6
  "bull",
@@ -19,10 +19,10 @@
19
19
  "clean": "rm -rf dist"
20
20
  },
21
21
  "devDependencies": {
22
+ "@bull-board/api": "^6.8.1",
23
+ "@bull-board/express": "^6.8.1",
24
+ "@bull-board/fastify": "^6.8.1",
22
25
  "@nestjs/bull-shared": "^10.0.0",
23
- "@bull-board/api": "^6.7.10",
24
- "@bull-board/express": "^6.7.10",
25
- "@bull-board/fastify": "^6.7.10",
26
26
  "@nestjs/bullmq": "^10.0.0",
27
27
  "@nestjs/common": "^10.0.1",
28
28
  "@nestjs/core": "^10.0.1",
@@ -34,8 +34,8 @@
34
34
  "typescript": "^5.1.3"
35
35
  },
36
36
  "peerDependencies": {
37
- "@bull-board/api": "^6.7.10",
38
- "@bull-board/express": "^6.7.10",
37
+ "@bull-board/api": "^6.8.1",
38
+ "@bull-board/express": "^6.8.1",
39
39
  "@nestjs/bull-shared": "^10.0.0 || ^11.0.0",
40
40
  "@nestjs/common": "^9.0.0 || ^10.0.0 || ^11.0.0",
41
41
  "@nestjs/core": "^9.0.0 || ^10.0.0 || ^11.0.0",