commit
0a50b21450
|
@ -964,6 +964,8 @@ If success, 200 with the list of aliases. Each alias has the following fields:
|
||||||
- nb_block
|
- nb_block
|
||||||
- nb_forward
|
- nb_forward
|
||||||
- nb_reply
|
- 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.
|
||||||
- mailbox: obsolete, should use `mailboxes` instead.
|
- mailbox: obsolete, should use `mailboxes` instead.
|
||||||
- id
|
- id
|
||||||
- email
|
- email
|
||||||
|
|
|
@ -62,6 +62,8 @@ def serialize_alias_info_v2(alias_info: AliasInfo) -> dict:
|
||||||
{"id": mailbox.id, "email": mailbox.email}
|
{"id": mailbox.id, "email": mailbox.email}
|
||||||
for mailbox in alias_info.mailboxes
|
for mailbox in alias_info.mailboxes
|
||||||
],
|
],
|
||||||
|
"support_pgp": alias_info.alias.mailbox_support_pgp(),
|
||||||
|
"pgp_enabled": alias_info.alias.pgp_enabled(),
|
||||||
}
|
}
|
||||||
if alias_info.latest_email_log:
|
if alias_info.latest_email_log:
|
||||||
email_log = alias_info.latest_email_log
|
email_log = alias_info.latest_email_log
|
||||||
|
|
|
@ -84,6 +84,8 @@ def get_aliases_v2():
|
||||||
- note
|
- note
|
||||||
- mailbox
|
- mailbox
|
||||||
- mailboxes
|
- mailboxes
|
||||||
|
- support_pgp
|
||||||
|
- pgp_enabled
|
||||||
- (optional) latest_activity:
|
- (optional) latest_activity:
|
||||||
- timestamp
|
- timestamp
|
||||||
- action: forward|reply|block|bounced
|
- action: forward|reply|block|bounced
|
||||||
|
|
|
@ -187,6 +187,12 @@ def test_get_aliases_v2(flask_client):
|
||||||
assert "id" in mailbox
|
assert "id" in mailbox
|
||||||
assert "email" in mailbox
|
assert "email" in mailbox
|
||||||
|
|
||||||
|
assert "support_pgp" in r0
|
||||||
|
assert not r0["support_pgp"]
|
||||||
|
|
||||||
|
assert "pgp_enabled" in r0
|
||||||
|
assert not r0["pgp_enabled"]
|
||||||
|
|
||||||
|
|
||||||
def test_delete_alias(flask_client):
|
def test_delete_alias(flask_client):
|
||||||
user = User.create(
|
user = User.create(
|
||||||
|
|
Loading…
Reference in a new issue