Skip to content

Commit

Permalink
enforce newlines to destination uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
havron committed Jul 16, 2021
1 parent 45437e6 commit 76b1bb7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lemur/certificates/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
from lemur.utils import Vault


def ensure_newline(s):
if s.endswith('\n'):
return s
return s + '\n'


def get_sequence(name):
if "-" not in name:
return name, None
Expand Down Expand Up @@ -490,9 +496,9 @@ def update_destinations(target, value, initiator):
if target.private_key or not destination_plugin.requires_key:
destination_plugin.upload(
target.name,
target.body,
target.private_key,
target.chain,
ensure_newline(target.body),
ensure_newline(target.private_key),
ensure_newline(target.chain),
value.options,
)
status = SUCCESS_METRIC_STATUS
Expand Down

0 comments on commit 76b1bb7

Please sign in to comment.