nuxt-security-module 4.1.2 → 4.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 CHANGED
@@ -1,22 +1,48 @@
1
1
  # nuxt-security-module
2
2
 
3
+ [![Apache-2.0 licensed][badge-license]][url-license]
4
+ [![NPM version][badge-npm-version]][url-npm]
5
+ [![NPM downloads][badge-npm-downloads]][url-npm]
6
+ [![NPM Unpacked Size (with version)][badge-npm-unpacked-size]][url-npm]
7
+
3
8
  Nuxt security module for [Nitro 3](https://nitro.build) and h3 2. It sets security headers on rendered pages, a per-request nonce Content Security Policy with the nonce written onto the page's own tags, subresource integrity, a prerender policy as a `<meta>` element, the framework's `X-Powered-By` header removed, CORS, allowed methods, basic auth and a request size limit.
4
9
 
5
- It replaces [nuxt-security](https://github.com/Baroshem/nuxt-security). Its upstream audit, every issue it was held to, and the defaults it ships are on the documentation page: [nuxt-security-module](https://github.com/Esposter/Esposter/blob/main/apps/web/content/docs/nuxt-security-module/index.md).
10
+ It replaces [nuxt-security](https://github.com/Baroshem/nuxt-security). Its upstream audit, every issue it was held to, and the defaults it ships are on the documentation page: [nuxt-security-module](https://github.com/Esposter/Esposter/blob/main/openspec/specs/nuxt-security-module/README.md).
6
11
 
7
12
  ## Table of Contents
8
13
 
14
+ - 🚀 [Getting Started](#getting-started)
9
15
  - 📖 [Documentation](#documentation)
10
16
  - ⚖️ [License](#license)
11
17
 
12
18
  ---
13
19
 
20
+ ## <a name="getting-started">🚀 Getting Started</a>
21
+
22
+ ```bash
23
+ pnpm i nuxt-security-module
24
+ ```
25
+
26
+ ```ts
27
+ // nuxt.config.ts
28
+ export default defineNuxtConfig({ modules: ["nuxt-security-module"] });
29
+ ```
30
+
14
31
  ## <a name="documentation">📖 Documentation</a>
15
32
 
16
- The module's option reference, its upstream audit and its defaults review live in the repository's documentation section, under `apps/web/content/docs/nuxt-security-module`. The package's status and the steps not yet built are on its index page.
33
+ We highly recommend you take a look at the [documentation](https://github.com/Esposter/Esposter/tree/main/openspec/specs/nuxt-security-module) to level up.
34
+
35
+ The module's option reference, its upstream audit and its defaults review live in the repository's [specs](https://github.com/Esposter/Esposter/tree/main/openspec/specs/nuxt-security-module). The package's status and the steps not yet built are in its `README.md` there.
17
36
 
18
37
  ---
19
38
 
20
39
  ## <a name="license">⚖️ License</a>
21
40
 
22
41
  Apache-2.0
42
+
43
+ [badge-license]: https://img.shields.io/github/license/Esposter/Esposter.svg?color=blue
44
+ [url-license]: https://github.com/Esposter/Esposter/blob/main/LICENSE
45
+ [badge-npm-version]: https://img.shields.io/npm/v/nuxt-security-module/latest?color=brightgreen
46
+ [url-npm]: https://www.npmjs.com/package/nuxt-security-module/v/latest
47
+ [badge-npm-unpacked-size]: https://img.shields.io/npm/unpacked-size/nuxt-security-module/latest?label=npm
48
+ [badge-npm-downloads]: https://img.shields.io/npm/dm/nuxt-security-module.svg
@@ -2,7 +2,7 @@
2
2
  const generateRandomToken = (byteLength) => {
3
3
  const bytes = new Uint8Array(byteLength);
4
4
  globalThis.crypto.getRandomValues(bytes);
5
- return btoa(String.fromCodePoint(...bytes)).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/u, "");
5
+ return btoa(String.fromCodePoint(...bytes)).replaceAll("+", "-").replaceAll("/", "_").replace(/[=]+$/u, "");
6
6
  };
7
7
  //#endregion
8
8
  export { generateRandomToken };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-security-module",
3
- "version": "4.1.2",
3
+ "version": "4.3.1",
4
4
  "description": "Nuxt security module for Nitro 3 and h3 2 — security headers, a per-request nonce Content Security Policy, subresource integrity, CORS, allowed methods, basic auth and a request size limit.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Jimmy Chen",
@@ -37,8 +37,6 @@
37
37
  "scripts": {
38
38
  "build": "tsdown",
39
39
  "bench": "vitest bench --run",
40
- "format": "oxfmt",
41
- "format:check": "oxfmt --check",
42
40
  "lint": "eslint .",
43
41
  "lint:fix": "eslint --fix .",
44
42
  "test": "vitest",
@@ -52,21 +50,16 @@
52
50
  "zod": "^4.6.7"
53
51
  },
54
52
  "devDependencies": {
55
- "@arethetypeswrong/core": "^0.18.5",
56
- "@esposter/configuration": "4.1.2",
57
- "@esposter/shared-node": "4.1.2",
53
+ "@esposter/configuration": "4.3.1",
54
+ "@esposter/shared-node": "4.3.1",
58
55
  "@nuxt/nitro-server": "npm:@nuxt/nitro-server-nightly@5x",
59
56
  "@types/node": "^26.6.5",
60
- "fast-check": "^4.10.2",
61
- "h3": "^2.0.2",
62
- "nitro": "npm:nitro-nightly@latest",
63
- "publint": "^0.3.25",
64
- "tsdown": "^0.23.1",
65
- "vitest": "^5.0.4"
57
+ "h3": "^2.0.7",
58
+ "tsdown": "^0.23.1"
66
59
  },
67
60
  "peerDependencies": {
68
- "nitro": "npm:nitro-nightly@latest",
61
+ "nitro": "npm:nitro-nightly@3.0.1-20261018-005730-bb9894fe",
69
62
  "nuxt": "npm:nuxt-nightly@5x"
70
63
  },
71
- "gitHead": "144e3f98570b015e3181bfbc6cb70d346ce826b5"
64
+ "gitHead": "777a39636b789c13af33ed13370246ccf6dbaf31"
72
65
  }