Include unique set of UID emails on key representations
This commit is contained in:
parent
a4675b821a
commit
1ea90a5dbb
2 changed files with 6 additions and 0 deletions
|
@ -3185,6 +3185,10 @@ components:
|
|||
type: array
|
||||
items:
|
||||
type: string
|
||||
ids_emails:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Email'
|
||||
master_fpr:
|
||||
type: string
|
||||
revoked:
|
||||
|
|
|
@ -18,11 +18,13 @@ def key_representation(key):
|
|||
"master_fpr": key.fpr,
|
||||
"revoked": key.revoked != 0,
|
||||
"ids": [],
|
||||
"ids_emails": {},
|
||||
"subkeys": []
|
||||
}
|
||||
|
||||
now = datetime.datetime.utcnow()
|
||||
key_rep["ids"] = [ id.uid for id in key.uids ]
|
||||
key_rep["ids_emails"] = list({ id.email for id in key.uids }) # No duplicate email addresses in this list
|
||||
key_rep["subkeys"] = [{
|
||||
"master": skey.fpr == key.fpr,
|
||||
"sign": skey.can_sign == 1,
|
||||
|
|
Loading…
Reference in a new issue