{"id":21252627,"url":"https://github.com/jcasbin/redis-watcher-ex","last_synced_at":"2026-02-06T02:31:34.514Z","repository":{"id":182857435,"uuid":"650753098","full_name":"jcasbin/redis-watcher-ex","owner":"jcasbin","description":"Redis WatcherEx for jCasbin","archived":false,"fork":false,"pushed_at":"2024-10-02T09:14:19.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T03:56:10.648Z","etag":null,"topics":["abac","acl","auth","authorization","authz","casbin","java","jcasbin","rbac","redis","watcher","watcherex"],"latest_commit_sha":null,"homepage":"https://github.com/casbin/jcasbin","language":"Java","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/jcasbin.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}},"created_at":"2023-06-07T18:25:18.000Z","updated_at":"2024-10-02T09:14:24.000Z","dependencies_parsed_at":"2023-07-21T22:04:34.875Z","dependency_job_id":"926d3ffb-261d-425b-9a48-a35725a816f5","html_url":"https://github.com/jcasbin/redis-watcher-ex","commit_stats":null,"previous_names":["jcasbin/redis-watcher-ex"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jcasbin/redis-watcher-ex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcasbin%2Fredis-watcher-ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcasbin%2Fredis-watcher-ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcasbin%2Fredis-watcher-ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcasbin%2Fredis-watcher-ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcasbin","download_url":"https://codeload.github.com/jcasbin/redis-watcher-ex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcasbin%2Fredis-watcher-ex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29145832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T01:13:33.096Z","status":"online","status_checked_at":"2026-02-06T02:00:08.092Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["abac","acl","auth","authorization","authz","casbin","java","jcasbin","rbac","redis","watcher","watcherex"],"created_at":"2024-11-21T03:48:09.292Z","updated_at":"2026-02-06T02:31:34.481Z","avatar_url":"https://github.com/jcasbin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Redis WatcherEx\n====\n\n[![build](https://github.com/jcasbin/redis-watcher-ex/actions/workflows/ci.yml/badge.svg)](https://github.com/jcasbin/redis-waycher-ex/actions/workflows/ci.yml)\n[![Maven Central](https://img.shields.io/maven-central/v/org.casbin/jcasbin-redis-watcher-ex.svg)](https://central.sonatype.com/artifact/org.casbin/jcasbin-redis-watcher-ex)\n\n---\n## Installation\nFor Maven:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.casbin\u003c/groupId\u003e\n    \u003cartifactId\u003ejcasbin-redis-watcher-ex\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n## Simple Example\n\n```java\npackage org.casbin.watcherEx;\n\nimport io.lettuce.core.RedisURI;\nimport org.casbin.jcasbin.main.Enforcer;\n\n\npublic class Main {\n\n    public static void main(String[] args) {\n        // Initialize the RedisWatcher.\n        // Use the Redis host and port as parameters.\n        WatcherOptions options = new WatcherOptions();\n        options.setChannel(\"jcasbin-channel\");\n        options.setOptions(RedisURI.builder().withHost(\"your ip\").withPort(6379).build());\n\n        RedisWatcherEx redisWatcherEx = new RedisWatcherEx(options);\n        \n        // Set the update callback.\n        redisWatcherEx.setUpdateCallback((msg) -\u003e{\n            System.out.println(msg);\n        });\n\n        // Initialize the JCasbin enforcer.\n        Enforcer enforcer = new Enforcer(\"examples/rbac_model.conf\", \"examples/rbac_policy.csv\");\n        // Set the watcher for the enforcer.\n        enforcer.setWatcher(redisWatcherEx);\n\n        // Update the policy to test the effect.\n        // You should see \"[casbin rules updated]\" in the log.\n        enforcer.savePolicy();\n\n        // Only exists in test (Wait for input to keep the program running)\n        Scanner scanner = new Scanner(System.in);\n        scanner.nextLine();\n    }\n}\n```\n\n## Getting Help\n\n- [jCasbin](https://github.com/casbin/jcasbin)\n\n## License\n\nThis project is under Apache 2.0 License. See the [LICENSE](LICENSE) file for the full license text.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcasbin%2Fredis-watcher-ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcasbin%2Fredis-watcher-ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcasbin%2Fredis-watcher-ex/lists"}