Skip to content

Commit c72a26a

Browse files
authored
Merge pull request #33 from mdsol/develop
2 parents 82bb7ce + a67435e commit c72a26a

File tree

5 files changed

+327
-276
lines changed

5 files changed

+327
-276
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cache: pip
44

55
python:
66
- 3.6
7-
- 3.7
7+
- 3.7.13 # specify micro version to avoid having EnvCommandError
88
- 3.8
99
- 3.9
1010

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.2.3
2+
- Ignore `boto3` import error (`ModuleNotFoundError`).
3+
14
# 1.2.2
25
- Extend the fallback cache TTL to 5 minutes.
36

mauth_client/lambda_helper.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ def generate_mauth():
1212
def _get_private_key():
1313
private_key = Config.PRIVATE_KEY
1414
if RSA_PRIVATE_KEY not in private_key:
15-
import boto3
15+
try:
16+
import boto3
1617

17-
kms_client = boto3.client("kms")
18-
private_key = kms_client.decrypt(CiphertextBlob=b64decode(private_key))["Plaintext"].decode("ascii")
18+
kms_client = boto3.client("kms")
19+
private_key = kms_client.decrypt(CiphertextBlob=b64decode(private_key))["Plaintext"].decode("ascii")
20+
except ModuleNotFoundError:
21+
pass
1922

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

0 commit comments

Comments
 (0)