hkp: more informative /pks/add response

This commit is contained in:
Vincent Breitmoser 2019-06-20 18:15:16 +02:00
parent e6611228a7
commit 84451500ec
No known key found for this signature in database
GPG Key ID: 7BD18320DEADFA11
2 changed files with 6 additions and 2 deletions

View File

@ -53,7 +53,7 @@
</li>
</ul>
<h3>Uploading your key</h3>
<h3 id="gnupg-upload">Uploading your key</h3>
<p>
Keys can be uploaded with GnuPG's <tt>--send-keys</tt> command, but
identity information can't be verified that way to make the key

View File

@ -128,13 +128,17 @@ pub fn pks_add_form_data(
#[post("/pks/add", format = "application/x-www-form-urlencoded", data = "<data>")]
pub fn pks_add_form(
state: rocket::State<HagridState>,
db: rocket::State<KeyDatabase>,
tokens_stateless: rocket::State<tokens::Service>,
rate_limiter: rocket::State<RateLimiter>,
data: Data,
) -> MyResponse {
match vks_web::upload_post_form(db, tokens_stateless, rate_limiter, data) {
Ok(_) => MyResponse::plain("Ok".into()),
Ok(_) => {
let msg = format!("Upload successful. Note that identity information will only be published with verification! see {}/about/usage#gnupg-upload", state.base_uri);
MyResponse::plain(msg)
}
Err(err) => MyResponse::ise(err),
}
}