fixing validation

This commit is contained in:
alwaysjolley 2019-04-22 09:38:44 -04:00
parent 8dccaaf544
commit f9dadb2670

View File

@ -124,11 +124,16 @@ class VaultDestinationPlugin(DestinationPlugin):
san_list = get_san_list(body)
if san_filter:
for san in san_list:
if not re.match(san_filter, san, flags=re.IGNORECASE):
try:
if not re.match(san_filter, san, flags=re.IGNORECASE):
current_app.logger.exception(
"Exception uploading secret to vault: invalid SAN: {}".format(san),
exc_info=True)
os._exit(1)
except re.error:
current_app.logger.exception(
"Exception uploading secret to vault: invalid SAN: {}".format(san),
"Exception compiling regex filter: invalid filter",
exc_info=True)
os._exit(1)
with open(token_file, 'r') as file:
token = file.readline().rstrip('\n')