Restrict addition of signatures
Sending an email to the primary userID to select which signatures to add when new signatures are uploaded.
This commit is contained in:
@@ -53,12 +53,13 @@ class Email {
|
||||
* @param {Object} template the email template function to use
|
||||
* @param {Object} userId recipient user id object: { name:'Jon Smith', email:'j@smith.com', publicKeyArmored:'...' }
|
||||
* @param {string} keyId key id of public key
|
||||
* @param {Object} data data used by template
|
||||
* @param {Object} origin origin of the server
|
||||
* @yield {Object} reponse object containing SMTP info
|
||||
*/
|
||||
async send({template, userId, keyId, origin, publicKeyArmored}) {
|
||||
async send({template, userId, keyId, data, origin, publicKeyArmored}) {
|
||||
const compiled = template({
|
||||
...userId,
|
||||
...data,
|
||||
origin,
|
||||
keyId
|
||||
});
|
||||
|
||||
@@ -18,4 +18,12 @@ function verifyRemove(ctx, {name, email, nonce, origin, keyId}) {
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {verifyKey, verifyRemove};
|
||||
function confirmNewSigs(ctx, {name, sigsNb, nonce, origin, keyId}) {
|
||||
const link = `${util.url(origin)}/api/v1/key?op=confirmSignatures&keyId=${keyId}&nonce=${nonce}`;
|
||||
return {
|
||||
subject: ctx.__('confirm_signatures_subject'),
|
||||
text: ctx.__('confirm_signatures_text', [name, sigsNb, link, origin.host])
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {verifyKey, verifyRemove, confirmNewSigs};
|
||||
|
||||
Reference in New Issue
Block a user