in aws_msk_iam_sasl_signer/MSKAuthTokenProvider.py [0:0]
def generate_auth_token(region, aws_debug_creds=False):
"""
Generates an base64-encoded signed url as auth token to authenticate
with an Amazon MSK cluster using default IAM credentials.
Args:
region (str): The AWS region where the cluster is located.
Returns:
str: A base64-encoded authorization token.
"""
# Load credentials
aws_credentials = __load_default_credentials__()
if aws_debug_creds and logging.getLogger().isEnabledFor(logging.DEBUG):
__log_caller_identity(aws_credentials)
return __construct_auth_token(region, aws_credentials)