{"id":17217561,"url":"https://github.com/lrstanley/chix","last_synced_at":"2025-10-09T04:33:18.038Z","repository":{"id":40251462,"uuid":"487468789","full_name":"lrstanley/chix","owner":"lrstanley","description":"helper middleware and functionality for go-chi/chi","archived":false,"fork":false,"pushed_at":"2025-10-01T05:03:06.000Z","size":336,"stargazers_count":43,"open_issues_count":10,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-01T07:06:46.316Z","etag":null,"topics":["authentication","go","go-chi","golang","helper","http","middleware"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/lrstanley/chix","language":"Go","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/lrstanley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":".github/SUPPORT.md","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},"funding":{"github":"lrstanley"}},"created_at":"2022-05-01T07:02:01.000Z","updated_at":"2025-09-08T02:05:52.000Z","dependencies_parsed_at":"2023-12-30T04:19:52.135Z","dependency_job_id":"3a52e532-0cd0-4b1c-85f7-4a52936fd87e","html_url":"https://github.com/lrstanley/chix","commit_stats":{"total_commits":174,"total_committers":5,"mean_commits":34.8,"dds":0.3448275862068966,"last_synced_commit":"e357d421d063d1f93f7d8c4d7aaace2151bf4400"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/lrstanley/chix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrstanley%2Fchix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrstanley%2Fchix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrstanley%2Fchix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrstanley%2Fchix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lrstanley","download_url":"https://codeload.github.com/lrstanley/chix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrstanley%2Fchix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000703,"owners_count":26082921,"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-10-09T02:00:07.460Z","response_time":59,"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":["authentication","go","go-chi","golang","helper","http","middleware"],"created_at":"2024-10-15T03:44:18.484Z","updated_at":"2025-10-09T04:33:18.032Z","avatar_url":"https://github.com/lrstanley.png","language":"Go","funding_links":["https://github.com/sponsors/lrstanley"],"categories":[],"sub_categories":[],"readme":"\u003c!-- template:define:options\n{\n  \"nodescription\": true\n}\n--\u003e\n![logo](https://liam.sh/-/gh/svg/lrstanley/chix?icon=logos%3Ago\u0026icon.height=65\u0026layout=left\u0026font=1.1\u0026icon.color=rgba%280%2C+0%2C+0%2C+1%29)\n\n\u003c!-- template:begin:header --\u003e\n\u003c!-- do not edit anything in this \"template\" block, its auto-generated --\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/lrstanley/chix/tags\"\u003e\n    \u003cimg title=\"Latest Semver Tag\" src=\"https://img.shields.io/github/v/tag/lrstanley/chix?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/lrstanley/chix/commits/master\"\u003e\n    \u003cimg title=\"Last commit\" src=\"https://img.shields.io/github/last-commit/lrstanley/chix?style=flat-square\"\u003e\n  \u003c/a\u003e\n\n\n\n\n  \u003ca href=\"https://github.com/lrstanley/chix/actions?query=workflow%3Atest+event%3Apush\"\u003e\n    \u003cimg title=\"GitHub Workflow Status (test @ master)\" src=\"https://img.shields.io/github/actions/workflow/status/lrstanley/chix/test.yml?branch=master\u0026label=test\u0026style=flat-square\"\u003e\n  \u003c/a\u003e\n\n\n\n  \u003ca href=\"https://codecov.io/gh/lrstanley/chix\"\u003e\n    \u003cimg title=\"Code Coverage\" src=\"https://img.shields.io/codecov/c/github/lrstanley/chix/master?style=flat-square\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://pkg.go.dev/github.com/lrstanley/chix\"\u003e\n    \u003cimg title=\"Go Documentation\" src=\"https://pkg.go.dev/badge/github.com/lrstanley/chix?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/lrstanley/chix\"\u003e\n    \u003cimg title=\"Go Report Card\" src=\"https://goreportcard.com/badge/github.com/lrstanley/chix?style=flat-square\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/lrstanley/chix/issues?q=is:open+is:issue+label:bug\"\u003e\n    \u003cimg title=\"Bug reports\" src=\"https://img.shields.io/github/issues/lrstanley/chix/bug?label=issues\u0026style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/lrstanley/chix/issues?q=is:open+is:issue+label:enhancement\"\u003e\n    \u003cimg title=\"Feature requests\" src=\"https://img.shields.io/github/issues/lrstanley/chix/enhancement?label=feature%20requests\u0026style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/lrstanley/chix/pulls\"\u003e\n    \u003cimg title=\"Open Pull Requests\" src=\"https://img.shields.io/github/issues-pr/lrstanley/chix?label=prs\u0026style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/lrstanley/chix/discussions/new?category=q-a\"\u003e\n    \u003cimg title=\"Ask a Question\" src=\"https://img.shields.io/badge/support-ask_a_question!-blue?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://liam.sh/chat\"\u003e\u003cimg src=\"https://img.shields.io/badge/discord-bytecord-blue.svg?style=flat-square\" title=\"Discord Chat\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003c!-- template:end:header --\u003e\n\n\u003c!-- template:begin:toc --\u003e\n\u003c!-- do not edit anything in this \"template\" block, its auto-generated --\u003e\n## :link: Table of Contents\n\n  - [Usage](#gear-usage)\n  - [Features](#sparkles-features)\n  - [Related Libraries](#zap-related-libraries)\n  - [Example Projects](#bulb-example-projects)\n  - [Support \u0026amp; Assistance](#raising_hand_man-support--assistance)\n  - [Contributing](#handshake-contributing)\n  - [License](#balance_scale-license)\n\u003c!-- template:end:toc --\u003e\n\n## :gear: Usage\n\n\u003c!-- template:begin:goget --\u003e\n\u003c!-- do not edit anything in this \"template\" block, its auto-generated --\u003e\n```console\ngo get -u github.com/lrstanley/chix@latest\n```\n\u003c!-- template:end:goget --\u003e\n\n## :sparkles: Features\n\n- `http.Server` wrapper that easily allows starting, and gracefully shutting\n  down your http server, and other background services, using `errgroup`.\n- RealIP middleware (supports whitelisting specific proxies, rather than allowing\n  any source).\n- private IP middleware, restricting endpoints to be internal only.\n- Rendering helpers:\n  - `JSON` (with `?pretty=true` support).\n- Auth middleware:\n  - Uses [markbates/goth](https://github.com/markbates/goth) to support many\n    different providers.\n  - Encrypts session cookies, which removes the need for local session storage.\n  - Uses Go 1.18's generics functionality to provide a custom ID and auth object\n    resolver.\n    - No longer have to type assert to your local models!\n  - Optionally requiring authentication.\n  - Optionally requiring specific roles.\n  - Optionally adding authentication info to context for use by children handlers.\n  - API key validation.\n  - API version validation.\n- Struct/type binding, from get/post data, with support for [go-playground/validator](https://github.com/go-playground/validator).\n- Structured logging using [apex/log](https://github.com/apex/log) (same API\n  as logrus).\n  - Allows injecting additional metadata into logs.\n  - Injects logger into context for use by children handlers.\n- Debug middleware:\n  - Easily let children handlers know if global debug flags are enabled.\n  - Allows masking errors, unless debugging is enabled.\n- Error handler, that automatically handles api-vs-static content responses.\n  - Supports `ErrorResolver`'s, providing the ability to override status codes\n    for specific types of errors.\n- `go:embed` helpers for mounting an embedded filesystem seamlessly as an http\n  endpoint.\n  - Useful for projects that bundle their frontend assets in their binary.\n  - Supports local filesystem reading, when debugging is enabled (TODO).\n- Middleware for robots.txt and security.txt responding.\n\n## :zap: Related Libraries\n\n- [lrstanley/clix](https://github.com/lrstanley/clix) -- go-flags wrapper, that\n  handles parsing and decoding, with additional helpers.\n- [lrstanley/go-query-parser](https://github.com/lrstanley/go-queryparser) -- similar\n  to that of Google/Github/etc search, a query string parser that allows filters\n  and tags to be dynamically configured by the end user.\n\n## :bulb: Example Projects\n\nUse these as a reference point for how you might use some of the functionality within\nthis library, or how you might want to structure your applications.\n\n- [lrstanley/geoip](https://github.com/lrstanley/geoip)\n- [lrstanley/liam.sh](https://github.com/lrstanley/liam.sh)\n- [lrstanley/spectrograph](https://github.com/lrstanley/spectrograph)\n\n\u003c!-- template:begin:support --\u003e\n\u003c!-- do not edit anything in this \"template\" block, its auto-generated --\u003e\n## :raising_hand_man: Support \u0026 Assistance\n\n* :heart: Please review the [Code of Conduct](.github/CODE_OF_CONDUCT.md) for\n     guidelines on ensuring everyone has the best experience interacting with\n     the community.\n* :raising_hand_man: Take a look at the [support](.github/SUPPORT.md) document on\n     guidelines for tips on how to ask the right questions.\n* :lady_beetle: For all features/bugs/issues/questions/etc, [head over here](https://github.com/lrstanley/chix/issues/new/choose).\n\u003c!-- template:end:support --\u003e\n\n\u003c!-- template:begin:contributing --\u003e\n\u003c!-- do not edit anything in this \"template\" block, its auto-generated --\u003e\n## :handshake: Contributing\n\n* :heart: Please review the [Code of Conduct](.github/CODE_OF_CONDUCT.md) for guidelines\n     on ensuring everyone has the best experience interacting with the\n    community.\n* :clipboard: Please review the [contributing](.github/CONTRIBUTING.md) doc for submitting\n     issues/a guide on submitting pull requests and helping out.\n* :old_key: For anything security related, please review this repositories [security policy](https://github.com/lrstanley/chix/security/policy).\n\u003c!-- template:end:contributing --\u003e\n\n\u003c!-- template:begin:license --\u003e\n\u003c!-- do not edit anything in this \"template\" block, its auto-generated --\u003e\n## :balance_scale: License\n\n```\nMIT License\n\nCopyright (c) 2022 Liam Stanley \u003cliam@liam.sh\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n_Also located [here](LICENSE)_\n\u003c!-- template:end:license --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flrstanley%2Fchix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flrstanley%2Fchix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flrstanley%2Fchix/lists"}