{"id":13840834,"url":"https://github.com/casbin-net/redis-adapter","last_synced_at":"2025-07-11T09:33:29.798Z","repository":{"id":48190669,"uuid":"509972010","full_name":"casbin-net/redis-adapter","owner":"casbin-net","description":"Redis adapter for Casbin.NET","archived":false,"fork":false,"pushed_at":"2023-04-01T09:11:42.000Z","size":38,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-05T17:25:57.224Z","etag":null,"topics":["abac","acl","adapter","auth","authorization","authz","casbin","casbin-net","csharp","dotnet","rbac","redis"],"latest_commit_sha":null,"homepage":"https://github.com/casbin/Casbin.NET","language":"C#","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/casbin-net.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":"2022-07-03T09:01:57.000Z","updated_at":"2024-01-04T13:08:16.000Z","dependencies_parsed_at":"2024-05-07T00:45:54.787Z","dependency_job_id":null,"html_url":"https://github.com/casbin-net/redis-adapter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin-net%2Fredis-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin-net%2Fredis-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin-net%2Fredis-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin-net%2Fredis-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casbin-net","download_url":"https://codeload.github.com/casbin-net/redis-adapter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225712747,"owners_count":17512475,"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":["abac","acl","adapter","auth","authorization","authz","casbin","casbin-net","csharp","dotnet","rbac","redis"],"created_at":"2024-08-04T17:00:57.773Z","updated_at":"2024-11-21T10:30:49.533Z","avatar_url":"https://github.com/casbin-net.png","language":"C#","funding_links":[],"categories":["C# #"],"sub_categories":[],"readme":"# Casbin.NET Redis Adapter\r\n\r\n[![Actions Status](https://github.com/casbin-net/Redis-Adapter/workflows/Build/badge.svg)](https://github.com/casbin-net/Redis-Adapter/actions)\r\n[![Coverage Status](https://coveralls.io/repos/github/casbin-net/Redis-Adapter/badge.svg?branch=master)](https://coveralls.io/github/casbin-net/Redis-Adapter?branch=master)\r\n[![NuGet](https://buildstats.info/nuget/Casbin.NET.Adapter.Redis)](https://www.nuget.org/packages/Casbin.NET.Adapter.Redis)\r\n\r\nRedis Adapter is the [Redis](https://redis.io/) adapter for [Casbin](https://github.com/casbin/casbin). With this library, Casbin can load policy from Redis or save policy to it.\r\n\r\n## Installation\r\n\r\n```\r\ndotnet add package Casbin.NET.Adapter.Redis\r\n```\r\n\r\n## Simple Example\r\n\r\n```csharp\r\nusing Casbin.Adapter.Redis;\r\nusing NetCasbin;\r\n\r\nnamespace ConsoleAppExample\r\n{\r\n    public class Program\r\n    {\r\n        public static void Main(string[] args)\r\n        {\r\n            // Initialize a Redis adapter and use it in a Casbin enforcer:\r\n            var redisAdapter = new RedisAdapter(\"localhost:6379\");\r\n            var e = new Enforcer(\"examples/rbac_model.conf\", redisAdapter);\r\n\r\n            // Load the policy from Redis.\r\n            e.LoadPolicy();\r\n\r\n            // Check the permission.\r\n            e.Enforce(\"alice\", \"data1\", \"read\");\r\n            \r\n            // Modify the policy.\r\n            // e.AddPolicy(...)\r\n            // e.RemovePolicy(...)\r\n    \r\n            // Save the policy back to Redis.[README.md](..%2Fcasbin-aspnetcore%2FREADME.md)\r\n            e.SavePolicy();\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n## Getting Help\r\n\r\n- [Casbin.NET](https://github.com/casbin/Casbin.NET)\r\n\r\n## License\r\n\r\nThis project is under Apache 2.0 License. See the [LICENSE](LICENSE) file for the full license text.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin-net%2Fredis-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasbin-net%2Fredis-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin-net%2Fredis-adapter/lists"}