Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cache: pip

python:
- 3.6
- 3.7
- 3.7.13 # specify micro version to avoid having EnvCommandError
- 3.8
- 3.9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does travis support 3.10 yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it supports but I just wanted to focus on ignoring the import error in this PR.


Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.2.3
- Ignore `boto3` import error (`ModuleNotFoundError`).

# 1.2.2
- Extend the fallback cache TTL to 5 minutes.

Expand Down
9 changes: 6 additions & 3 deletions mauth_client/lambda_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ def generate_mauth():
def _get_private_key():
private_key = Config.PRIVATE_KEY
if RSA_PRIVATE_KEY not in private_key:
import boto3
try:
import boto3

kms_client = boto3.client("kms")
private_key = kms_client.decrypt(CiphertextBlob=b64decode(private_key))["Plaintext"].decode("ascii")
kms_client = boto3.client("kms")
private_key = kms_client.decrypt(CiphertextBlob=b64decode(private_key))["Plaintext"].decode("ascii")
except ModuleNotFoundError:
pass

return private_key.replace(" ", "\n").replace("\nRSA\nPRIVATE\nKEY", " RSA PRIVATE KEY")
Loading