{"id":19298204,"url":"https://github.com/casbin/protobuf-adapter","last_synced_at":"2025-04-22T09:32:12.531Z","repository":{"id":53381869,"uuid":"95630297","full_name":"casbin/protobuf-adapter","owner":"casbin","description":"Google Protocol Buffers adapter for Casbin ","archived":false,"fork":false,"pushed_at":"2023-08-06T13:56:54.000Z","size":11,"stargazers_count":192,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T18:47:29.703Z","etag":null,"topics":["access-control","adapter","authorization","casbin","protobuf","storage-driver"],"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},"funding":{"github":"casbin"}},"created_at":"2017-06-28T05:02:09.000Z","updated_at":"2024-11-30T06:51:35.000Z","dependencies_parsed_at":"2023-09-26T09:09:02.664Z","dependency_job_id":null,"html_url":"https://github.com/casbin/protobuf-adapter","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"2ad91ee04525e3b2717f087c38c25a4b2aa74708"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fprotobuf-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fprotobuf-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fprotobuf-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fprotobuf-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casbin","download_url":"https://codeload.github.com/casbin/protobuf-adapter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997517,"owners_count":21195881,"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":["access-control","adapter","authorization","casbin","protobuf","storage-driver"],"created_at":"2024-11-09T23:07:15.326Z","updated_at":"2025-04-22T09:32:12.511Z","avatar_url":"https://github.com/casbin.png","language":"Go","funding_links":["https://github.com/sponsors/casbin"],"categories":[],"sub_categories":[],"readme":"Protobuf Adapter [![Build Status](https://travis-ci.org/casbin/protobuf-adapter.svg?branch=master)](https://travis-ci.org/casbin/protobuf-adapter) [![Coverage Status](https://coveralls.io/repos/github/casbin/protobuf-adapter/badge.svg?branch=master)](https://coveralls.io/github/casbin/protobuf-adapter?branch=master) [![Godoc](https://godoc.org/github.com/casbin/protobuf-adapter?status.svg)](https://godoc.org/github.com/casbin/protobuf-adapter)\n====\n\nProtobuf Adapter is the [Google Protocol Buffers](https://developers.google.com/protocol-buffers/) adapter for [Casbin](https://github.com/casbin/casbin). With this library, Casbin can load policy from Protocol Buffers or save policy to it.\n\n## Installation\n\n    go get github.com/casbin/protobuf-adapter\n\n## Simple Example\n\n```go\npackage main\n\nimport (\n\t\"github.com/casbin/casbin\"\n\t\"github.com/casbin/protobuf-adapter\"\n)\n\nfunc main() {\n\t// Initialize a Protobuf adapter and use it in a Casbin enforcer:\n\tb := []byte{} // b stores Casbin policy in Protocol Buffers.\n\ta := protobufadapter.NewProtobufAdapter(\u0026b) // Use b as the data source. \n\te := casbin.NewEnforcer(\"examples/rbac_model.conf\", a)\n\t\n\t// Load the policy from Protocol Buffers bytes b.\n\te.LoadPolicy()\n\t\n\t// Check the permission.\n\te.Enforce(\"alice\", \"data1\", \"read\")\n\t\n\t// Modify the policy.\n\t// e.AddPolicy(...)\n\t// e.RemovePolicy(...)\n\t\n\t// Save the policy back to Protocol Buffers bytes b.\n\te.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%2Fprotobuf-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasbin%2Fprotobuf-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Fprotobuf-adapter/lists"}