diff --git a/sat_frontends/jp/cmd_blog.py b/sat_frontends/jp/cmd_blog.py index f739d8b3..6e667aa3 100644 --- a/sat_frontends/jp/cmd_blog.py +++ b/sat_frontends/jp/cmd_blog.py @@ -179,6 +179,12 @@ class BlogPublishCommon(object): action="store_true", help=_("end-to-end encrypt the blog post") ) + self.parser.add_argument( + "--encrypt-for", + metavar="JID", + action="append", + help=_("encrypt a single item for") + ) self.parser.add_argument( "-X", "--sign", @@ -214,6 +220,8 @@ class BlogPublishCommon(object): mb_data["encrypted"] = True if self.args.sign: mb_data["signed"] = True + if self.args.encrypt_for: + mb_data["encrypted_for"] = {"targets": self.args.encrypt_for} class Set(base.CommandBase, BlogPublishCommon): diff --git a/sat_frontends/jp/cmd_pubsub.py b/sat_frontends/jp/cmd_pubsub.py index 8eee4585..e546c68a 100644 --- a/sat_frontends/jp/cmd_pubsub.py +++ b/sat_frontends/jp/cmd_pubsub.py @@ -1229,6 +1229,12 @@ class Set(base.CommandBase): action="store_true", help=_("end-to-end encrypt the blog item") ) + self.parser.add_argument( + "--encrypt-for", + metavar="JID", + action="append", + help=_("encrypt a single item for") + ) self.parser.add_argument( "-X", "--sign", @@ -1249,6 +1255,8 @@ class Set(base.CommandBase): extra = {} if self.args.encrypt: extra["encrypted"] = True + if self.args.encrypt_for: + extra["encrypted_for"] = {"targets": self.args.encrypt_for} if self.args.sign: extra["signed"] = True publish_options = NodeCreate.get_config_options(self.args) @@ -1403,6 +1411,12 @@ class Edit(base.CommandBase, common.BaseEdit): action="store_true", help=_("end-to-end encrypt the blog item") ) + self.parser.add_argument( + "--encrypt-for", + metavar="JID", + action="append", + help=_("encrypt a single item for") + ) self.parser.add_argument( "-X", "--sign", @@ -1414,6 +1428,8 @@ class Edit(base.CommandBase, common.BaseEdit): extra = {} if self.args.encrypt: extra["encrypted"] = True + if self.args.encrypt_for: + extra["encrypted_for"] = {"targets": self.args.encrypt_for} if self.args.sign: extra["signed"] = True published_id = await self.host.bridge.psItemSend(