comparison sat_frontends/jp/cmd_blog.py @ 3973:570254d5a798

cli (blog, pubsub): encryption argument for Pubsub Targeted Encryption: add a new `--encrypt-for` argument to `blog/set` `blog/edit` `pubsub/set` and `pubsub/edit` rel 382
author Goffi <goffi@goffi.org>
date Mon, 31 Oct 2022 13:48:01 +0100
parents e2a5f2f5e57b
children 4941cd102f93
comparison
equal deleted inserted replaced
3972:5fbdf986670c 3973:570254d5a798
178 "--encrypt", 178 "--encrypt",
179 action="store_true", 179 action="store_true",
180 help=_("end-to-end encrypt the blog post") 180 help=_("end-to-end encrypt the blog post")
181 ) 181 )
182 self.parser.add_argument( 182 self.parser.add_argument(
183 "--encrypt-for",
184 metavar="JID",
185 action="append",
186 help=_("encrypt a single item for")
187 )
188 self.parser.add_argument(
183 "-X", 189 "-X",
184 "--sign", 190 "--sign",
185 action="store_true", 191 action="store_true",
186 help=_("cryptographically sign the blog post") 192 help=_("cryptographically sign the blog post")
187 ) 193 )
212 mb_data["language"] = self.args.language 218 mb_data["language"] = self.args.language
213 if self.args.encrypt: 219 if self.args.encrypt:
214 mb_data["encrypted"] = True 220 mb_data["encrypted"] = True
215 if self.args.sign: 221 if self.args.sign:
216 mb_data["signed"] = True 222 mb_data["signed"] = True
223 if self.args.encrypt_for:
224 mb_data["encrypted_for"] = {"targets": self.args.encrypt_for}
217 225
218 226
219 class Set(base.CommandBase, BlogPublishCommon): 227 class Set(base.CommandBase, BlogPublishCommon):
220 def __init__(self, host): 228 def __init__(self, host):
221 base.CommandBase.__init__( 229 base.CommandBase.__init__(