
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
fastify-cerbos
Advanced tools
This plugin provides a Fastify plugin for Cerbos.
Currently, this supports only isAllowed exposed by a Fastify request decorator, which returns a Promise that resolves to a boolean.
It assumes the request has been decorated with a user object. The user object is used to extract the principal using this getPrincipal function:
getPrincipal: user => {
const { id = 'anonymous', roles = ['anonymous'], ...rest } = user
return {
id,
roles,
attr: rest
}
}
This function can be overridden by passing a getPrincipal function to the plugin options.
If no user object is found in the request, the principal is anonymous principal:
{
id: 'anonymous',
roles: ['anonymous']
}
These values are also set in case user as no id or roles properties.
Install with:
npm install fastify-cerbos
Then you can add the plugin to your Fastify application:
const Fastify = require('fastify')
const fastifyCerbos = require('fastify-cerbos')
const app = Fastify()
app.register(fastifyCerbos, {
host: '127.0.0.1',
port: 3593,
useGRPC: true,
})
app.get('/', async function (request, reply) {
const { id } = request.body
const resource = {
id,
kind: 'post',
attr: {}
}
const allowed = await request.isAllowed(resource, 'modify')
if (!allowed) {
reply.code(403).send()
}
// (...)
})
await app.listen()
The plugin accepts the following options:
host - Cerbos server host. Default: 127.0.0.1port - Cerbos server port. Default: 3593useGRPC - Use gRPC to connect to Cerbos server. Default: truegetPrincipal - Function to extract the principal from the request. Default: see abovetls - TLS options for gRPC/HTTP connection. This object is passed to Cerbos Client ObjectMake sure you have Docker and docker-compose installed.
Start Cerbos server with:
docker-compose up -d
FAQs
Cerbos plugin for Fastify
The npm package fastify-cerbos receives a total of 1 weekly downloads. As such, fastify-cerbos popularity was classified as not popular.
We found that fastify-cerbos demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.