changeset 3937:5980ea188f87

cli (blog): add `--encrypt` argument on publication commands to e2ee a blog post: rel 380
author Goffi <goffi@goffi.org>
date Sat, 15 Oct 2022 20:37:00 +0200
parents ebe45ea2df3b
children 6939594ba77e
files sat_frontends/jp/cmd_blog.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_blog.py	Sat Oct 15 20:37:00 2022 +0200
+++ b/sat_frontends/jp/cmd_blog.py	Sat Oct 15 20:37:00 2022 +0200
@@ -173,6 +173,12 @@
             "--syntax",
             help=_("syntax to use (default: get profile's default syntax)"),
         )
+        self.parser.add_argument(
+            "-e",
+            "--encrypt",
+            action="store_true",
+            help=_("end-to-end encrypt the blog item")
+        )
 
     async def setMbDataContent(self, content, mb_data):
         if self.default_syntax_used:
@@ -198,6 +204,8 @@
             mb_data["title"] = self.args.title
         if self.args.language is not None:
             mb_data["language"] = self.args.language
+        if self.args.encrypt:
+            mb_data["encrypted"] = True
 
 
 class Set(base.CommandBase, BlogPublishCommon):