{"id":46244448,"url":"https://github.com/lotivo/sequelize-guard","last_synced_at":"2026-03-03T21:02:52.921Z","repository":{"id":43960830,"uuid":"252306404","full_name":"lotivo/sequelize-guard","owner":"lotivo","description":"An Authorization library for Sequelize.js","archived":false,"fork":false,"pushed_at":"2025-12-16T09:06:13.000Z","size":1855,"stargazers_count":50,"open_issues_count":1,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-19T19:09:43.212Z","etag":null,"topics":["acl","acl-librrary","authorization","authorize","rbac","sequelize","sequelize-acl","sequelize-guard"],"latest_commit_sha":null,"homepage":"https://sequelize-guard.js.org/","language":"MDX","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/lotivo.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-01T23:09:20.000Z","updated_at":"2025-12-16T09:06:17.000Z","dependencies_parsed_at":"2025-08-21T00:06:18.988Z","dependency_job_id":"22259c58-d068-4c22-ab9c-cca4c24ee343","html_url":"https://github.com/lotivo/sequelize-guard","commit_stats":null,"previous_names":["lotivo/sequelize-acl"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/lotivo/sequelize-guard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lotivo%2Fsequelize-guard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lotivo%2Fsequelize-guard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lotivo%2Fsequelize-guard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lotivo%2Fsequelize-guard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lotivo","download_url":"https://codeload.github.com/lotivo/sequelize-guard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lotivo%2Fsequelize-guard/sbom","scorecard":{"id":599528,"data":{"date":"2025-08-11","repo":{"name":"github.com/lotivo/sequelize-guard","commit":"4d0b743aa32f0e1a02033df0810b2ae6aed0f58a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":5,"reason":"Found 2/4 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"40 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-4gxf-g5gf-22h4","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-xf5p-87ch-gxw2","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-56x4-j7p9-fcf9","Warn: Project is vulnerable to: GHSA-v78c-4p63-2j6c","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-wrh9-cjv3-2hpw","Warn: Project is vulnerable to: GHSA-8c25-f3mj-v6h8","Warn: Project is vulnerable to: GHSA-vqfx-gj96-3w95","Warn: Project is vulnerable to: GHSA-f598-mfpv-gmfx","Warn: Project is vulnerable to: GHSA-mxhp-79qh-mcx6","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-qgmg-gppg-76g5","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T00:03:14.970Z","repository_id":43960830,"created_at":"2025-08-21T00:03:14.970Z","updated_at":"2025-08-21T00:03:14.970Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30060677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["acl","acl-librrary","authorization","authorize","rbac","sequelize","sequelize-acl","sequelize-guard"],"created_at":"2026-03-03T21:02:50.708Z","updated_at":"2026-03-03T21:02:52.917Z","avatar_url":"https://github.com/lotivo.png","language":"MDX","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Sequelize Guard\n\n**A powerful, type-safe authorization library for Sequelize.js**\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/lotivo/sequelize-guard/actions/workflows/ci-test.yml\"\u003e\n    \u003cimg src=\"https://github.com/lotivo/sequelize-guard/actions/workflows/ci-test.yml/badge.svg\" alt=\"CI\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/lotivo/sequelize-guard\"\u003e\n    \u003cimg src=\"https://coveralls.io/repos/github/lotivo/sequelize-guard/badge.svg\" alt=\"Coverage\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/sequelize-guard\"\u003e\n    \u003cimg src=\"https://badge.fury.io/js/sequelize-guard.svg\" alt=\"npm version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License: MIT\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://sequelize-guard.js.org\"\u003e\u003cstrong\u003e📖 Documentation\u003c/strong\u003e\u003c/a\u003e •\n  \u003ca href=\"https://www.npmjs.com/package/sequelize-guard\"\u003e\u003cstrong\u003eNPM Package\u003c/strong\u003e\u003c/a\u003e •\n  \u003ca href=\"https://github.com/lotivo/sequelize-guard/issues\"\u003e\u003cstrong\u003eReport Bug\u003c/strong\u003e\u003c/a\u003e •\n  \u003ca href=\"https://github.com/lotivo/sequelize-guard/issues\"\u003e\u003cstrong\u003eRequest Feature\u003c/strong\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003c/div\u003e\n\n---\n\n## About\n\nSequelizeGuard is a comprehensive authorization library for Sequelize.js that provides a robust, performant, and easy-to-use role-based access control (RBAC) system. Built with TypeScript and modern tooling, it enables you to manage complex permission structures with a clean, fluent API.\n\n## ✨ What's New in v6\n\nSequelize Guard v6 is a complete rewrite with major improvements:\n\n- 🎯 **Full TypeScript Support** - Complete rewrite in TypeScript with full type definitions\n- � **Sequelize 6 Compatible** - Updated to work with Sequelize v6.x\n- � **ESM \u0026 CommonJS** - Dual package support for modern and legacy projects\n- 🏗️ **Modern Tooling** - Built with Vite, tested with Vitest\n- � **Better Type Safety** - Enhanced IntelliSense and compile-time checking\n- ⚡ **99% Backward Compatible** - Minimal breaking changes from v5.x\n\n\u003e **Upgrading from v5?** Check out the [Migration Guide](https://sequelize-guard.js.org/migration/v6) for a smooth transition.\n\n## Features\n\n- 🚀 **Fast \u0026 Efficient** - Cache-based permission resolution for optimal performance\n- 🎯 **Intuitive API** - Fluent, semantic API that reads like natural language\n- 🔐 **Flexible RBAC** - Assign multiple roles and permissions to users\n- 📊 **Event-Driven** - Listen for authorization events for logging and auditing\n- 💾 **Smart Caching** - Configurable user permission caching\n- 🛡️ **Safe Operations** - Built-in safeguards for role and permission deletions\n\n## Installation\n\n```bash\n# npm\nnpm install sequelize-guard sequelize\n\n# yarn\nyarn add sequelize-guard sequelize\n\n# pnpm\npnpm add sequelize-guard sequelize\n```\n\n**Requirements:**\n\n- Node.js ≥ 20.19.0\n- Sequelize ≥ 6.37.7\n\n## Quick Start\n\n```typescript\nimport { Sequelize } from 'sequelize';\nimport SequelizeGuard from 'sequelize-guard';\n\nconst sequelize = new Sequelize(/* config */);\nconst guard = new SequelizeGuard(sequelize);\n\n// Assign roles and permissions\nawait user.assignRole('admin');\nawait guard.allow('admin', ['view', 'edit'], 'blog');\n\n// Check permissions\nconst canEdit = await user.can('edit blog');\nconst isAdmin = await user.isA('admin');\n```\n\n\u003e **Note:** Works with both TypeScript and JavaScript (ESM/CommonJS). See [documentation](https://sequelize-guard.js.org/getting-started) for JavaScript examples.\n\n## Documentation\n\nFor comprehensive guides, API reference, and examples, visit our documentation:\n\n**📖 [https://sequelize-guard.js.org](https://sequelize-guard.js.org)**\n\n### Key Topics\n\n- **[Getting Started](https://sequelize-guard.js.org/getting-started)** - Installation and basic setup\n- **[API Reference](https://sequelize-guard.js.org/api)** - Complete API documentation\n- **[TypeScript Support](https://sequelize-guard.js.org/typescript)** - Using with TypeScript\n- **[Examples](https://sequelize-guard.js.org/examples)** - Real-world usage examples\n- **[Blog](https://sequelize-guard.js.org/blogs)** - Articles and insights about the project\n\n### Migration\n\n- **[Migration Guide to v6](https://sequelize-guard.js.org/migration/upgrade-to-v6)** - Complete guide for upgrading to v6\n\n### Core Concepts\n\n#### Permission Checks\n\n```typescript\n// Check specific permission\nawait user.can('edit blog');\n\n// Check wildcard permissions\nawait user.can('* blog'); // All actions on blog\nawait user.can('view *'); // View all resources\nawait user.can('*'); // Superadmin - all actions on all resources\n```\n\n#### Role Checks\n\n```typescript\n// Check single role\nawait user.isA('admin');\nawait user.isAn('editor');\n\n// Check multiple roles\nawait user.isAnyOf(['admin', 'moderator']); // Has any of these roles\nawait user.isAllOf(['user', 'verified']); // Has all of these roles\n```\n\n#### Assigning Permissions\n\n```typescript\n// Fluent API\nawait guard\n  .init()\n  .allow('admin')\n  .to(['view', 'edit', 'delete'])\n  .on('blog')\n  .commit();\n\n// One-liner\nawait guard.allow('admin', ['view', 'edit'], 'blog');\n```\n\nFor more details, visit the [full documentation](https://sequelize-guard.js.org/docs).\n\n## Contributing\n\nWe love contributions! SequelizeGuard is open source and we welcome contributions of all kinds:\n\n- 🐛 Bug fixes\n- ✨ New features\n- 📝 Documentation improvements\n- ✅ Test coverage improvements\n- 💡 Ideas and suggestions\n\n```bash\n# Clone the repository\ngit clone https://github.com/lotivo/sequelize-guard.git\ncd sequelize-guard\n\n# Install dependencies\nyarn install\n\n# Run tests\nyarn test\n\n# Build\nyarn build\n```\n\n### Documentation\n\n#### Generating API Documentation\n\nAPI documentation is automatically generated from TypeScript source code:\n\n```bash\n# Generate API docs manually\nyarn docs:generate\n```\n\nThe API documentation is automatically updated after each release via GitHub Actions. See [scripts/README.md](scripts/README.md) for details.\n\n### Reporting Issues\n\nFound a bug or have a feature request? [Open an issue](https://github.com/lotivo/sequelize-guard/issues) with:\n\n- Clear description\n- Steps to reproduce (for bugs)\n- Your environment (Node, Sequelize, sequelize-guard versions)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n### Influences\n\n- [**Spatie's Laravel-permission**](https://github.com/spatie/laravel-permission) - Authorization library for Laravel\n- [**Node-ACL**](https://github.com/OptimalBits/node_acl) - Access Control List for Node.js\n\n### Alternatives\n\n- [**Node-ACL**](https://github.com/OptimalBits/node_acl) - A versatile library with support for most ORMs\n- [**AccessControl**](https://github.com/onury/accesscontrol) - Role and attribute-based access control\n- [**CASL**](https://casl.js.org/) - Isomorphic authorization library\n\n## Support\n\nNeed help? Here's how to get support:\n\n- 📖 **Documentation:** [https://sequelize-guard.js.org](https://sequelize-guard.js.org) (fallback: [https://sequelize-guard.vercel.app](https://sequelize-guard.vercel.app))\n- 🐛 **Bug Reports:** [GitHub Issues](https://github.com/lotivo/sequelize-guard/issues)\n- 💬 **Questions:** [GitHub Discussions](https://github.com/lotivo/sequelize-guard/discussions)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\nCreated by [Pankaj Vaghela](https://github.com/pankajvaghela) for Open Source Community.\n\nIf you find this project helpful, please consider giving it a ⭐️!\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flotivo%2Fsequelize-guard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flotivo%2Fsequelize-guard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flotivo%2Fsequelize-guard/lists"}