parent
7d115714a2
commit
f3aa4e45a4
|
@ -5,6 +5,22 @@
|
|||
<title>Please confirm deletion of your key</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href='https://{{ domain }}/vks/v1/confirm/{{ token }}'>Click here</a> to confirm deleting your key.
|
||||
<p>
|
||||
Someone, presumably you, requested that your key will no longer
|
||||
be available when searching for you email addresses on
|
||||
<a href="https://{{domain}}">{{domain}}</a>.
|
||||
</p>
|
||||
<p>
|
||||
If it was not you, please ignore this email.
|
||||
</p>
|
||||
<p>
|
||||
To de-list your key on {{domain}}, follow this link:
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://{{domain}}/vks/v1/confirm/{{token}}">https://{{domain}}/vks/v1/confirm/{{token}}</a>
|
||||
</p>
|
||||
<p>
|
||||
If you do not want to de-list your key, please ignore this
|
||||
email.
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1 +1,10 @@
|
|||
Click here: https://{{ domain }}/vks/v1/confirm/{{ token }} to confirm deleting of your key.
|
||||
Someone, presumably you, requested that your key will no longer be
|
||||
available when searching for you email addresses on {{domain}}.
|
||||
|
||||
If it was not you, please ignore this email.
|
||||
|
||||
To de-list your key on {{domain}}, follow this link:
|
||||
|
||||
https://{{domain}}/vks/v1/confirm/{{token}}
|
||||
|
||||
If you do not want to de-list your key, please ignore this email.
|
||||
|
|
|
@ -5,6 +5,28 @@
|
|||
<title>Please verify your email address</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href='https://{{ domain }}/vks/v1/verify/{{ token }}'>Click here</a> to verify {{ address }}
|
||||
<p>
|
||||
Someone, presumably you, has uploaded a key
|
||||
to <a href="https://{{domain}}">{{domain}}</a>. The key has the
|
||||
following fingerprint:
|
||||
</p>
|
||||
<p>
|
||||
<pre>{{primary_fp}}</pre>
|
||||
</p>
|
||||
<p>
|
||||
If it was not you, or this is not your key, please ignore this
|
||||
email.
|
||||
</p>
|
||||
<p>
|
||||
To make your key available when searching for "{{userid}}" on
|
||||
{{domain}}, follow this link:
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://{{domain}}/vks/v1/verify/{{token}}">https://{{domain}}/vks/v1/verify/{{token}}</a>
|
||||
</p>
|
||||
<p>
|
||||
If you don't want to make the key available when searching for
|
||||
"{{userid}}", please ignore this email.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1 +1,14 @@
|
|||
Click here: https://{{ domain }}/vks/v1/verify/{{ token }} to verify {{ address }}
|
||||
Someone, presumably you, has uploaded a key to {{domain}}.
|
||||
The key has the following fingerprint:
|
||||
|
||||
{{primary_fp}}
|
||||
|
||||
If it was not you, or this is not your key, please ignore this email.
|
||||
|
||||
To make your key available when searching for "{{userid}}" on
|
||||
{{domain}}, follow this link:
|
||||
|
||||
https://{{domain}}/vks/v1/verify/{{token}}
|
||||
|
||||
If you don't want to make the key available when searching for
|
||||
"{{userid}}", please ignore this email.
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
{{#> layout }}
|
||||
<h2>Verify Ok</h2>
|
||||
<h2>Email verification required</h2>
|
||||
<p>
|
||||
We have sent verification emails to the following addresses:
|
||||
<ul>
|
||||
{{#each emails}}
|
||||
<li>{{this}}</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
To make the keys available when searching by address, you need to
|
||||
follow the link sent to each address.
|
||||
</p>
|
||||
{{/layout}}
|
||||
|
|
|
@ -6,12 +6,15 @@ use lettre_email::EmailBuilder;
|
|||
|
||||
use serde::Serialize;
|
||||
|
||||
use sequoia_openpgp as openpgp;
|
||||
|
||||
use database::types::Email;
|
||||
use Result;
|
||||
|
||||
mod context {
|
||||
#[derive(Serialize, Clone)]
|
||||
pub struct Verification {
|
||||
pub primary_fp: String,
|
||||
pub token: String,
|
||||
pub userid: String,
|
||||
pub domain: String,
|
||||
|
@ -56,9 +59,11 @@ impl Service {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn send_verification(&self, userid: &Email, token: &str, domain: &str)
|
||||
pub fn send_verification(&self, tpk: &openpgp::TPK, userid: &Email,
|
||||
token: &str, domain: &str)
|
||||
-> Result<()> {
|
||||
let ctx = context::Verification {
|
||||
primary_fp: tpk.fingerprint().to_string(),
|
||||
token: token.to_string(),
|
||||
userid: userid.to_string(),
|
||||
domain: domain.to_string(),
|
||||
|
|
|
@ -1065,7 +1065,7 @@ mod tests {
|
|||
|
||||
fn check_mails_and_confirm(client: &Client, filemail_path: &Path) {
|
||||
let confirm_re =
|
||||
regex::bytes::Regex::new("https://domain(/vks/v1/verify[^ \t]*)")
|
||||
regex::bytes::Regex::new("https://domain(/vks/v1/verify[^ \t\n]*)")
|
||||
.unwrap();
|
||||
let confirm_mail = pop_mail(filemail_path).unwrap().unwrap();
|
||||
let confirm_bytes = confirm_mail.message();
|
||||
|
|
|
@ -210,6 +210,7 @@ where
|
|||
if let Some(ref mail_service) = mail_service {
|
||||
for (email, token) in tokens {
|
||||
mail_service.send_verification(
|
||||
&tpk,
|
||||
&email,
|
||||
&token,
|
||||
domain,
|
||||
|
|
Loading…
Reference in New Issue