Skip to content

Commit

Permalink
Only allow to sign content.json files
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Jul 19, 2017
1 parent 2aba9cc commit b88ee9a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Content/ContentManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,9 @@ def hashFiles(self, dir_inner_path, ignore_pattern=None, optional_pattern=None):
# Create and sign a content.json
# Return: The new content if filewrite = False
def sign(self, inner_path="content.json", privatekey=None, filewrite=True, update_changed_files=False, extend=None, remove_missing_optional=False):
if not inner_path.endswith("content.json"):
raise SignError("Invalid file name, you can only sign content.json files")

if inner_path in self.contents:
content = self.contents.get(inner_path)
if content and content.get("cert_sign", False) is None and self.site.storage.isFile(inner_path):
Expand Down

0 comments on commit b88ee9a

Please sign in to comment.