Skip to content

Commit ee8d413

Browse files
authored
Merge pull request #212 from Baroshem/chore/1.0.0-rc.1
Chore/1.0.0 rc.1
2 parents 8dc3c47 + a9e85b5 commit ee8d413

File tree

98 files changed

+11200
-9121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+11200
-9121
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: ci
33
on:
44
push:
55
branches:
6-
- main
6+
- 'main'
7+
- '**-rc.**'
8+
- 'renovate/**'
79
pull_request:
8-
branches:
9-
- main
1010

1111
jobs:
1212
ci:

README.md

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
[![nuxt-security](https://nuxt-security.vercel.app/preview.png)](https://nuxt-security.vercel.app)
22

3-
# nuxt-security
4-
53
[![npm version][npm-version-src]][npm-version-href]
64
[![npm downloads][npm-downloads-src]][npm-downloads-href]
75
[![Github Actions CI][github-actions-ci-src]][github-actions-ci-href]
86
[![License][license-src]][license-href]
97
[![Nuxt][nuxt-src]][nuxt-href]
108

11-
> Security module for Nuxt based on [OWASP Top 10](https://cheatsheetseries.owasp.org/cheatsheets/Nodejs_Security_Cheat_Sheet.html#nodejs-security-cheat-sheet) and [helmet](https://helmetjs.github.io/) that adds security response headers, protection middlewares, CORS, and more.
9+
# Nuxt Security
10+
11+
Automatically configure your app to follow OWASP security patterns and principles by using HTTP Headers and Middleware.
12+
13+
> This module works with Nuxt 3 only
1214
1315
- [📖  Read the documentation](https://nuxt-security.vercel.app)
14-
- [👾  Playground](https://stackblitz.com/github/baroshem/nuxt-security?file=.stackblitz%2Fnuxt.config.ts)
15-
- [ Intro video](https://www.youtube.com/watch?v=8ac30Py8Ses)
16+
- [👾  Playground](https://nuxt-security.vercel.app/playground)
1617

1718
## Features
1819

19-
- Nuxt 3 ready
20-
- Security response headers
21-
- Content Security Policy (CSP) for SSG apps
20+
- Security response headers (including CSP for SSG apps)
2221
- Request Size & Rate Limiters
2322
- Cross Site Scripting (XSS) Validation
2423
- Cross-Origin Resource Sharing (CORS) support
24+
- Hide `X-Powered-By` header and remove console loggers utils
2525
- `[Optional]` Allowed HTTP Methods, Basic Auth, CSRF
2626

2727
## Usage
2828

2929
Install the module:
3030

3131
```sh
32-
npm i -D nuxt-security
33-
yarn add -D nuxt-security
34-
pnpm add -D nuxt-security
32+
npm i -D nuxt-security@rc
33+
yarn add -D nuxt-security@rc
34+
pnpm add -D nuxt-security@rc
3535
```
3636

3737
Add the module in the `modules` array in `nuxt.config.ts`:
@@ -44,10 +44,6 @@ export default defineNuxtConfig({
4444

4545
And that's it! The module will now register route rules and server middlewares globally so that your application will be more secured.
4646

47-
## Static site generation (SSG)
48-
49-
This module is meant to work with SSR apps, but you can also use this module in SSG apps where you will get a Content Security Policy (CSP) support via `<meta http-equiv>` tag. You can find more about configuring Content Security Policy (CSP) [here](https://nuxt-security.vercel.app/security/headers#content-security-policy).
50-
5147
## Configuration
5248

5349
You can pass configuration to the module in the `nuxt.config.ts` like following:

docs/.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
*.iml
3+
.idea
4+
*.log*
5+
.nuxt
6+
.vscode
7+
.DS_Store
8+
coverage
9+
dist
10+
sw.*
11+
.env
12+
.output

docs/.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true

docs/app.config.ts

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
export default defineAppConfig({
2+
github: {
3+
owner: 'Baroshem',
4+
repo: 'nuxt-security',
5+
branch: 'main'
6+
},
7+
docus: {
8+
title: 'Nuxt Security',
9+
description: '🛡️ Security Module for Nuxt based on HTTP Headers and Middleware',
10+
image: '/preview.jpg',
11+
url: 'https://nuxt-security.vercel.app',
12+
socials: {
13+
twitter: 'jacobandrewsky',
14+
github: 'baroshem/nuxt-security',
15+
nuxt: {
16+
label: 'Nuxt',
17+
icon: 'simple-icons:nuxtdotjs',
18+
href: 'https://nuxt.com'
19+
}
20+
},
21+
aside: {
22+
level: 1
23+
},
24+
github: {
25+
dir: 'docs/content',
26+
root: 'docs/content',
27+
edit: true,
28+
releases: true,
29+
owner: 'baroshem',
30+
repo: 'nuxt-security',
31+
branch: 'main'
32+
},
33+
cover: {
34+
src: '/preview.png',
35+
alt: 'Security Module for Nuxt based on HTTP Headers and Middleware'
36+
},
37+
header: {
38+
logo: true
39+
}
40+
}
41+
})

0 commit comments

Comments
 (0)