{"id":27811,"library":"ghga-service-commons","title":"GHGA Service Commons","description":"A library providing common functionality for GHGA services, including FastAPI utilities, authentication, config management, and custom HTTPX transports (caching, retry, rate limiting). Current version: 7.0.1. Requires Python >=3.10. Release cadence: irregular, with breaking changes in major versions (6.0.0, 7.0.0).","status":"active","version":"7.0.1","language":"python","source_language":"en","source_url":"https://github.com/ghga-de/ghga-service-commons","tags":["ghga","fastapi","httpx","authentication","health-check","transport","rate-limiting","retry"],"install":[{"cmd":"pip install ghga-service-commons","lang":"bash","label":"default"},{"cmd":"pip install ghga-service-commons[transports]","lang":"bash","label":"with transports support"}],"dependencies":[{"reason":"core web framework dependency","package":"fastapi","optional":false},{"reason":"HTTP client for transports","package":"httpx","optional":false},{"reason":"caching support (transports extra)","package":"hishel","optional":true}],"imports":[{"note":"wrong module path","wrong":"from ghga_service_commons.utils.health import HealthEndpointConfig","symbol":"HealthEndpointConfig","correct":"from ghga_service_commons.utils.health_check import HealthEndpointConfig"},{"note":"AuthContext is in the context submodule","wrong":"from ghga_service_commons.auth import AuthContext","symbol":"AuthContext","correct":"from ghga_service_commons.auth.context import AuthContext"},{"note":"","wrong":"","symbol":"CompositeRetryAndRateLimitTransport","correct":"from ghga_service_commons.transports import CompositeRetryAndRateLimitTransport"}],"quickstart":{"code":"import os\nfrom ghga_service_commons.utils.health_check import HealthEndpointConfig\nfrom ghga_service_commons.auth.context import AuthContext\n\n# Example: configure health endpoint\nconfig = HealthEndpointConfig()\nprint(f\"Health endpoint configured: {config}\")\n\n# Example: create an auth context\n# (requires GHGA credentials or use environment variable)\nauth = AuthContext()\nprint(f\"Auth context: {auth}\")","lang":"python","description":"Basic usage: health endpoint configuration and auth context creation."},"warnings":[{"fix":"Review your FastAPI error handling: expect 401 instead of 403 for auth failures. If using caching, check Hishel compatibility.","message":"Version 7.0.0 introduced potentially breaking changes: FastAPI now returns 401 instead of 403 for missing authentication. Also Hishel was upgraded to a stable version, removing some caching features.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"See the migration guide in the GitHub release notes for 6.0.0.","message":"Version 6.0.0 introduced changes to the transport layer. CompositeRetryAndRateLimitTransport and other custom transports may require updated instantiation patterns.","severity":"breaking","affected_versions":">=6.0.0 <7.0.0"},{"fix":"Add the 'transports' extra to your dependency.","message":"The transports subpackage requires the optional dependency 'transports' extra. Install with 'pip install ghga-service-commons[transports]'.","severity":"gotcha","affected_versions":">=5.3.0"},{"fix":"Update imports to the correct submodules.","message":"Old import paths like 'ghga_service_commons.utils.health' are deprecated. Use 'ghga_service_commons.utils.health_check' instead.","severity":"deprecated","affected_versions":">=6.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use: from ghga_service_commons.utils.health_check import HealthEndpointConfig","cause":"Incorrect import path for health check utilities.","error":"ModuleNotFoundError: No module named 'ghga_service_commons.utils.health'"},{"fix":"Install the 'transports' extra: pip install ghga-service-commons[transports]","cause":"The transports subpackage is only available with the optional dependency.","error":"AttributeError: module 'ghga_service_commons' has no attribute 'transports'"},{"fix":"Use: from ghga_service_commons.transports import CompositeRetryAndRateLimitTransport","cause":"Wrong import path for transport classes.","error":"ImportError: cannot import name 'CompositeRetryAndRateLimitTransport' from 'ghga_service_commons'"},{"fix":"Update your client code to handle 401 status codes instead of 403.","cause":"FastAPI behavior changed due to an update; the library now respects 401.","error":"FastAPI returning 403 instead of 401 for unauthenticated requests (after upgrade to 7.0.0)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}