{"id":24824,"library":"warrant","title":"Warrant","description":"Python class to integrate Boto3's Cognito client so it is easy to login users. With SRP support. Current version: 0.6.1. Release cadence is irregular; no longer actively maintained.","status":"maintenance","version":"0.6.1","language":"python","source_language":"en","source_url":"https://github.com/capless/warrant","tags":["cognito","aws","authentication","srp"],"install":[{"cmd":"pip install warrant","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required for Cognito client integration","package":"boto3","optional":false}],"imports":[{"note":"The module was refactored; direct import from warrant is correct.","wrong":"from warrant.aws_cognito import Cognito","symbol":"Cognito","correct":"from warrant import Cognito"}],"quickstart":{"code":"import os\nfrom warrant import Cognito\n\nuser_pool_id = os.environ.get('USER_POOL_ID', '')\nclient_id = os.environ.get('CLIENT_ID', '')\n\nif not user_pool_id or not client_id:\n    print('Set USER_POOL_ID and CLIENT_ID environment variables')\nelse:\n    u = Cognito(user_pool_id, client_id)\n    print('Cognito client created successfully')","lang":"python","description":"Initialize Cognito client with user pool ID and client ID."},"warnings":[{"fix":"Migrate to python-cognito (pip install python-cognito) or use boto3.client('cognitoidp').","message":"Warrant 0.6.1 is the last release; the project is in maintenance mode with no active development. Consider using python-cognito or direct boto3/cognitoidp calls for new projects.","severity":"deprecated","affected_versions":">=0.6.1"},{"fix":"Always pass pool_region='us-east-1' (or your region) to Cognito constructor.","message":"The 'pool_region' parameter is required when instantiating Cognito if the default region is not set via AWS environment variables. Omitting it may lead to region-related errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure your Cognito user pool app client settings align with the new token verification (e.g., correct access token validation).","message":"In version 0.6.0, the token verification logic changed. Tokens generated with older versions may fail verification after upgrade.","severity":"breaking","affected_versions":">=0.6.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from warrant import Cognito' instead of 'import warrant; warrant.Cognito'.","cause":"Import path changed; using wrong import statement.","error":"AttributeError: module 'warrant' has no attribute 'Cognito'"},{"fix":"Pass pool_region='your-region' to Cognito constructor or set AWS_DEFAULT_REGION environment variable.","cause":"The pool_region parameter was not passed and AWS region is not set via environment.","error":"botocore.exceptions.NoRegionError: You must specify a region."},{"fix":"Call u.authenticate() first, then u.id_token is available.","cause":"Trying to access id_token before authentication is complete.","error":"KeyError: 'IdToken'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}