2019-10-31 15:00:36 +01:00
|
|
|
use crate::Data;
|
2020-04-09 10:39:34 +02:00
|
|
|
use actix_web::{web, get};
|
2020-04-08 14:13:45 +02:00
|
|
|
use serde::Serialize;
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Default, Serialize)]
|
|
|
|
pub struct KeysResponse {
|
|
|
|
private: Option<String>,
|
|
|
|
public: Option<String>,
|
|
|
|
}
|
2019-10-31 15:00:36 +01:00
|
|
|
|
2020-04-07 19:10:32 +02:00
|
|
|
#[get("/keys")]
|
|
|
|
pub async fn list(
|
|
|
|
data: web::Data<Data>,
|
2020-04-08 14:13:45 +02:00
|
|
|
) -> web::Json<KeysResponse> {
|
|
|
|
let api_keys = data.api_keys.clone();
|
|
|
|
web::Json(KeysResponse{
|
|
|
|
private: api_keys.private,
|
|
|
|
public: api_keys.public,
|
|
|
|
})
|
2019-10-31 15:00:36 +01:00
|
|
|
}
|