{"id":19298215,"url":"https://github.com/casbin/etcd-watcher","last_synced_at":"2026-01-16T07:19:44.323Z","repository":{"id":45698517,"uuid":"108668797","full_name":"casbin/etcd-watcher","owner":"casbin","description":"Etcd watcher for Casbin","archived":false,"fork":false,"pushed_at":"2026-01-13T17:38:38.000Z","size":54,"stargazers_count":171,"open_issues_count":0,"forks_count":21,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-13T18:39:50.770Z","etag":null,"topics":["access-control","authorization","casbin","etcd","watcher"],"latest_commit_sha":null,"homepage":"https://github.com/casbin/casbin","language":"Go","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.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},"funding":{"github":"casbin"}},"created_at":"2017-10-28T17:18:02.000Z","updated_at":"2026-01-13T17:37:53.000Z","dependencies_parsed_at":"2024-03-25T09:21:05.920Z","dependency_job_id":"64a367c9-218b-402c-9b52-6b08fc7d7088","html_url":"https://github.com/casbin/etcd-watcher","commit_stats":{"total_commits":24,"total_committers":12,"mean_commits":2.0,"dds":0.5833333333333333,"last_synced_commit":"ace56e7aa15421d829fbdafdb3a045d0daeaa8d5"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/casbin/etcd-watcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fetcd-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fetcd-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fetcd-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fetcd-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casbin","download_url":"https://codeload.github.com/casbin/etcd-watcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fetcd-watcher/sbom","scorecard":{"id":267041,"data":{"date":"2025-08-11","repo":{"name":"github.com/casbin/etcd-watcher","commit":"ace56e7aa15421d829fbdafdb3a045d0daeaa8d5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"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":"Code-Review","score":5,"reason":"Found 11/22 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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/casbin/etcd-watcher/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/casbin/etcd-watcher/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/casbin/etcd-watcher/test.yml/master?enable=pin","Warn: goCommand not pinned by hash: .github/workflows/test.yml:36","Warn: npmCommand not pinned by hash: .github/workflows/test.yml:52","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned","Info:   0 out of   1 goCommand dependencies pinned"],"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: 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":"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":"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 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"}}]},"last_synced_at":"2025-08-17T12:21:22.588Z","repository_id":45698517,"created_at":"2025-08-17T12:21:22.588Z","updated_at":"2025-08-17T12:21:22.588Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"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":["access-control","authorization","casbin","etcd","watcher"],"created_at":"2024-11-09T23:07:16.562Z","updated_at":"2026-01-16T07:19:44.310Z","avatar_url":"https://github.com/casbin.png","language":"Go","funding_links":["https://github.com/sponsors/casbin"],"categories":[],"sub_categories":[],"readme":"Etcd Watcher\n====\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/casbin/etcd-watcher)](https://goreportcard.com/report/github.com/casbin/etcd-watcher)\n[![Go](https://github.com/casbin/etcd-watcher/actions/workflows/ci.yml/badge.svg)](https://github.com/casbin/etcd-watcher/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/casbin/etcd-watcher/badge.svg?branch=master)](https://coveralls.io/github/casbin/etcd-watcher?branch=master)\n[![Go Reference](https://pkg.go.dev/badge/github.com/casbin/etcd-watcher/v2.svg)](https://pkg.go.dev/github.com/casbin/etcd-watcher/v2)\n[![Release](https://img.shields.io/github/release/casbin/etcd-watcher.svg)](https://github.com/casbin/etcd-watcher/releases/latest)\n[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord\u0026label=discord\u0026color=5865F2)](https://discord.gg/S5UjpzGZjN)\n[![Sourcegraph](https://sourcegraph.com/github.com/casbin/etcd-watcher/-/badge.svg)](https://sourcegraph.com/github.com/casbin/etcd-watcher?badge)\n\nEtcd Watcher is the [Etcd](https://github.com/coreos/etcd) watcher for [Casbin](https://github.com/casbin/casbin). With this library, Casbin can synchronize the policy with the database in multiple enforcer instances.\n\n## Installation\n\n    go get github.com/casbin/etcd-watcher/v2\n\n## Simple Example\n\n```go\npackage main\n\nimport (\n    \"log\"\n\n    casbin \"github.com/casbin/casbin/v2\"\n    etcdwatcher \"github.com/casbin/etcd-watcher/v2\"\n)\n\nfunc updateCallback(rev string) {\n    log.Println(\"New revision detected:\", rev)\n}\n\nfunc main() {\n    // Initialize the watcher.\n    // Use the endpoint of etcd cluster as parameter.\n    w, _ := etcdwatcher.NewWatcher([]string{\"http://127.0.0.1:2379\"}, \"keyname\")\n    \n    // Initialize the enforcer.\n    e, _ := casbin.NewEnforcer(\"examples/rbac_model.conf\", \"examples/rbac_policy.csv\")\n    \n    // Set the watcher for the enforcer.\n    e.SetWatcher(w)\n    \n    // By default, the watcher's callback is automatically set to the\n    // enforcer's LoadPolicy() in the SetWatcher() call.\n    // We can change it by explicitly setting a callback.\n    w.SetUpdateCallback(updateCallback)\n    \n    // Update the policy to test the effect.\n    // You should see \"[New revision detected: X]\" in the log.\n    e.SavePolicy()\n}\n```\n\n## Simple Example（Configuration Mode）\n\n```go\npackage main\n\nimport (\n    \"log\"\n\n    casbin \"github.com/casbin/casbin/v2\"\n    etcdwatcher \"github.com/casbin/etcd-watcher/v2\"\n)\n\nfunc updateCallback(rev string) {\n    log.Println(\"New revision detected:\", rev)\n}\n\nfunc main() {\n    // Initialize the watcher.\n    // Use the configuration file as the parameter\n\tw, _ := etcdwatcher.NewWatcherWithConfig(etcdwatcher.WatcherConfig{\n\t\tHosts: []string{\"http://127.0.0.1:2379\"},\n\t\tKey:   \"/casbin\",\n\t\tUser:  \"root\",\n\t\tPass:  \"123\",\n\t})\n    \n    // Initialize the enforcer.\n    e, _ := casbin.NewEnforcer(\"examples/rbac_model.conf\", \"examples/rbac_policy.csv\")\n    \n    // Set the watcher for the enforcer.\n    e.SetWatcher(w)\n    \n    // By default, the watcher's callback is automatically set to the\n    // enforcer's LoadPolicy() in the SetWatcher() call.\n    // We can change it by explicitly setting a callback.\n    w.SetUpdateCallback(updateCallback)\n    \n    // Update the policy to test the effect.\n    // You should see \"[New revision detected: X]\" in the log.\n    e.SavePolicy()\n}\n```\n\n## Getting Help\n\n- [Casbin](https://github.com/casbin/casbin)\n\n## License\n\nThis project is under Apache 2.0 License. See the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Fetcd-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasbin%2Fetcd-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Fetcd-watcher/lists"}