{"id":51982985,"url":"https://github.com/ilyako/side-auth","last_synced_at":"2026-07-30T15:01:58.946Z","repository":{"id":373246421,"uuid":"1297451338","full_name":"IlyaKo/side-auth","owner":"IlyaKo","description":".NET library that secures technical and DevOps endpoints without deploying heavy identity systems","archived":false,"fork":false,"pushed_at":"2026-07-26T15:43:18.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-26T16:07:40.643Z","etag":null,"topics":["api-key-authentication","aspnet","authentication","authorization","basic-auth","minimal-api"],"latest_commit_sha":null,"homepage":"https://nuget.org/packages/IlyaKo.AspNet.SideAuth","language":"C#","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/IlyaKo.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,"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":"2026-07-11T13:06:24.000Z","updated_at":"2026-07-26T15:39:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/IlyaKo/side-auth","commit_stats":null,"previous_names":["ilyako/side-auth"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/IlyaKo/side-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaKo%2Fside-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaKo%2Fside-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaKo%2Fside-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaKo%2Fside-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IlyaKo","download_url":"https://codeload.github.com/IlyaKo/side-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaKo%2Fside-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36081757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-30T02:00:05.956Z","response_time":106,"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":["api-key-authentication","aspnet","authentication","authorization","basic-auth","minimal-api"],"created_at":"2026-07-30T15:01:58.170Z","updated_at":"2026-07-30T15:01:58.939Z","avatar_url":"https://github.com/IlyaKo.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SideAuth\n\n`SideAuth` is a library for ASP.NET Core designed to help developers protect specific Minimal API endpoints with HTTP Basic Authentication or API Keys using minimal configuration.\n\nWhile operational endpoints—such as OpenAPI/Swagger/Scalar specifications, Prometheus metrics, or health checks—are typically restricted or excluded from production environments, certain deployment scenarios require them to remain accessible but protected. This library allows developers to secure these specific routes with a few lines of code directly during endpoint mapping.\n\n## Usage\n\n### 1. Install package\n\n```bash\ndotnet add package IlyaKo.AspNet.SideAuth\n```\n\n### 2. Register services\n```csharp\nservices.AddBasicSideAuth(\"admin\", \"SecurePassword123\");\nservices.AddApiKeySideAuth(\"prometheus-token\");\n```\n\n### 3. Configure pipeline\n```csharp\napp.MapOpenApi().RequireBasicSideAuth();\napp.MapScalarApiReference().RequireBasicSideAuth();\napp.MapGet(\"/todos\", async (ITodoService service) =\u003e await service.GetAll());\napp.MapGet(\"/todos/{id:int}\", async (int id, ITodoService service) =\u003e await service.GetByIdAsync(id));\napp.MapGet(\"/metrics\", () =\u003e \"Metrics data\").RequireApiKeySideAuth();\napp.MapGet(\"/healthz\", () =\u003e \"Healthy\").RequireAnySideAuth();\n```\n\n### Result\n\nBased on the configuration above:\n* **OpenAPI specifications** and **Scalar UI** require HTTP Basic Authentication (`admin` / `SecurePassword123`)\n* **`/metrics`** requires `prometheus-token` passed in the default `X-API-Key` header\n* **`/healthz`** accepts either HTTP Basic Authentication or the API Key\n* **`/todo`** endpoints remain public\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filyako%2Fside-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filyako%2Fside-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filyako%2Fside-auth/lists"}