
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
cloudflare-workers-auth
Advanced tools
API key authentication for Cloudflare Workers
$ npm install cloudflare-workers-auth cloudflare-workers
const worker = require('cloudflare-workers');
const auth = require('cloudflare-workers-auth');
auth.init({
apiKeyHeader: 'x-apikey',
apiKeys: [ 'key123', 'keyabc', 'keyxyz' ]
})
worker.get('/', (request) => new Response('welcome\n'));
worker.use('/protected*', auth.apiKey);
worker.get('/protected', (request) => new Response('path protected by apikey\n'));
worker.get('/protected/account', (request) => new Response('account info: apikey protected\n'));
worker.get('/protected/address', (request) => new Response('address details: apikey protected\n'));
worker.get('/public', (request) => new Response('public path: not apikey protected\n'));
addEventListener('fetch', function(event) {
event.respondWith(worker.handleRequest(event));
});
See 'Using NPM modules' to require
the package in your worker.
This package is designed as middleware for the 'cloudflare-workers' routing package.
MIT license; see LICENSE.
FAQs
API key authentication for Cloudflare Workers
The npm package cloudflare-workers-auth receives a total of 0 weekly downloads. As such, cloudflare-workers-auth popularity was classified as not popular.
We found that cloudflare-workers-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.