Skip to content

Commit 45f7e63

Browse files
author
J Plasmeier
committed
fix static analysis issues
1 parent 7207a27 commit 45f7e63

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/src/custom_kms_client_for_kms_provider.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
"""Example showing how to customize the AWS KMS Client."""
14+
import boto3
15+
1416
import aws_encryption_sdk
1517
from aws_encryption_sdk import CommitmentPolicy
16-
import boto3
18+
1719

1820
# Create a new class that extends the AWS KMS Provider you need to use
1921
class CustomKMSClientMasterKeyProvider(aws_encryption_sdk.StrictAwsKmsMasterKeyProvider):
22+
"""Custom region-specific client which extends the StrictAwsKmsMasterKeyProvider"""
2023

2124
# Override `add_regional_client` to use whatever configuration you need
2225
def add_regional_client(self, region_name):
@@ -35,6 +38,7 @@ def add_regional_client(self, region_name):
3538
self._register_client(client, region_name)
3639
self._regional_clients[region_name] = client
3740

41+
3842
# This is just an example of using the above master key provider
3943
def encrypt_decrypt(key_arn, source_plaintext, botocore_session=None):
4044
"""Encrypts and then decrypts a string under one KMS customer master key (CMK).
@@ -71,4 +75,3 @@ def encrypt_decrypt(key_arn, source_plaintext, botocore_session=None):
7175
pair in encrypted_message_header.encryption_context.items()
7276
for pair in decrypted_message_header.encryption_context.items()
7377
)
74-

0 commit comments

Comments
 (0)