mirror of
https://github.com/simple-login/app.git
synced 2025-02-24 07:43:54 +08:00
commit
0a50b21450
4 changed files with 12 additions and 0 deletions
|
@ -964,6 +964,8 @@ If success, 200 with the list of aliases. Each alias has the following fields:
|
|||
- nb_block
|
||||
- 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.
|
||||
- mailbox: obsolete, should use `mailboxes` instead.
|
||||
- id
|
||||
- email
|
||||
|
|
|
@ -62,6 +62,8 @@ def serialize_alias_info_v2(alias_info: AliasInfo) -> dict:
|
|||
{"id": mailbox.id, "email": mailbox.email}
|
||||
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:
|
||||
email_log = alias_info.latest_email_log
|
||||
|
|
|
@ -84,6 +84,8 @@ def get_aliases_v2():
|
|||
- note
|
||||
- mailbox
|
||||
- mailboxes
|
||||
- support_pgp
|
||||
- pgp_enabled
|
||||
- (optional) latest_activity:
|
||||
- timestamp
|
||||
- action: forward|reply|block|bounced
|
||||
|
|
|
@ -187,6 +187,12 @@ def test_get_aliases_v2(flask_client):
|
|||
assert "id" 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):
|
||||
user = User.create(
|
||||
|
|
Loading…
Reference in a new issue