{"id":14548512,"url":"https://github.com/authzed/authzed-dotnet","last_synced_at":"2025-04-23T20:32:26.208Z","repository":{"id":255705152,"uuid":"829137517","full_name":"authzed/authzed-dotnet","owner":"authzed","description":"Official SpiceDB client library for .NET","archived":false,"fork":false,"pushed_at":"2025-04-15T22:40:20.000Z","size":467,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-15T23:26:24.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/authzed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","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":"2024-07-15T20:49:56.000Z","updated_at":"2025-04-15T22:40:24.000Z","dependencies_parsed_at":"2024-11-13T20:22:10.328Z","dependency_job_id":"f551f320-46c9-46ae-8837-694ea2cca391","html_url":"https://github.com/authzed/authzed-dotnet","commit_stats":null,"previous_names":["authzed/authzed-dotnet"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authzed%2Fauthzed-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authzed%2Fauthzed-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authzed%2Fauthzed-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authzed%2Fauthzed-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/authzed","download_url":"https://codeload.github.com/authzed/authzed-dotnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250509845,"owners_count":21442508,"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":[],"created_at":"2024-09-06T12:01:26.264Z","updated_at":"2025-04-23T20:32:24.972Z","avatar_url":"https://github.com/authzed.png","language":"C#","funding_links":[],"categories":["Clients"],"sub_categories":["Official Libraries"],"readme":"# Authzed.Net\n[![Nuget](https://img.shields.io/nuget/v/Authzed.Net?color=%23006dad)](https://www.nuget.org/packages/Authzed.Net)\n[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)\n[![Build Status](https://github.com/authzed/authzed-dotnet/workflows/Test/badge.svg)](https://github.com/authzed/authzed-dotnet/actions)\n[![Mailing List](https://img.shields.io/badge/email-google%20groups-4285F4)](https://groups.google.com/g/authzed-oss)\n[![Discord Server](https://img.shields.io/badge/discord-spicedb-7289da?style=flat-square \"Discord Badge\")](https://discord.gg/spicedb)\n[![Twitter](https://img.shields.io/badge/twitter-@authzed-1d9bf0.svg?style=flat-square \"Twitter Badge\")](https://twitter.com/authzed)\n[![LinkedIn](https://img.shields.io/badge/linkedin-+authzed-2D65BC.svg?style=flat-square \"LinkedIn Badge\")](https://linkedin.com/company/authzed)\n\nThis repository houses the official .NET (generated in C#) client library for Authzed and SpiceDB.\n\n[Authzed] is a database and service that stores, computes, and validates your application's permissions.\n\nDevelopers create a schema that models their permissions requirements and use a client library, such as this one, to apply the schema to the database, insert data into the database, and query the data to efficiently check permissions in their applications.\n\nSupported client API versions:\n\n- [v1](https://docs.authzed.com/reference/api#authzedapiv1)\n\nYou can find more info on each API on the [Authzed API reference documentation].\nAdditionally, Protobuf API documentation can be found on the [Buf Registry Authzed API repository].\n\nSee [CONTRIBUTING.md] for instructions on how to contribute and perform common tasks like building the project and running tests.\n\n[Authzed]: https://authzed.com\n[Authzed API Reference documentation]: https://docs.authzed.com/reference/api\n[Buf Registry Authzed API repository]: https://buf.build/authzed/api/docs/main\n[CONTRIBUTING.md]: CONTRIBUTING.md\n\n[SpiceDB]: https://github.com/authzed/spicedb\n[Discord]: https://authzed.com/discord\n[Urgent]: https://github.com/authzed/authzed-rb/labels/priority%2F0%20urgent\n[High]: https://github.com/authzed/authzed-rb/labels/priority%2F1%20high\n[Medium]: https://github.com/authzed/authzed-rb/labels/priority%2F2%20medium\n[Low]: https://github.com/authzed/authzed-rb/labels/priority%2F3%20low\n[Maybe]: https://github.com/authzed/authzed-rb/labels/priority%2F4%20maybe\n[good first issues]: https://github.com/authzed-rb/spicedb/labels/hint%2Fgood%20first%20issue\n\n## Getting Started\n\nWe highly recommend following the **[Protecting Your First App]** guide to learn the latest best practice to integrate an application with Authzed.\n\nIf you're interested in example usages, including integration with a Kestrel API, they can be found in their respective folders in the [examples directory].\n\n[Protecting Your First App]: https://docs.authzed.com/guides/first-app\n[examples directory]: /examples\n\n## Basic Usage\n### Installation\n\nWith [`dotnet`](https://learn.microsoft.com/en-us/dotnet/core/install/):\n```sh\ndotnet add package Authzed.Net\n```\n\nWith [`nuget`](https://www.nuget.org/downloads):\n```sh\nnuget install Authzed.Net\n```\n\n### Initializing a Client\n\nCurrently, everything required to connect and make API calls is located in a module respective to API version.\n\nIn order to successfully connect, you will have to provide a [Bearer Token] with your own API Token from the [Authzed dashboard] in place of `t_your_token_here_1234567deadbeef` in the following example.\n\n[grpc]: https://grpc.io\n[Bearer Token]: https://datatracker.ietf.org/doc/html/rfc6750#section-2.1\n[Authzed Dashboard]: https://app.authzed.com\n\n```csharp\nusing Authzed.Api.V1;\nusing Grpc.Core;\nusing Grpc.Net.Client;\nusing System;\n\n// In some other block\nvar token = \"my super secret key\"\nvar credentials = CallCredentials.FromInterceptor((context, metadata) =\u003e\n{\n    metadata.Add(\"Authorization\", $\"Bearer {token}\");\n    return Task.CompletedTask;\n});\n\nvar options = new GrpcChannelOptions\n{\n    Credentials = ChannelCredentials.Create(new SslCredentials(), credentials),\n};\nvar channel = GrpcChannel.ForAddress(\"https://my.spicedb.service:50051\", options);\nvar client = new PermissionsService.PermissionsServiceClient(channel);\n```\n\nNote that the above example shows the Permission client specifically; a fully working flow will also require the Schema service.\n\nAlso note that we're using TLS. For an example that does not use TLS, see the API in the [examples directory].\n\n### Performing an API Request\n```csharp\nusing Authzed.Api.V1;\nusing Grpc.Core;\nusing Google.Protobuf.WellKnownTypes;\n\n// Continuing from above\nvar response = await client.CheckPermissionAsync(new CheckPermissionRequest\n{\n    Resource = new ObjectReference { ObjectType = \"post\", ObjectId = \"post-one\" },\n    Permission = \"view\",\n    Subject = new SubjectReference\n    {\n        Object = new ObjectReference\n        {\n            ObjectType = \"user\",\n            ObjectId = \"emilia\"\n        }\n    },\n    Consistency = new Consistency { FullyConsistent = true }\n});\nConsole.WriteLine(response.Permissionship)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthzed%2Fauthzed-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauthzed%2Fauthzed-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthzed%2Fauthzed-dotnet/lists"}