{"id":18850733,"url":"https://github.com/typeerror/blockade","last_synced_at":"2025-04-14T09:40:36.442Z","repository":{"id":129322354,"uuid":"163500831","full_name":"TypeError/blockade","owner":"TypeError","description":"Implement secure headers and cookies in Node.js web frameworks to enhance application security","archived":false,"fork":false,"pushed_at":"2019-04-15T09:36:26.000Z","size":64,"stargazers_count":60,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T22:51:15.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://blockadejs.rtfd.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TypeError.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-29T10:09:58.000Z","updated_at":"2024-09-05T12:34:56.000Z","dependencies_parsed_at":"2024-06-28T11:27:40.451Z","dependency_job_id":null,"html_url":"https://github.com/TypeError/blockade","commit_stats":null,"previous_names":["typeerror/blockade"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeError%2Fblockade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeError%2Fblockade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeError%2Fblockade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeError%2Fblockade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TypeError","download_url":"https://codeload.github.com/TypeError/blockade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248855554,"owners_count":21172590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T03:30:57.817Z","updated_at":"2025-04-14T09:40:36.410Z","avatar_url":"https://github.com/TypeError.png","language":"TypeScript","readme":"# Blockade\n\n[![version](https://img.shields.io/npm/v/blockade.svg)](https://www.npmjs.com/package/blockade)\n[![Types](https://img.shields.io/npm/types/blockade.svg)](https://www.npmjs.com/package/blockade)\n[![License](https://img.shields.io/npm/l/blockade.svg)](https://www.npmjs.com/package/blockade)\n[![Style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\nBlockade ⚓️ is a lightweight package that adds optional security headers and cookie attributes for Node.js web frameworks.\n\nSecurity HTTP headers and cookie attributes help enhance the security of your web application by enabling built-in browser security mechanisms. \n\n### Supported Node.js web frameworks:\n[AdonisJs](https://adonisjs.com), [Express](https://expressjs.com), [Fastify](https://www.fastify.io), [hapi](https://hapijs.com), [Koa](https://koajs.com), [Meteor](https://www.meteor.com), [Nest](https://nestjs.com), [Polka](https://github.com/lukeed/polka), [restify](http://restify.com), [Sails](https://sailsjs.com), [Total.js](https://www.totaljs.com)\n\n## Install\n\n```console\n$ npm i blockade\n```\n\nAfter installing Blockade:\n\n```javascript\nconst blockade = require(\"blockade\");\n\nconst secureHeaders = new blockade.SecureHeaders();\nconst secureCookie = new blockade.SecureCookie();\n\n```\n\n\n## Secure Headers\n \n ### Example\n`secureHeaders.framework(response);`\n\n **Default HTTP response headers:** \n \n```HTTP\nStrict-Transport-Security: max-age=63072000; includeSubdomains\nX-Frame-Options: SAMEORIGIN\nX-XSS-Protection: 1; mode=block\nX-Content-Type-Options: nosniff\nReferrer-Policy: no-referrer, strict-origin-when-cross-origin\nCache-control: no-cache, no-store, must-revalidate, max-age=0\nPragma: no-cache\nExpires: 0\n```\n\n## Secure Cookie\n\n### Example\n\n```javascript\nsecureCookie.framework(response, \"foo\", \"bar\");\n```\n\n**Default Set-Cookie HTTP response header:**   \n\n```HTTP\nSet-Cookie: foo=bar; Path=/; secure; HttpOnly; SameSite=lax\n```\n\n## Documentation\nPlease see the full set of documentation at [https://blockadejs.readthedocs.io](https://blockadejs.readthedocs.io)\n\n## Resources\n- [OWASP - Secure Headers Project](https://www.owasp.org/index.php/OWASP_Secure_Headers_Project)\n- [OWASP - Session Management Cheat Sheet](https://www.owasp.org/index.php/Session_Management_Cheat_Sheet#Cookies)\n- [Mozilla Web Security](https://infosec.mozilla.org/guidelines/web_security)\n- [securityheaders.com](https://securityheaders.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypeerror%2Fblockade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypeerror%2Fblockade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypeerror%2Fblockade/lists"}