Struct KerberosAuth
pub struct KerberosAuth {
gss_cred: Cred,
ongoing_exchanges: HashMap<String, SpnegoContext>,
}Expand description
Kerberos authentication handler using SPNEGO RFC 4559.
Fields§
§gss_cred: Cred§ongoing_exchanges: HashMap<String, SpnegoContext>Implementations§
§impl KerberosAuth
impl KerberosAuth
pub fn new() -> Result<Self, GCHubRestServerError>
fn get_or_start_gss_ctx(
&mut self,
conn_id: &str,
) -> Result<&mut ServerCtx, SpnegoError>
fn get_or_start_gss_ctx( &mut self, conn_id: &str, ) -> Result<&mut ServerCtx, SpnegoError>
Retrieves an existing GSSAPI context for the connection ID or creates a new one if it doesn’t exist. If the existing context has exceeded the maximum ticket negotiation duration, it is removed and an error is returned.
Sets a cookie in the response with the connection ID
fn create_negotiation_request(
gss_api_data: Option<&[u8]>,
spnego_session_id: Option<String>,
) -> Box<Response>
fn create_negotiation_request( gss_api_data: Option<&[u8]>, spnego_session_id: Option<String>, ) -> Box<Response>
Creates a 401 response with the WWW-Authenticate header set to “Negotiate”. If gss_api_data is not None, it will be encoded in a BASE64 and sent int he negotiate header.
If spnego_session_id is not None, it will be set as a cookie in the response.
fn remove_expired_negotiations(&mut self)
fn remove_expired_negotiations(&mut self)
Removes any negotiations that have expired
fn negotiation_step( &mut self, conn_data: &mut ConnectionToken<'_>, ) -> Result<String, SpnegoError>
pub fn authenticate(&mut self, req: &Request) -> Result<String, Box<Response>>
pub fn authenticate(&mut self, req: &Request) -> Result<String, Box<Response>>
Retrieves a Kerberos principal name upon successful authentication. Otherwise it returns a response that should be sent to the client to continue or restart the negotiation.
Auto Trait Implementations§
impl Freeze for KerberosAuth
impl RefUnwindSafe for KerberosAuth
impl Send for KerberosAuth
impl Sync for KerberosAuth
impl Unpin for KerberosAuth
impl UnwindSafe for KerberosAuth
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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