{"id":51497034,"url":"https://github.com/yylego/kratos-static-auth","last_synced_at":"2026-07-07T16:30:31.945Z","repository":{"id":367902907,"uuid":"1179822232","full_name":"yylego/kratos-static-auth","owner":"yylego","description":"Static token authentication middleware with pre-configured username-token mapping","archived":false,"fork":false,"pushed_at":"2026-06-28T06:48:47.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-28T08:17:02.534Z","etag":null,"topics":["authentication","kratos","middleware","token-mapping"],"latest_commit_sha":null,"homepage":null,"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/yylego.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-03-12T12:18:55.000Z","updated_at":"2026-06-28T06:46:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/yylego/kratos-static-auth","commit_stats":null,"previous_names":["yylego/kratos-static-auth"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yylego/kratos-static-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yylego%2Fkratos-static-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yylego%2Fkratos-static-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yylego%2Fkratos-static-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yylego%2Fkratos-static-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yylego","download_url":"https://codeload.github.com/yylego/kratos-static-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yylego%2Fkratos-static-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35235814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-07T02:00:07.222Z","response_time":90,"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","kratos","middleware","token-mapping"],"created_at":"2026-07-07T16:30:31.164Z","updated_at":"2026-07-07T16:30:31.909Z","avatar_url":"https://github.com/yylego.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/yylego/kratos-static-auth/release.yml?branch=main\u0026label=BUILD)](https://github.com/yylego/kratos-static-auth/actions/workflows/release.yml?query=branch%3Amain)\n[![GoDoc](https://pkg.go.dev/badge/github.com/yylego/kratos-static-auth)](https://pkg.go.dev/github.com/yylego/kratos-static-auth)\n[![Coverage Status](https://img.shields.io/coveralls/github/yylego/kratos-static-auth/main.svg)](https://coveralls.io/github/yylego/kratos-static-auth?branch=main)\n[![Supported Go Versions](https://img.shields.io/badge/Go-1.25+-lightgrey.svg)](https://go.dev/)\n[![GitHub Release](https://img.shields.io/github/release/yylego/kratos-static-auth.svg)](https://github.com/yylego/kratos-static-auth/releases)\n[![Go Report Card](https://goreportcard.com/badge/github.com/yylego/kratos-static-auth)](https://goreportcard.com/report/github.com/yylego/kratos-static-auth)\n\n# kratos-static-auth\n\nStatic token authentication middleware with pre-configured username-token mapping.\n\n---\n\n\u003c!-- TEMPLATE (EN) BEGIN: LANGUAGE NAVIGATION --\u003e\n\n## CHINESE README\n\n[中文说明](README.zh.md)\n\n\u003c!-- TEMPLATE (EN) END: LANGUAGE NAVIGATION --\u003e\n\n## Main Features\n\n🗺️ **Token Mapping**: Pre-configured username-to-token map based authentication\n🔑 **Multiple Formats**: Supports simple tokens, Bearer tokens, and Base64 Basic Auth\n👤 **Username Injection**: Auto-injects authenticated username into request context\n📡 **APM Tracing**: Pluggable span hook integration via `authkratos.SpanHook`\n⚙️ **Route Scope**: Selective authentication based on route scope configuration\n\n## Installation\n\n```bash\ngo get github.com/yylego/kratos-static-auth\n```\n\n## Usage\n\n```go\nimport \"github.com/yylego/kratos-static-auth/statickratosauth\"\n\ntokens := map[string]string{\"admin\": \"secret-token-123\"}\ncfg := statickratosauth.NewConfig(routeScope, tokens).\n    WithSimpleEnable().\n    WithBearerEnable().\n    WithBase64Enable()\nmw := statickratosauth.NewMiddleware(cfg, logger)\n```\n\n---\n\n\u003c!-- TEMPLATE (EN) BEGIN: STANDARD PROJECT FOOTER --\u003e\n\u003c!-- VERSION 2025-11-25 03:52:28.131064 +0000 UTC --\u003e\n\n## 📄 License\n\nMIT License - see [LICENSE](LICENSE).\n\n---\n\n## 💬 Contact \u0026 Feedback\n\nContributions are welcome! Report bugs, suggest features, and contribute code:\n\n- 🐛 **Mistake reports?** Open an issue on GitHub with reproduction steps\n- 💡 **Fresh ideas?** Create an issue to discuss\n- 📖 **Documentation confusing?** Report it so we can improve\n- 🚀 **Need new features?** Share the use cases to help us understand requirements\n- ⚡ **Performance issue?** Help us optimize through reporting slow operations\n- 🔧 **Configuration problem?** Ask questions about complex setups\n- 📢 **Follow project progress?** Watch the repo to get new releases and features\n- 🌟 **Success stories?** Share how this package improved the workflow\n- 💬 **Feedback?** We welcome suggestions and comments\n\n---\n\n## 🔧 Development\n\nNew code contributions, follow this process:\n\n1. **Fork**: Fork the repo on GitHub (using the webpage UI).\n2. **Clone**: Clone the forked project (`git clone https://github.com/yourname/repo-name.git`).\n3. **Navigate**: Navigate to the cloned project (`cd repo-name`)\n4. **Branch**: Create a feature branch (`git checkout -b feature/xxx`).\n5. **Code**: Implement the changes with comprehensive tests\n6. **Testing**: (Golang project) Ensure tests pass (`go test ./...`) and follow Go code style conventions\n7. **Documentation**: Update documentation to support client-facing changes\n8. **Stage**: Stage changes (`git add .`)\n9. **Commit**: Commit changes (`git commit -m \"Add feature xxx\"`) ensuring backward compatible code\n10. **Push**: Push to the branch (`git push origin feature/xxx`).\n11. **PR**: Open a merge request on GitHub (on the GitHub webpage) with detailed description.\n\nPlease ensure tests pass and include relevant documentation updates.\n\n---\n\n## 🌟 Support\n\nWelcome to contribute to this project via submitting merge requests and reporting issues.\n\n**Project Support:**\n\n- ⭐ **Give GitHub stars** if this project helps you\n- 🤝 **Share with teammates** and (golang) programming friends\n- 📝 **Write tech blogs** about development tools and workflows - we provide content writing support\n- 🌟 **Join the ecosystem** - committed to supporting open source and the (golang) development scene\n\n**Have Fun Coding with this package!** 🎉🎉🎉\n\n\u003c!-- TEMPLATE (EN) END: STANDARD PROJECT FOOTER --\u003e\n\n---\n\n## GitHub Stars\n\n[![Stargazers](https://starchart.cc/yylego/kratos-static-auth.svg?variant=adaptive)](https://starchart.cc/yylego/kratos-static-auth)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyylego%2Fkratos-static-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyylego%2Fkratos-static-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyylego%2Fkratos-static-auth/lists"}