Skip to content

Commit

Permalink
Merge pull request #33 from mdsol/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
prajon84 authored Aug 25, 2022
2 parents 82bb7ce + a67435e commit c72a26a
Show file tree
Hide file tree
Showing 5 changed files with 327 additions and 276 deletions.
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

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

0 comments on commit c72a26a

Please sign in to comment.