capless / warrant

Python library for using AWS Cognito. With support for SRP.
Apache License 2.0
468 stars 192 forks source link

Improve specifying pool region #40

Closed polendri closed 7 years ago

polendri commented 7 years ago

The current logic in Cognito is causing user_pool_region to be ignored except when access_key and secret_key are specified. This is unintuitive; if region is specified, it should always override environment/config settings.

AWSSRP also has no region parameter, so if you do not provide a full Boto3 client to it it's unable to specify a pool region. I added a parameter for this and a check to ensure it's not used simultaneously with the client parameter (since they're mutually exclusive).

The tests are failing due to the Travis test environment, as far as I can tell; I verified that AWS_DEFAULT_REGION is not set in the test environment, so boto3 is throwing NoRegionError for everything.