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

fastify-casbin-rest

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-casbin-rest - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

package.json
{
"name": "fastify-casbin-rest",
"version": "1.1.0",
"version": "1.1.1",
"description": "Plugin for fastify to add support for Casbin REST model",

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

@@ -5,2 +5,14 @@ /// <reference types="node" />

declare module 'fastify' {
interface RouteShorthandOptions {
casbin?: {
rest?: boolean | {
getSub?: (request: FastifyRequest) => string,
getObj?: (request: FastifyRequest) => string,
getAct?: (request: FastifyRequest) => string
}
}
}
}
export type Hook =

@@ -7,0 +19,0 @@ | 'onRequest'

@@ -29,1 +29,11 @@ import fastify, { FastifyReply, FastifyRequest } from 'fastify'

})
server.get('/', {
casbin: {
rest: {
getSub: (request: FastifyRequest) => '1',
getObj: (request: FastifyRequest) => request.url,
getAct: (request: FastifyRequest) => request.method
}
}
}, () => Promise.resolve('ok'))
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