pub struct AuthorityConfig {
pub jwt_secret: String,
pub ignore_urls: HashSet<String>,
pub token_header: String,
}Expand description
权限中间件配置
Fields§
§jwt_secret: StringJWT 密钥
ignore_urls: HashSet<String>忽略 Token 验证的 URL
token_header: StringToken Header 名称
Implementations§
Source§impl AuthorityConfig
impl AuthorityConfig
pub fn new(jwt_secret: impl Into<String>) -> Self
Sourcepub fn ignore_url(self, url: impl Into<String>) -> Self
pub fn ignore_url(self, url: impl Into<String>) -> Self
添加忽略的 URL
Sourcepub fn ignore_urls<I, S>(self, urls: I) -> Self
pub fn ignore_urls<I, S>(self, urls: I) -> Self
批量添加忽略的 URL
Trait Implementations§
Source§impl Clone for AuthorityConfig
impl Clone for AuthorityConfig
Source§fn clone(&self) -> AuthorityConfig
fn clone(&self) -> AuthorityConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuthorityConfig
impl Debug for AuthorityConfig
Auto Trait Implementations§
impl Freeze for AuthorityConfig
impl RefUnwindSafe for AuthorityConfig
impl Send for AuthorityConfig
impl Sync for AuthorityConfig
impl Unpin for AuthorityConfig
impl UnsafeUnpin for AuthorityConfig
impl UnwindSafe for AuthorityConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more