vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

public.rs (891B)


      1 use crate::error::Error;
      2 use rocket::{serde::json::Json, Route};
      3 
      4 pub fn routes() -> Vec<Route> {
      5     routes![ldap_import]
      6 }
      7 
      8 #[derive(Deserialize)]
      9 #[serde(rename_all = "camelCase")]
     10 struct OrgImportGroupData;
     11 
     12 #[derive(Deserialize)]
     13 #[serde(rename_all = "camelCase")]
     14 struct OrgImportUserData {
     15     #[allow(dead_code)]
     16     email: String,
     17     #[allow(dead_code)]
     18     external_id: String,
     19     #[allow(dead_code)]
     20     deleted: bool,
     21 }
     22 
     23 #[derive(Deserialize)]
     24 #[serde(rename_all = "camelCase")]
     25 struct OrgImportData {
     26     #[allow(dead_code)]
     27     members: Vec<OrgImportUserData>,
     28     #[allow(dead_code)]
     29     overwrite_existing: bool,
     30 }
     31 
     32 #[allow(unused_variables, clippy::needless_pass_by_value)]
     33 #[post("/public/organization/import", data = "<data>")]
     34 fn ldap_import(data: Json<OrgImportData>) -> Error {
     35     const MSG: &str = "LDAP import is permanently disabled.";
     36     Error::new(MSG, MSG)
     37 }