parent
8e26926a56
commit
01b179830d
@ -5,11 +5,14 @@ use serde::de::DeserializeOwned;
|
||||
use log::info;
|
||||
|
||||
pub const CFG_FILE_EXTENSION: &str = ".toml";
|
||||
|
||||
/*
|
||||
// To include DocServer as part of higher Application Definition
|
||||
pub trait AppDef {
|
||||
fn app_def<T>(&mut self, root_path: String ); // -> T;
|
||||
}
|
||||
*/
|
||||
pub trait FromFile {
|
||||
// To use with global AppDef root path
|
||||
fn fix_root_path<T>(&mut self, root_path: String ); // -> T;
|
||||
}
|
||||
pub fn load_from_file<'a, T: FromFile + DeserializeOwned>(file_cfg: &str, name: &str) -> Result<T> {
|
||||
@ -41,6 +44,8 @@ pub fn load_from_file<'a, T: FromFile + DeserializeOwned>(file_cfg: &str, name:
|
||||
}
|
||||
|
||||
pub trait DictFromFile {
|
||||
#![allow(dead_code)]
|
||||
// To include DocServer as part of Full Dictionaries Definition
|
||||
fn fix_root_path<T>(&mut self, root_path: String ); // -> T;
|
||||
}
|
||||
pub fn load_dict_from_file<'a, T: DictFromFile + DeserializeOwned>(file_cfg: &str, name: &str) -> Result<HashMap<String,T>> {
|
||||
@ -66,8 +71,8 @@ pub fn load_dict_from_file<'a, T: DictFromFile + DeserializeOwned>(file_cfg: &st
|
||||
},
|
||||
Err(e) => {
|
||||
return Err(Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("Error loading {} {}: {}",name,&file_path,e)
|
||||
ErrorKind::InvalidInput,
|
||||
format!("Error loading {} {}: {}",name,&file_path,e)
|
||||
))
|
||||
},
|
||||
};
|
||||
|
@ -86,10 +86,12 @@ pub struct OpenidConf {
|
||||
pub signup_application: String,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
// To include DocServer as part of Full Dictionaries Definition
|
||||
pub struct OpenidCli {
|
||||
pub client: CoreClient,
|
||||
pub pk_challenge: PkceCodeChallenge,
|
||||
pub pk_verifier: PkceCodeVerifier,
|
||||
pub client: CoreClient,
|
||||
pub pk_challenge: PkceCodeChallenge,
|
||||
pub pk_verifier: PkceCodeVerifier,
|
||||
}
|
||||
pub struct OpenidClient {
|
||||
pub url: Url,
|
||||
|
@ -34,6 +34,8 @@ use super::{CLAIM_UID, CLAIM_AUTH, CLAIM_APP_KEY};
|
||||
pub struct ReqHandler<'a> {
|
||||
pub req_header: ReqHeaderMap,
|
||||
pub app_dbs: &'a AppDBs,
|
||||
// To include DocServer as part of Full Dictionaries Definition
|
||||
#[allow(dead_code)]
|
||||
pub lang: Local,
|
||||
pub uri: &'a Uri,
|
||||
pub auth_state: AuthState,
|
||||
|
@ -22,6 +22,7 @@ use crate::defs::{
|
||||
|
||||
pub struct ReqHeaderMap {
|
||||
pub header: HeaderMap,
|
||||
#[allow(dead_code)]
|
||||
pub req_path: Vec<String>,
|
||||
pub app_connect_info: AppConnectInfo,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user