Skip to content

Commit ebd729e

Browse files
Ignore boto3 import error
1 parent 0711017 commit ebd729e

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
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

Lines changed: 6 additions & 3 deletions
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")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "mauth-client"
3-
version = "1.2.2"
3+
version = "1.2.3"
44
description = "MAuth Client for Python"
55
repository = "https://github.com/mdsol/mauth-client-python"
66
authors = ["Medidata Solutions <support@mdsol.com>"]

0 commit comments

Comments
 (0)