pub struct Config {
pub endpoint: String,
pub client_id: String,
pub client_secret: String,
pub certificate: String,
pub org_name: String,
pub app_name: Option<String>,
}Expand description
Config is the core configuration.
Fields§
§endpoint: StringCasdoor Server Url, such as http://localhost:8000
client_id: StringClient ID for the Casdoor application
client_secret: StringClient secret for the Casdoor application
certificate: Stringx509 certificate content of Application.cert
org_name: StringThe name for the Casdoor organization
app_name: Option<String>The name for the Casdoor application
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(
endpoint: String,
client_id: String,
client_secret: String,
certificate: String,
org_name: String,
app_name: Option<String>,
) -> Self
pub fn new( endpoint: String, client_id: String, client_secret: String, certificate: String, org_name: String, app_name: Option<String>, ) -> Self
Create a new Config.
Sourcepub fn from_toml(path: &str) -> Result<Self, Box<dyn Error>>
pub fn from_toml(path: &str) -> Result<Self, Box<dyn Error>>
Create a new Config from a Toml file.
pub fn replace_cert_to_pub_key(&self) -> Result<PKey<Public>, ErrorStack>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more