pub struct RadiusConfig {
pub server_addr: String,
pub shared_secret: String,
pub timeout: Duration,
pub retries: u32,
pub nas_identifier: String,
pub accounting_addr: Option<String>,
}Expand description
RADIUS client configuration.
Fields§
§server_addr: StringRADIUS server address (host:port, default port 1812).
Shared secret between client and server.
timeout: DurationRequest timeout.
retries: u32Number of retries on timeout.
nas_identifier: StringNAS-Identifier sent in requests.
accounting_addr: Option<String>Accounting server address (host:port, default port 1813).
Implementations§
Source§impl RadiusConfig
impl RadiusConfig
Sourcepub fn with_server(
server_addr: impl Into<String>,
shared_secret: impl Into<String>,
) -> Result<Self>
pub fn with_server( server_addr: impl Into<String>, shared_secret: impl Into<String>, ) -> Result<Self>
Create a config with the two required fields pre-filled.
All other fields are set to their Default values.
Returns an error if shared_secret is shorter than 6 bytes
(the minimum enforced by RadiusClient::new).
§Example
ⓘ
use auth_framework::protocols::radius::RadiusConfig;
let config = RadiusConfig::with_server("radius.corp:1812", "s3cret-key")?;Trait Implementations§
Source§impl Clone for RadiusConfig
impl Clone for RadiusConfig
Source§fn clone(&self) -> RadiusConfig
fn clone(&self) -> RadiusConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 RadiusConfig
impl Debug for RadiusConfig
Auto Trait Implementations§
impl Freeze for RadiusConfig
impl RefUnwindSafe for RadiusConfig
impl Send for RadiusConfig
impl Sync for RadiusConfig
impl Unpin for RadiusConfig
impl UnsafeUnpin for RadiusConfig
impl UnwindSafe for RadiusConfig
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,
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