Security header middleware collection for Koa applications that wraps Helmet.js
91
{
"context": "This criteria evaluates how well the engineer uses koa-helmet to implement referrer policy security headers in a Koa application. The evaluation focuses specifically on the proper use of koa-helmet's referrerPolicy functionality and its integration with the Koa middleware system.",
"type": "weighted_checklist",
"checklist": [
{
"name": "koa-helmet import",
"description": "The solution correctly imports the koa-helmet package (e.g., `import helmet from 'koa-helmet'` or `const helmet = require('koa-helmet')`)",
"max_score": 10
},
{
"name": "Helmet middleware application",
"description": "The solution uses app.use() to apply koa-helmet middleware to the Koa application",
"max_score": 20
},
{
"name": "referrerPolicy method usage",
"description": "The solution specifically uses helmet.referrerPolicy() method (or configures referrerPolicy within helmet() options) rather than setting headers manually",
"max_score": 30
},
{
"name": "no-referrer policy",
"description": "The solution configures the referrer policy to 'no-referrer' using the correct options format (e.g., `helmet.referrerPolicy({ policy: 'no-referrer' })` or `helmet({ referrerPolicy: { policy: 'no-referrer' } })`)",
"max_score": 30
},
{
"name": "Middleware ordering",
"description": "The koa-helmet middleware is applied before route handlers, ensuring headers are set on all responses",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-koa-helmetdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10