{"id":13521030,"url":"https://github.com/quarkiverse/quarkus-authzed-client","last_synced_at":"2026-04-02T00:12:36.539Z","repository":{"id":65513273,"uuid":"539140635","full_name":"quarkiverse/quarkus-authzed-client","owner":"quarkiverse","description":"An extension for connecting to authzed instances from Quarkus applications","archived":false,"fork":false,"pushed_at":"2025-04-02T13:20:34.000Z","size":1697,"stargazers_count":6,"open_issues_count":10,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-03T00:24:49.260Z","etag":null,"topics":["authzed","fga","quarkus-extension"],"latest_commit_sha":null,"homepage":"https://docs.authzed.com/reference/api","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/quarkiverse.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-20T18:40:58.000Z","updated_at":"2025-03-24T21:14:48.000Z","dependencies_parsed_at":"2024-06-25T00:47:23.802Z","dependency_job_id":"6154df52-16ca-44fa-9183-c965d47a6131","html_url":"https://github.com/quarkiverse/quarkus-authzed-client","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkiverse%2Fquarkus-authzed-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkiverse%2Fquarkus-authzed-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkiverse%2Fquarkus-authzed-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarkiverse%2Fquarkus-authzed-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quarkiverse","download_url":"https://codeload.github.com/quarkiverse/quarkus-authzed-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250572400,"owners_count":21452329,"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":["authzed","fga","quarkus-extension"],"created_at":"2024-08-01T06:00:26.697Z","updated_at":"2026-04-02T00:12:31.494Z","avatar_url":"https://github.com/quarkiverse.png","language":"Java","funding_links":[],"categories":["Clients"],"sub_categories":["Third-party Libraries"],"readme":"# Quarkus - Authzed Client\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\nAn early draft of quarkus extension for https://github.com/authzed/authzed-java\n\n## Usage\n\nTo use the client add the following dependency to the pom.xml\n\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.quarkiverse.authzed\u003c/groupId\u003e\n    \u003cartifactId\u003equarkus-authzed-client\u003c/artifactId\u003e\n\u003c/dependency\u003e\n\n```\n\n### Injecting the client\n\nTo inject the client into your code:\n\n```java\n@Inject\nprivate AuthzedClient client;\n```\n\nThen the client can be used like this:\n\n```java\nUni\u003cReadSchemaResponse\u003e response = client.v1().schemaService().readSchema(ReadSchemaRequest.newBuilder().build());\n//To actually invoke the request you need to subscribe / wait on the Uni:\nSystem.out.println(response.await().indefinitely().getSchemaText());\n```\n\n**Note**: The request will not be executed until you subscribe or wait on the Uni.\n\n#### Unifies imperative and reactive \n\nWith Quarkus supporting both imperative and reactive styles it made sense to expose both the blocking and the reactive stubs.\nGiven the Quarkus favor Mutiny for reactive programming it made sense to generate everyting from scratch using the `quarkus-grpc` extension.\nThis means that https://github.com/authzed/authzed-java is not directly used in this project.\n\nIf you want to access the blocking aspect of the client instead of using `Mutiny` you can:\n\n```java\nBlockingAuthzedClinet blockingClient = client.blocking();\n```\n\nBoth client's have access to exactly the same rpc methods.\nThe following doc will focus on the `Mutiny` apsect of the client.\nWorth's mentioning that this client provides a thin layer / dsl on top of what's generated by `grpc`, so most of the documentaion found on https://docs.authzed.com/ apply here too.\n\n### Writing the schema\n\nProvided that the schema is stored in a `String` variable called `schema`:\n\n```java\nUni\u003cWriteSchemaResponse\u003e writeSchemaResponse = client.v1()\n    .schemaService()\n    .writeSchema(WriteSchemaRequest.newBuilder().setSchema(schema).build());\n\n//Wait for the reponse\nwriteSchemaResponse.await().indefinitely();\n\n```\n\nAn example schma:\n```\ndefinition user {}\ndefinition document {\n  relation view: user\n  relation write: user\n}\n```\n\n### Reading the schema\n```java\nUni\u003cReadSchemaResponse\u003e response = client.v1().schemaService().readSchema(ReadSchemaRequest.newBuilder().build());\nresponse.subscribe().with(r -\u003e System.out.println(\"schema:\\n\" +r.getSchemaText()));\n```\n\n### Creating relationships\n\n```java\nUni\u003cWriteRelationshipsResponse\u003e writeRelationshipRespone = client.v1().permissionService()\n    .writeRelationships(WriteRelationshipsRequest.newBuilder()\n        .addUpdates(RelationshipUpdate.newBuilder()\n            .setOperation(Operation.OPERATION_CREATE)\n            .setRelationship(Tuples.parseRelationship(\"document:cv#view@user:somegal\"))\n        .build())\n    .build());\n\n```\n\n### Checking permissions\n\n```java\nConsistency full = Consistency.newBuilder().setFullyConsistent(true).build();\nUni\u003cCheckPermissionResponse\u003e checkPermissionResponse = client.v1().permissionService()\n    .checkPermission(CheckPermissionRequest.newBuilder()\n        .setConsistency(full)\n        .setSubject(Tuples.parseUser(\"user:somegal\"))\n        .setResource(Tuples.parseObject(\"document:cv\"))\n        .setPermission(\"view\")\n        .build());\n\nresponse.map(r -\u003e r.getPermissionship().getNumber()).subscribe().with(n -\u003e {\n    switch (n) {\n       case Permissionship.PERMISSIONSHIP_HAS_PERMISSION_VALUE:\n           System.out.println(\"Has permission.\");\n           break;\n       default:\n           System.out.println(\"No permission!\");\n    }\n});\n\n```\n\nAn alternative way to process the response in a less async way is to `wait` on the `Uni`:\n\n```java\nPermissionship p = checkPermissionResponse().wait().indefinitely().getPermissionship();\np == Permissionship.PERMISSIONSHIP_HAS_PERMISSION \n    ? System.out.println(\"Has permission.\");\n    : System.out.println(\"No permission!\");\n\n```\n\n**Note**: In this example we used `full` consistency to avoid getting back cached values. An alternative would be to use zed token as described: https://docs.authzed.com/guides/first-app#checking-permissions\n\n## Configuration Reference\n\nSee the [configuration reference](docs/config/quarkus-authzed.adoc) for the full list of supported configuration options.\n\n## Compatibility\n\nThe table below specifies the `Authzed Client` version that used for each `Quarkus Authzed Client Extension`.\n**Note**: The table only includes the versions that contained a change in the `Authzed Client` version.\n\n| Quarkus Authzed Client Extension Versions | Authzed Client Version |\n|-------------------------------------------|------------------------|\n| 0.0.1                                     | v.12.0                 |\n| 0.1.0                                     | v.15.0                 |\n\n## Credits\nHeavily influeced by Kevin Wotten's (kdubb) work on https://github.com/quarkiverse/quarkus-openfga-client\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/kdubb\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/787655?v=4?s=100\" width=\"100px;\" alt=\"Kevin Wooten\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKevin Wooten\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/quarkiverse/quarkus-authzed-client/commits?author=kdubb\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#maintenance-kdubb\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://iocanel.blogspot.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/402008?v=4?s=100\" width=\"100px;\" alt=\"Ioannis Canellos\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eIoannis Canellos\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/quarkiverse/quarkus-authzed-client/commits?author=iocanel\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#maintenance-iocanel\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquarkiverse%2Fquarkus-authzed-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquarkiverse%2Fquarkus-authzed-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquarkiverse%2Fquarkus-authzed-client/lists"}