pub struct AuthConfig {
pub endpoint: String,
pub client_id: String,
pub client_secret: String,
pub certificate: String,
pub organization_name: String,
pub application_name: String,
}Expand description
AuthConfig is the core configuration of the SDK, it has the same fields as the
AuthConfig struct of the Casdoor Go SDK.
The organization_name and application_name fields can also be written as
org_name and app_name in a TOML file, so that the config files of the 1.x
versions of this SDK keep working.
Fields§
§endpoint: StringCasdoor server URL, such as http://localhost:8000.
client_id: StringClient ID of the Casdoor application.
client_secret: StringClient secret of the Casdoor application.
certificate: StringThe x509 certificate content of the Casdoor application, it’s only used by
crate::Client::parse_jwt_token().
organization_name: StringThe name of the Casdoor organization.
application_name: StringThe name of the Casdoor application.
Implementations§
Source§impl AuthConfig
impl AuthConfig
Sourcepub fn new(
endpoint: impl Into<String>,
client_id: impl Into<String>,
client_secret: impl Into<String>,
certificate: impl Into<String>,
organization_name: impl Into<String>,
application_name: impl Into<String>,
) -> Self
pub fn new( endpoint: impl Into<String>, client_id: impl Into<String>, client_secret: impl Into<String>, certificate: impl Into<String>, organization_name: impl Into<String>, application_name: impl Into<String>, ) -> Self
Create a new AuthConfig.
Sourcepub fn from_toml(path: &str) -> Result<Self>
pub fn from_toml(path: &str) -> Result<Self>
Create a new AuthConfig from a TOML file, the path should be an absolute path.
endpoint = "http://localhost:8000"
client_id = "0e5b3fdbc2ba7b04a000"
client_secret = "1b5b3fdbc2ba7b04a0000f5b3fdbc2ba7b04a000"
certificate = """
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
"""
organization_name = "built-in"
application_name = "app-built-in"Trait Implementations§
Source§impl Clone for AuthConfig
impl Clone for AuthConfig
Source§impl Debug for AuthConfig
impl Debug for AuthConfig
Source§impl Default for AuthConfig
impl Default for AuthConfig
Source§impl<'de> Deserialize<'de> for AuthConfig
impl<'de> Deserialize<'de> for AuthConfig
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
impl Eq for AuthConfig
Source§impl PartialEq for AuthConfig
impl PartialEq for AuthConfig
Source§impl Serialize for AuthConfig
impl Serialize for AuthConfig
impl StructuralPartialEq for AuthConfig
Auto Trait Implementations§
impl Freeze for AuthConfig
impl RefUnwindSafe for AuthConfig
impl Send for AuthConfig
impl Sync for AuthConfig
impl Unpin for AuthConfig
impl UnsafeUnpin for AuthConfig
impl UnwindSafe for AuthConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.