{"id":28403856,"url":"https://github.com/openfga/sample-stores","last_synced_at":"2026-01-28T22:32:27.037Z","repository":{"id":37074881,"uuid":"503463577","full_name":"openfga/sample-stores","owner":"openfga","description":"Examples of OpenFGA models + store content","archived":false,"fork":false,"pushed_at":"2025-11-18T16:02:36.000Z","size":153,"stargazers_count":69,"open_issues_count":1,"forks_count":16,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-12-25T12:27:53.902Z","etag":null,"topics":["openfga"],"latest_commit_sha":null,"homepage":"https://openfga.dev","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfga.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":".github/CODEOWNERS","security":".github/SECURITY-INSIGHTS.yml","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE.txt","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-06-14T17:47:41.000Z","updated_at":"2025-12-05T14:25:13.000Z","dependencies_parsed_at":"2024-01-21T01:19:50.140Z","dependency_job_id":"4367130d-09d4-4761-bd9b-65a8960b47d1","html_url":"https://github.com/openfga/sample-stores","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openfga/sample-stores","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Fsample-stores","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Fsample-stores/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Fsample-stores/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Fsample-stores/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfga","download_url":"https://codeload.github.com/openfga/sample-stores/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Fsample-stores/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28853540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: 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":["openfga"],"created_at":"2025-06-01T19:11:04.579Z","updated_at":"2026-01-28T22:32:27.031Z","avatar_url":"https://github.com/openfga.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenFGA Sample Stores\n\n[![Join our community](https://img.shields.io/badge/slack-cncf_%23openfga-40abb8.svg?logo=slack)](https://openfga.dev/community)\n[![Twitter](https://img.shields.io/twitter/follow/openfga?color=%23179CF0\u0026logo=twitter\u0026style=flat-square \"@openfga on Twitter\")](https://x.com/openfga)\n\nThis repository contains [sample store models](#sample-stores) for [OpenFGA](https://openfga.dev).\n\n## Table of Contents\n\n- [Table of Contents](#table-of-contents)\n- [Sample Store Models](#sample-store-models)\n- [Creating your store and loading sample data](#creating-your-store-and-loading-sample-data)\n- [OpenFGA models in open source projects](#openfga-models-in-open-source-projects)\n- [Modeling Resources](#modeling-resources)\n\n## Sample Store Models\n\n- [Modeling ABAC with ReBAC](./stores/abac-with-rebac)\n- [Advanced Entitlements](./stores/advanced-entitlements)\n- [Banking](./stores/banking)\n- [Condition Data Types](./stores/condition-data-types)\n- [Custom Roles](./stores/custom-roles)\n- [Developer Portal](./stores/developer-portal)\n- [Entitlements](./stores/entitlements)\n- [Expenses](./stores/expenses)\n- [GitHub](./stores/github)\n- [Google Drive](./stores/gdrive)\n- [Group Resource Attributes](./stores/groups-resource-attributes)\n- [IoT](./stores/iot)\n- [IP-Based Access](./stores/ip-based-access)\n- [Modeling Guide](./stores/modeling-guide)\n- [Modeling Multi-Tenant Role-Based Access Control](./stores/multitenant-rbac)\n- [Modular Models](./stores/modular)\n- [Role Assignments](./stores/role-assignments)\n- [Slack](./stores/slack)\n- [Super-Admin](./stores/superadmin)\n- [Temporal Access](./stores/temporal-access)\n\n## Authoring Models using Coding Assistants\n\nThis repository includes a [copilot-instructions](.github/copilot-instructions.md) file that can help you author OpenFGA models. It can be used in VS Code or in any AI-assisted IDE. You can also use it as a prompt, or system prompt, in any LLM. \n\nSome prompts you can try:\n\n- Create an OpenFGA authorization model for an insurance company.\n- Create an OpenFGA authorization model for B2B SaaS project management system.\n- Create an OpenFGA authorization model for \u003cProduct Name\u003e (e.g. create a model for Figma).\n\nIt will create a model in an `.fga` file, and a `.fga.yaml` with tuples/tests, and use the [CLI](https://github.com/openfga/cli) to run the tests.\n\nTo use it in Visual Studio Code:\n- Setup [VS Code with Copilot](https://code.visualstudio.com/docs/copilot/setup-simplified)\n- Create a new folder, with a .github folder, and copy the [copilot-instructions](.github/copilot-instructions.md) file.\n- Open Copilot\n- Prompt\n\nOther coding assistants look for other file names (CLAUDE.md, AGENTS.md, Cursor rules).\n\nYou can also use the [DeepWiki MCP](https://docs.devin.ai/work-with-devin/deepwiki-mcp) or the [Context7 MCP](https://github.com/upstash/context7) to provide AI agents with OpenFGA context to help you implement OpenFGA using different SDKs. \n\nFor modeling assistance, we you use [copilot-instructions](.github/copilot-instructions.md) even if you configure an MCP.\n\n## Creating your store and loading sample data\n\nTo try this out, you need the following tools installed:\n- The `fga` CLI, follow the [installation instructions](https://github.com/openfga/cli/?tab=readme-ov-file#installation) here to get it\n- `git`\n\n1.  Clone this repository\n  ```sh\n  git clone https://github.com/openfga/sample-stores.git openfga-sample-stores \u0026\u0026 cd $_\n  ```\n\n2. Use the `fga` CLI to test the store you choose (e.g. `github`, `custom-roles`, etc..)\n  ```sh\n  SAMPLE_STORE=github\n  fga model test --tests \"stores/${SAMPLE_STORE}/store.fga.yaml\"\n  ```\n\n## OpenFGA models in open source projects\n\n- [Linux Foundation](https://github.com/linuxfoundation/lfx-v2-helm/blob/main/charts/lfx-platform/templates/openfga/model.yaml)\n- [canonical/lxd](https://github.com/canonical/lxd/blob/main/lxd/auth/drivers/openfga_model.openfga)\n- [canonical/identity-platform-login-ui](https://github.com/canonical/identity-platform-login-ui/blob/main/internal/authorization/schema.openfga)\n- [canonical/jimm](https://github.com/canonical/jimm/blob/v3/openfga/authorisation_model.fga)\n- [grafana/grafana](https://github.com/grafana/grafana/tree/main/pkg/services/authz/zanzana/schema)\n- [lxc/incus](https://github.com/lxc/incus/blob/main/internal/server/auth/driver_openfga_model.openfga)\n- [mindersec/minder](https://github.com/mindersec/minder/blob/main/internal/authz/model/minder.fga)\n- [theopenlane/core](https://github.com/theopenlane/core/blob/main/fga/model/model.fga)\n- [instill-ai/pipeline-backend](https://github.com/instill-ai/pipeline-backend/blob/main/pkg/acl/model.go)\n- [virtool/virtool](https://github.com/virtool/virtool/blob/c621ba6a22bfe3464fe59287337029e42295cfcb/virtool/authorization/openfga.py#L123)\n- [concrete-utopia/utopia](https://github.com/concrete-utopia/utopia/blob/master/utopia-remix/fga/model.fga)\n- [Cross-Lab-Project/crosslab](https://github.com/Cross-Lab-Project/crosslab/blob/main/services/authorization/relation_model.fga)\n- [sourcegraph/sourcegraph-public-snapshot](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/cmd/enterprise-portal/service/iam_model.fga)\n- [klothoplatform/infracopilot](https://github.com/klothoplatform/infracopilot/blob/main/src/auth_service/model.fga)\n- [ZEISS/knox](https://github.com/ZEISS/knox/blob/main/schema/auth.fga)\n- [Lakekeeper](https://github.com/lakekeeper/lakekeeper/tree/main/authz/openfga/v3.2)\n\nIf you are using OpenFGA in your open source project, please let us know by opening a PR to add your model to this list.\n\n## Modeling Resources\n- [Modeling Guide](https://www.youtube.com/watch?v=5Lwy9aHXXHE\u0026list=PLUR5l-oTFZqWaDdhEOVt_IfPOIbKo1Ypt)\n- [OpenFGA Documentation](https://openfga.dev/docs/modeling)\n- [Zanzibar Academy](https://zanzibar.academy)\n- [Implementing Multi-Tenancy in Chroma: Part 2 - Authorization Model with OpenFGA](https://cookbook.chromadb.dev/strategies/multi-tenancy/authorization-model-with-openfga/)\n- [Introduction into OpenFGA](https://www.ericksegaar.com/2024/03/04/introduction-into-openfga/)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfga%2Fsample-stores","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfga%2Fsample-stores","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfga%2Fsample-stores/lists"}