summaryrefslogtreecommitdiff
path: root/server/src/api_model.rs
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2025-01-27 22:57:15 +0100
committerJoel Klinghed <the_jk@spawned.biz>2025-01-27 22:57:15 +0100
commit9d14d9ca39b46042c4196382613dd9c4bf711fcb (patch)
treea01c21f158b43cea3aea67e90530e49cd061cd11 /server/src/api_model.rs
parent59035c4532110a9fec8309bbda55d8ba6d14ce94 (diff)
Add user keys to database
Next step is to generate authorized_keys files for git server based on keys.
Diffstat (limited to 'server/src/api_model.rs')
-rw-r--r--server/src/api_model.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/server/src/api_model.rs b/server/src/api_model.rs
index 2dc20f1..f062935 100644
--- a/server/src/api_model.rs
+++ b/server/src/api_model.rs
@@ -201,3 +201,38 @@ pub struct StatusResponse {
)]
pub error: Option<&'static str>,
}
+
+#[derive(Debug, Deserialize, PartialEq, Serialize, ToSchema)]
+pub struct UserKey {
+ #[schema(example = 1u64)]
+ pub id: u64,
+ #[schema(example = "ssh-rsa")]
+ pub kind: String,
+ #[schema(example = "AAAAfoobar==")]
+ pub data: String,
+ #[schema(example = "user@host 1970-01-01")]
+ pub comment: String,
+}
+
+#[derive(Deserialize, Serialize, ToSchema)]
+pub struct UserKeyData<'r> {
+ #[schema(example = "ssh-rsa")]
+ pub kind: &'r str,
+ #[schema(example = "AAAAfoobar==")]
+ pub data: &'r str,
+ #[schema(example = "user@host 1970-01-01")]
+ pub comment: Option<&'r str>,
+}
+
+#[derive(Deserialize, Serialize, ToSchema)]
+pub struct UserKeys {
+ #[schema(example = 0u32)]
+ pub offset: u32,
+ #[schema(example = 10u32)]
+ pub limit: u32,
+ #[schema(example = 2u32)]
+ pub total_count: u32,
+ #[schema(example = false)]
+ pub more: bool,
+ pub keys: Vec<UserKey>,
+}