{"id":31190500,"url":"https://github.com/vurhanau/csharp-spiffe","last_synced_at":"2026-01-18T09:04:34.563Z","repository":{"id":229380231,"uuid":"732631332","full_name":"vurhanau/csharp-spiffe","owner":"vurhanau","description":"C# library for SPIFFE support","archived":false,"fork":false,"pushed_at":"2025-09-17T23:02:18.000Z","size":698,"stargazers_count":8,"open_issues_count":9,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-18T00:23:43.414Z","etag":null,"topics":["aspnetcore","authentication","authorization","csharp","dotnet","jwt","mtls","spiffe","spire","svid","tls","x509"],"latest_commit_sha":null,"homepage":"","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/vurhanau.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-17T10:34:32.000Z","updated_at":"2025-09-17T23:00:38.000Z","dependencies_parsed_at":"2025-01-09T23:28:36.595Z","dependency_job_id":"fa2afb4a-ec9c-4576-b8ca-f05ca494bfd0","html_url":"https://github.com/vurhanau/csharp-spiffe","commit_stats":null,"previous_names":["vurhanau/csharp-spiffe"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/vurhanau/csharp-spiffe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vurhanau%2Fcsharp-spiffe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vurhanau%2Fcsharp-spiffe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vurhanau%2Fcsharp-spiffe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vurhanau%2Fcsharp-spiffe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vurhanau","download_url":"https://codeload.github.com/vurhanau/csharp-spiffe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vurhanau%2Fcsharp-spiffe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275883252,"owners_count":25545495,"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-09-19T02:00:09.700Z","response_time":108,"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":["aspnetcore","authentication","authorization","csharp","dotnet","jwt","mtls","spiffe","spire","svid","tls","x509"],"created_at":"2025-09-19T21:07:06.677Z","updated_at":"2025-09-19T21:09:42.377Z","avatar_url":"https://github.com/vurhanau.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C# SPIFFE Library\n[![NuGet](https://img.shields.io/nuget/v/Spiffe.svg)](https://www.nuget.org/packages/Spiffe)\n[![Alert Status](https://sonarcloud.io/api/project_badges/measure?project=vurhanau_csharp-spiffe\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=vurhanau_csharp-spiffe)\n[![codecov](https://codecov.io/gh/vurhanau/csharp-spiffe/branch/main/graph/badge.svg?token=7T5FW25DYR)](https://codecov.io/gh/vurhanau/csharp-spiffe)\n\n## Overview\n\nThe C# SPIFFE library provides functionality to interact with the Workload API to fetch X.509 and JWT SVIDs and Bundles.\n\nC# implementation of [spiffe/go-spiffe](https://github.com/spiffe/go-spiffe).\n\nThis library requires .NET 8.0 or higher.\n\n[NuGet Package](https://www.nuget.org/packages/Spiffe/)\n\n## Quick Start\n\nStart [SPIRE](https://spiffe.io/spire/) or another SPIFFE Workload API\n   implementation.\n\nTo create an mTLS Kestrel server:\n\n```csharp\nWebApplicationBuilder builder = WebApplication.CreateBuilder();\nusing GrpcChannel channel = GrpcChannelFactory.CreateChannel(\"unix:///tmp/agent.sock\");\nIWorkloadApiClient client = WorkloadApiClient.Create(channel);\nusing X509Source x509Source = await X509Source.CreateAsync(client);\nbuilder.WebHost.UseKestrel(kestrel =\u003e\n{\n    kestrel.Listen(IPAddress.Any, 8443, listenOptions =\u003e\n    {\n        listenOptions.UseHttps(new TlsHandshakeCallbackOptions\n        {\n            // Configure mTLS server options\n            OnConnection = ctx =\u003e ValueTask.FromResult(\n                SpiffeSslConfig.GetMtlsServerOptions(x509Source, Authorizers.AuthorizeAny())),\n        });\n    });\n});\n```\n\nTo dial an mTLS server:\n\n```csharp\nGrpcChannel channel = GrpcChannelFactory.CreateChannel(\"unix:///tmp/agent.sock\");\nIWorkloadApiClient client = WorkloadApiClient.Create(channel);\nX509Source x509Source = await X509Source.CreateAsync(client);\nHttpClient http = new(new SocketsHttpHandler()\n{\n    // Configure mTLS client options\n    SslOptions = SpiffeSslConfig.GetMtlsClientOptions(x509Source, Authorizers.AuthorizeAny()),\n});\n```\n\nThe client and server obtain\n[X509-SVIDs](https://github.com/spiffe/spiffe/blob/main/standards/X509-SVID.md)\nand X.509 bundles from the [SPIFFE Workload\nAPI](https://github.com/spiffe/spiffe/blob/main/standards/SPIFFE_Workload_API.md).\nThe X509-SVIDs are presented by each peer and authenticated against the X.509\nbundles. Both sides continue to be updated with X509-SVIDs and X.509 bundles\nstreamed from the Workload API (e.g. secret rotation).\n\n## Examples\n\nThe [samples](https://github.com/vurhanau/csharp-spiffe/tree/main/samples) directory contains examples for a variety of circumstances.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvurhanau%2Fcsharp-spiffe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvurhanau%2Fcsharp-spiffe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvurhanau%2Fcsharp-spiffe/lists"}