mirror of
https://gitlab.com/hagrid-keyserver/hagrid.git
synced 2023-02-13 20:55:02 -05:00
parent
a2d38fceb5
commit
de91be2b31
5 changed files with 24 additions and 5 deletions
|
@ -102,6 +102,14 @@ Retrieves the key with the given *User ID*. Only exact matches are
|
||||||
accepted. Lookup by *User ID* requires opt-in by the key's owner.
|
accepted. Lookup by *User ID* requires opt-in by the key's owner.
|
||||||
The returned key is *ASCII Armored*.
|
The returned key is *ASCII Armored*.
|
||||||
|
|
||||||
|
#### `POST /vks/v1/publish`
|
||||||
|
|
||||||
|
Keys may be submitted using a POST request to `/vks/v1/publish`, the
|
||||||
|
body of the request being a `multipart/form-data` query. `keytext`
|
||||||
|
must be the keys to submit, either *ASCII Armored* or not. More than
|
||||||
|
one key may be submitted in one request. Hagrid will send
|
||||||
|
verification emails to every non-expired *User ID*.
|
||||||
|
|
||||||
Building
|
Building
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|
11
dist/templates/apidoc.html.hbs
vendored
11
dist/templates/apidoc.html.hbs
vendored
|
@ -37,6 +37,17 @@
|
||||||
by the key's owner. The returned key is <em>ASCII Armored</em>.
|
by the key's owner. The returned key is <em>ASCII Armored</em>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h4><code>POST /vks/v1/publish</code></h4>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Keys may be submitted using a POST request
|
||||||
|
to <code>/vks/v1/publish</code>, the body of the request being
|
||||||
|
a <code>multipart/form-data</code> query. <code>keytext</code>
|
||||||
|
must be the keys to submit, either <em>ASCII Armored</em> or not.
|
||||||
|
More than one key may be submitted in one request. Hagrid will
|
||||||
|
send verification emails to every non-expired <em>User ID</em>.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h3>HPK interface</h3>
|
<h3>HPK interface</h3>
|
||||||
<p>
|
<p>
|
||||||
Hagrid implements a subset of
|
Hagrid implements a subset of
|
||||||
|
|
2
dist/templates/publish.html.hbs
vendored
2
dist/templates/publish.html.hbs
vendored
|
@ -2,7 +2,7 @@
|
||||||
<p>After uploading your key we will send a verification link to each email address we find inside. Clicking that link will make your key searchable by that email address.</p>
|
<p>After uploading your key we will send a verification link to each email address we find inside. Clicking that link will make your key searchable by that email address.</p>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<form action="/publish" method="POST" enctype="multipart/form-data">
|
<form action="/vks/v1/publish" method="POST" enctype="multipart/form-data">
|
||||||
<div class="upload">
|
<div class="upload">
|
||||||
<input type="hidden" name="csrf" value="{{csrf}}" />
|
<input type="hidden" name="csrf" value="{{csrf}}" />
|
||||||
<input type="file" id="keytext" name="keytext" autofocus class="fileUpload" placeholder="Your public key"/>
|
<input type="file" id="keytext" name="keytext" autofocus class="fileUpload" placeholder="Your public key"/>
|
||||||
|
|
|
@ -434,12 +434,12 @@ fn rocket_factory(rocket: rocket::Rocket) -> Result<rocket::Rocket> {
|
||||||
vks_v1_by_email,
|
vks_v1_by_email,
|
||||||
vks_v1_by_fingerprint,
|
vks_v1_by_fingerprint,
|
||||||
vks_v1_by_keyid,
|
vks_v1_by_keyid,
|
||||||
|
upload::vks_v1_publish_post,
|
||||||
// User interaction.
|
// User interaction.
|
||||||
delete,
|
delete,
|
||||||
delete_post,
|
delete_post,
|
||||||
delete_confirm,
|
delete_confirm,
|
||||||
upload::publish,
|
upload::publish,
|
||||||
upload::publish_post,
|
|
||||||
publish_verify,
|
publish_verify,
|
||||||
// HKP
|
// HKP
|
||||||
hkp::pks_lookup,
|
hkp::pks_lookup,
|
||||||
|
@ -904,7 +904,7 @@ pub mod tests {
|
||||||
body.extend_from_slice(header);
|
body.extend_from_slice(header);
|
||||||
body.extend_from_slice(data);
|
body.extend_from_slice(data);
|
||||||
body.extend_from_slice(footer);
|
body.extend_from_slice(footer);
|
||||||
let response = client.post("/publish")
|
let response = client.post("/vks/v1/publish")
|
||||||
.header(ct)
|
.header(ct)
|
||||||
.body(&body[..])
|
.body(&body[..])
|
||||||
.dispatch();
|
.dispatch();
|
||||||
|
|
|
@ -36,8 +36,8 @@ pub fn publish() -> MyResponse {
|
||||||
MyResponse::ok("publish", context)
|
MyResponse::ok("publish", context)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[post("/publish", data = "<data>")]
|
#[post("/vks/v1/publish", data = "<data>")]
|
||||||
pub fn publish_post(
|
pub fn vks_v1_publish_post(
|
||||||
db: rocket::State<Polymorphic>, cont_type: &ContentType, data: Data,
|
db: rocket::State<Polymorphic>, cont_type: &ContentType, data: Data,
|
||||||
mail_service: rocket::State<mail::Service>, state: rocket::State<State>,
|
mail_service: rocket::State<mail::Service>, state: rocket::State<State>,
|
||||||
) -> MyResponse {
|
) -> MyResponse {
|
||||||
|
|
Loading…
Reference in a new issue