{"id":24520,"library":"requests-hawk","title":"requests-hawk","description":"A requests authentication plugin that implements the Hawk HTTP authentication scheme (https://github.com/hueniverse/hawk). Provides request signing and verification for HTTP APIs. Current version 1.2.1, last updated 2019. Maintenance mode, no recent releases.","status":"maintenance","version":"1.2.1","language":"python","source_language":"en","source_url":"https://github.com/mozilla-services/requests-hawk","tags":["authentication","hawk","http","requests","security"],"install":[{"cmd":"pip install requests-hawk","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for the Auth class to hook into requests","package":"requests","optional":false},{"reason":"Used internally for Hawk crypto operations","package":"mohawk","optional":false}],"imports":[{"note":"The module itself is not a class; import HawkAuth directly","wrong":"from requests_hawk import requests_hawk","symbol":"requests_hawk","correct":"from requests_hawk import HawkAuth"}],"quickstart":{"code":"import requests\nfrom requests_hawk import HawkAuth\n\nauth = HawkAuth(\n    hawk_credentials={\n        'id': 'my-id',\n        'key': 'my-secret-key',\n        'algorithm': 'sha256'\n    }\n)\nresponse = requests.get('https://example.com/api/resource', auth=auth)\nprint(response.status_code)","lang":"python","description":"Create a HawkAuth instance with credentials and pass it as the 'auth' parameter to requests."},"warnings":[{"fix":"Monitor for vulnerabilities; for new projects, evaluate using the 'mohawk' library with custom requests auth.","message":"Library is in maintenance mode. No active development since 2019. Consider using 'mohawk' directly or 'requests-hawk' as-is.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Always include all three keys to avoid confusion.","message":"The hawk_credentials dict must contain 'id', 'key', and 'algorithm'. 'algorithm' defaults to 'sha256' but is recommended to be explicit.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade to >=1.1.1 or ensure Content-Type is a string.","message":"Content-Type handling changed in v1.1.1 when Content-Type is bytes. Ensure you send headers as strings or use latest version.","severity":"gotcha","affected_versions":"<1.1.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install requests-hawk' and ensure it's in the same Python environment.","cause":"Library not installed or environment issue","error":"ImportError: No module named requests_hawk"},{"fix":"Use 'hawk_credentials' as the parameter name.","cause":"Incorrect argument name; should be 'hawk_credentials' (singular) not 'hawk_credentials'.","error":"TypeError: __init__() got an unexpected keyword argument 'hawk_credentials'"},{"fix":"Ensure requests have a Content-Type header set (e.g., 'Content-Type': 'application/json') when sending data.","cause":"The request has a body but Content-Type is missing or empty; Hawk requires hash for non-empty payloads.","error":"mohawk.exceptions.MissingRequiredAttribute: payload can't be blank when hash is required"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}