{"id":13521047,"url":"https://github.com/alsbury/chiphpotle-rest","last_synced_at":"2025-08-29T05:03:55.962Z","repository":{"id":59404429,"uuid":"537116781","full_name":"alsbury/chiphpotle-rest","owner":"alsbury","description":"Library to interact SpiceDB REST API","archived":false,"fork":false,"pushed_at":"2025-05-02T15:14:15.000Z","size":287,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-08T19:53:52.331Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alsbury.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-09-15T16:37:01.000Z","updated_at":"2025-05-02T15:14:19.000Z","dependencies_parsed_at":"2025-03-31T20:32:35.633Z","dependency_job_id":"70d1d693-e57c-4fe2-bb4e-0c0475ed6d11","html_url":"https://github.com/alsbury/chiphpotle-rest","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"aaf797c3e85cc8d4295faee7be86c6b72d302fd1"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/alsbury/chiphpotle-rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alsbury%2Fchiphpotle-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alsbury%2Fchiphpotle-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alsbury%2Fchiphpotle-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alsbury%2Fchiphpotle-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alsbury","download_url":"https://codeload.github.com/alsbury/chiphpotle-rest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alsbury%2Fchiphpotle-rest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272631632,"owners_count":24967104,"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","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"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":[],"created_at":"2024-08-01T06:00:27.135Z","updated_at":"2025-08-29T05:03:55.922Z","avatar_url":"https://github.com/alsbury.png","language":"PHP","funding_links":[],"categories":["Clients"],"sub_categories":["Third-party Libraries"],"readme":"# Chiphpotle\n\n## PHP REST API Client for SpiceDB\n\n[SpiceDB](https://github.com/authzed/spicedb) is a database for creating and managing security-critical application permissions.\nChiphpotle is a PHP client for their rest API. For more information, please visit [https://github.com/authzed/api](https://github.com/authzed/api).\n\n## Requirements\n\nSupports PHP 8.1 and newer, and supports SpiceDB 1.30 and above.\n\n## Installation with Composer\n\n```shell\ncomposer require alsbury/chiphpotle-rest\n```\n\n## Getting Started\n\n### Initialize Client\n\n```php\n\u003c?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n$apiClient = Client::create('http://spicedb:8443/', 'mysecret');\n\n$request = new CheckPermissionRequest(\n    ObjectReference::create('user', 'bob'),\n    'view',\n    SubjectReference::create('document', 'topsecret1'),\n);\ntry {\n    $response = $apiClient-\u003echeckPermission($request);\n    if ($response-\u003egetPermissionship() == Permissionship::HAS_PERMISSION) {\n        echo 'You may Pass!'\n    }\n} catch (Exception $e) {\n    echo 'Exception when calling PermissionsServiceApi-\u003epermissionsServiceCheckPermission: ', $e-\u003egetMessage(), PHP_EOL;\n}\n```\n\n## Experimental APIs\n\nIncluded in the client are three experimental APIs. Though SpiceDB advertised these APIs im 1.25 and earlier,\nthey did not work in the http gateway. This had been fixed, in versions 1.26 and above. In SpiceDB 1.30 the check bulk\npermissions graduated and the experimental api was deprecated.\n\n## Tests\n\ncopy .env.dist to .env and adjust the BASE_URL and API_KEY. Spicedb must be running on the url specified, \nwe recommend running using the [serve-testing](https://authzed.com/docs/guides/validation-and-testing#testing-code-against-spicedb) mode.\n\n\nTo run the tests, start use:\n\n```bash\ncomposer install\nspicedb serve-testing --http-enabled\nvendor/bin/phpunit\n```\n\n## Code Generation\n\nThis client was created by starting with an auto-generated client from the open-api json schema provided by spicedb using [jane-openapi](https://jane.readthedocs.io/en/latest/documentation/OpenAPI.html).\n\nOnce SpiceDB is running, you can regenerate all the classes and client to pick up any new spicedb apis by running:\n\n```bash\nvendor/bin/jane-openapi generate\n```\n\nThis generates the client in a generated directory which then can be cleaned up and moved over to the src directory.\nTo get a good start run PHP CS Fixer to format things more consistently.\n\n```bash\nvendor/bin/php-cs-fixer fix\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falsbury%2Fchiphpotle-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falsbury%2Fchiphpotle-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falsbury%2Fchiphpotle-rest/lists"}