Installations
npm install think-csrf
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
14.15.0
NPM Version
7.19.0
Score
68.8
Supply Chain
78.6
Quality
82.3
Maintenance
50
Vulnerability
99.6
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
thinkjs
Download Statistics
Total Downloads
5,908
Last Day
1
Last Week
17
Last Month
109
Last Year
1,410
GitHub Statistics
2 Stars
19 Commits
13 Watching
1 Branches
7 Contributors
Package Meta Information
Latest Version
1.0.5
Package Id
think-csrf@1.0.5
Unpacked Size
7.59 kB
Size
3.18 kB
File Count
10
NPM Version
7.19.0
Node Version
14.15.0
Total Downloads
Cumulative downloads
Total Downloads
5,908
Last day
-93.3%
1
Compared to previous day
Last week
-59.5%
17
Compared to previous week
Last month
41.6%
109
Compared to previous month
Last year
-25.1%
1,410
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
think-csrf
CSRF for Thinkjs 3.0
Install
$ npm install think-csrf --save
How to use
config file src/config/middleware.js
1const csrf = require('think-csrf'); 2 3module.exports = [{ 4 handle: csrf, 5 options: { 6 session_name: 'csrf_token', 7 form_name: '_csrf', 8 header_name: 'x-csrf-token' 9 } 10}];
Usage
ctx.csrf
getter for CSRF token
Options
Name | Description | Default |
---|---|---|
session_name | csrf token's session name | 'csrf_token' |
form_name | request csrf token's name in body and query | '_csrf' |
header_name | request csrf token's name in header | 'x-csrf-token' |
errno | error status | 403 |
errmsg | error message | 'invalid csrf token' |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/19 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More