{"id":20607273,"url":"https://github.com/ds5105119/webtool","last_synced_at":"2026-03-04T03:31:07.123Z","repository":{"id":262413458,"uuid":"887151545","full_name":"ds5105119/webtool","owner":"ds5105119","description":"Well-Architected Python library for JWT authentication, throttling, caching, logging, and utilities.","archived":false,"fork":false,"pushed_at":"2025-11-20T20:12:53.000Z","size":1674,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-09T09:27:19.953Z","etag":null,"topics":["cache","fastapi","jwt","msgpack","starlette","throttle"],"latest_commit_sha":null,"homepage":"https://ds5105119.github.io/webtool/","language":"Python","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/ds5105119.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":"SECURITY.md","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":"2024-11-12T08:58:55.000Z","updated_at":"2025-06-11T16:58:41.000Z","dependencies_parsed_at":"2024-11-27T16:20:58.469Z","dependency_job_id":"58a2660c-e409-41b4-891a-58f5b0f86812","html_url":"https://github.com/ds5105119/webtool","commit_stats":null,"previous_names":["ds5105119/webtool"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/ds5105119/webtool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ds5105119%2Fwebtool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ds5105119%2Fwebtool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ds5105119%2Fwebtool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ds5105119%2Fwebtool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ds5105119","download_url":"https://codeload.github.com/ds5105119/webtool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ds5105119%2Fwebtool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30070744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T03:25:38.285Z","status":"ssl_error","status_checked_at":"2026-03-04T03:25:05.086Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cache","fastapi","jwt","msgpack","starlette","throttle"],"created_at":"2024-11-16T10:06:11.911Z","updated_at":"2026-03-04T03:31:07.087Z","avatar_url":"https://github.com/ds5105119.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebTool(Alpha)\n\u003cimg src=\"https://github.com/ds5105119/webtool/workflows/CI/badge.svg\"\u003e\n\nWell-Architected FastAPI/Starlette library for JWT authentication, throttling, caching, logging, and utilities.\n\n## Requirements\n\n- Python 3.11+\n\n## Installation\n\n```shell\npip install webtool\n```\n\n```shell\npoetry add webtool\n```\n\n## Features\n\n### Authentication\nJWT token management system with Redis-backed refresh tokens.\n\n```python\nfrom webtool.auth import JWTService\nfrom webtool.cache import RedisCache\n\ncache_client = RedisCache(\"redis://localhost:6379/0\")\njwt_service = JWTService(cache_client)\n\n\nasync def get_token():\n    access, refresh = jwt_service.create_token({\"sub\": 123, \"scope\": [\"write\"]})\n    return access, refresh\n```\n\n### Throttling\nRate limiting system for FastAPI/Starlette applications.\n\n```python\nfrom fastapi import FastAPI\nfrom starlette.middleware import Middleware\nfrom webtool.auth import JWTService\nfrom webtool.cache import RedisCache\nfrom webtool.throttle import limiter, LimitMiddleware, JWTBackend\n\ncache = RedisCache(\"redis://127.0.0.1:6379/0\")\njwt_backend = JWTBackend(JWTService(cache, secret_key=\"test\"))\n\napp = FastAPI(\n    middleware=[\n        Middleware(\n            LimitMiddleware,\n            cache=cache,\n            auth_backend=jwt_backend,\n        ),\n    ],\n)\n\n\n@app.get(\"/api/resource\")\n@limiter(max_requests=50, interval=3600, scopes=[\"user\"])\n@limiter(max_requests=10, interval=3600, scopes=[\"anno\"])\nasync def get_resource():\n    return {\"status\": \"success\"}\n```\n\n### MsgPack Response\nMessagePack-based response.\n\n```python\nfrom webtool.utils import MsgSpecJSONResponse\nfrom fastapi import FastAPI\n\napp = FastAPI(\n    default_response_class=MsgSpecJSONResponse,\n)\n\n\n@app.get(\"/api/resource\")\nasync def get_resource():\n    return {\"status\": \"success\"}\n```\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fds5105119%2Fwebtool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fds5105119%2Fwebtool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fds5105119%2Fwebtool/lists"}