replace pgp_enabled by disable_pgp

This commit is contained in:
Son NK 2020-08-06 14:22:28 +02:00
parent 0484fdbb83
commit 2f00294ba3
4 changed files with 7 additions and 5 deletions

View File

@ -965,7 +965,9 @@ If success, 200 with the list of aliases. Each alias has the following fields:
- nb_forward
- nb_reply
- support_pgp: whether an alias can support PGP, i.e. when one of alias's mailboxes supports PGP.
- pgp_enabled: whether the PGP is enabled on this alias. This field should only be used when `support_pgp` is true.
- disable_pgp: whether the PGP is disabled on this alias.
This field should only be used when `support_pgp` is true.
By setting `disable_pgp=true`, a user can explicitly disable PGP on an alias even its mailboxes support PGP.
- mailbox: obsolete, should use `mailboxes` instead.
- id
- email

View File

@ -63,7 +63,7 @@ def serialize_alias_info_v2(alias_info: AliasInfo) -> dict:
for mailbox in alias_info.mailboxes
],
"support_pgp": alias_info.alias.mailbox_support_pgp(),
"pgp_enabled": alias_info.alias.pgp_enabled(),
"disable_pgp": alias_info.alias.disable_pgp,
}
if alias_info.latest_email_log:
email_log = alias_info.latest_email_log

View File

@ -85,7 +85,7 @@ def get_aliases_v2():
- mailbox
- mailboxes
- support_pgp
- pgp_enabled
- disable_pgp
- (optional) latest_activity:
- timestamp
- action: forward|reply|block|bounced

View File

@ -190,8 +190,8 @@ def test_get_aliases_v2(flask_client):
assert "support_pgp" in r0
assert not r0["support_pgp"]
assert "pgp_enabled" in r0
assert not r0["pgp_enabled"]
assert "disable_pgp" in r0
assert not r0["disable_pgp"]
def test_delete_alias(flask_client):