Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fastify/csrf-protection

Package Overview
Dependencies
Maintainers
20
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/csrf-protection - npm Package Compare versions

Comparing version 6.4.0 to 6.4.1

2

package.json
{
"name": "@fastify/csrf-protection",
"version": "6.4.0",
"version": "6.4.1",
"description": "A plugin for adding CSRF protection to Fastify.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -40,3 +40,12 @@ /// <reference types="node" />

sessionPlugin?: '@fastify/cookie';
csrfOpts: Omit<CSRFOptions, 'hmacKey'> & Required<Pick<CSRFOptions, 'hmacKey'>>;
csrfOpts?: | ({
[k in keyof CSRFOptions]: k extends "userInfo"
? true
: CSRFOptions[k];
} & Required<Pick<CSRFOptions, "hmacKey">>)
| ({
[k in keyof CSRFOptions]: k extends "userInfo"
? false
: CSRFOptions[k];
});
}

@@ -43,0 +52,0 @@

@@ -56,5 +56,7 @@ import Fastify from 'fastify'

fastify.register(FastifyCsrfProtection, { csrfOpts: { hmacKey: 'hmac' } })
expectError(fastify.register(FastifyCsrfProtection, { }))
expectError(fastify.register(FastifyCsrfProtection, { csrfOpts: { }}))
expectError(fastify.register(FastifyCsrfProtection, { sessionPlugin: '@fastify/cookie', csrfOpts: { }}))
fastify.register(FastifyCsrfProtection, { })
fastify.register(FastifyCsrfProtection, { csrfOpts: { }})
expectError(fastify.register(FastifyCsrfProtection, { sessionPlugin: '@fastify/cookie', csrfOpts: { userInfo: true}}))
fastify.register(FastifyCsrfProtection, { sessionPlugin: '@fastify/cookie', csrfOpts: { userInfo: true, hmacKey: 'key'}})
fastify.register(FastifyCsrfProtection, { sessionPlugin: '@fastify/cookie'})
fastify.register(FastifyCsrfProtection, { csrfOpts: { }, sessionPlugin: '@fastify/session' })

@@ -61,0 +63,0 @@ fastify.register(FastifyCsrfProtection, { csrfOpts: { }, sessionPlugin: '@fastify/secure-session' })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc