Skip to main content

Pending

Struct Pending 

Source
pub struct Pending<Message>
where Message: PendingMessage,
{ /* private fields */ }
Expand description

Pending SAML message correlation state.

Implementations§

Source§

impl<Message> Pending<Message>
where Message: PendingMessage,

Source

pub fn with_issue_instant(self, issued_at: SamlInstant) -> Pending<Message>

Record an issue instant.

Source

pub fn with_expiration(self, expires_at: SamlInstant) -> Pending<Message>

Record an expiration instant.

Source

pub fn id(&self) -> &MessageId

SAML protocol message ID.

Source

pub fn relay_state(&self) -> &RelayStateParam

RelayState state.

Source

pub fn peer_entity_id(&self) -> &EntityId

Peer entity ID.

Source

pub fn issued_at(&self) -> Option<&SamlInstant>

Issue instant, if recorded.

Source

pub fn expires_at(&self) -> Option<&SamlInstant>

Expiration instant, if recorded.

Source§

impl Pending<AuthnRequest>

Source

pub fn try_new( request_id: MessageId, relay_state: RelayStateParam, acs: AcsEndpoint, response_binding: SsoResponseBinding, idp_entity_id: EntityId, ) -> Result<Pending<AuthnRequest>, SamlError>

Create pending AuthnRequest state without storing keys or metadata.

§Errors

Returns SamlError::Invalid when the RelayState state is malformed, the IdP entity ID is empty, or the selected ACS binding does not match the expected response binding.

Source

pub fn with_request_binding( self, request_binding: SsoRequestBinding, ) -> Pending<AuthnRequest>

Record the outbound AuthnRequest binding selected for dispatch.

Source

pub fn from_snapshot( snapshot: PendingSnapshot<AuthnRequest>, ) -> Result<Pending<AuthnRequest>, SamlError>

Reconstruct pending AuthnRequest state from a snapshot.

§Errors

Returns SamlError when any snapshot field is malformed or inconsistent.

§Examples
use saml_rs::{AuthnRequest, Pending, PendingSnapshot, RelayStateParam};

let snapshot = PendingSnapshot::<AuthnRequest>::authn_request(
    "_request123",
    RelayStateParam::absent(),
    "https://idp.example.com/metadata",
    "post",
    "https://sp.example.com/acs",
    "post",
);
let pending = Pending::<AuthnRequest>::from_snapshot(snapshot)?;

assert_eq!(pending.idp_entity_id().as_str(), "https://idp.example.com/metadata");
Source

pub fn snapshot(&self) -> PendingSnapshot<AuthnRequest>

Build a persistable snapshot.

Source

pub fn request_id(&self) -> &MessageId

Request ID.

Source

pub fn request_binding(&self) -> Option<SsoRequestBinding>

Request binding, when tracked.

Source

pub fn response_binding(&self) -> SsoResponseBinding

Expected response binding.

Source

pub fn acs(&self) -> &AcsEndpoint

Selected ACS endpoint.

Source

pub fn idp_entity_id(&self) -> &EntityId

Selected IdP entity ID.

Source§

impl Pending<LogoutRequest>

Source

pub fn try_new( request_id: MessageId, relay_state: RelayStateParam, binding: LogoutBinding, peer_entity_id: EntityId, ) -> Result<Pending<LogoutRequest>, SamlError>

Create pending LogoutRequest state without storing keys or metadata.

§Errors

Returns SamlError::Invalid when RelayState or peer entity ID are malformed.

Source

pub fn from_snapshot( snapshot: PendingSnapshot<LogoutRequest>, ) -> Result<Pending<LogoutRequest>, SamlError>

Reconstruct pending LogoutRequest state from a snapshot.

AuthnRequest-only ACS snapshot fields are ignored.

§Errors

Returns SamlError when any snapshot field is malformed or inconsistent.

§Examples
use saml_rs::{LogoutBinding, LogoutRequest, Pending, PendingSnapshot, RelayStateParam};

let snapshot = PendingSnapshot::<LogoutRequest>::logout_request(
    "_logout123",
    RelayStateParam::absent(),
    "https://idp.example.com/metadata",
    LogoutBinding::Post,
);
let pending = Pending::<LogoutRequest>::from_snapshot(snapshot)?;

assert_eq!(pending.peer_entity_id().as_str(), "https://idp.example.com/metadata");
Source

pub fn snapshot(&self) -> PendingSnapshot<LogoutRequest>

Build a persistable snapshot.

Source

pub fn request_binding(&self) -> LogoutBinding

Logout request binding selected for dispatch.

Source

pub fn response_binding(&self) -> LogoutBinding

Expected logout response binding.

Trait Implementations§

Source§

impl<Message> Clone for Pending<Message>
where Message: Clone + PendingMessage, <Message as PendingMessage>::Details: Clone,

Source§

fn clone(&self) -> Pending<Message>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Message> Debug for Pending<Message>
where Message: Debug + PendingMessage, <Message as PendingMessage>::Details: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<Message> Eq for Pending<Message>
where Message: Eq + PendingMessage, <Message as PendingMessage>::Details: Eq,

Source§

impl<Message> PartialEq for Pending<Message>
where Message: PartialEq + PendingMessage, <Message as PendingMessage>::Details: PartialEq,

Source§

fn eq(&self, other: &Pending<Message>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<Message> StructuralPartialEq for Pending<Message>
where Message: PartialEq + PendingMessage, <Message as PendingMessage>::Details: PartialEq,

Auto Trait Implementations§

§

impl<Message> Freeze for Pending<Message>
where <Message as PendingMessage>::Details: Freeze,

§

impl<Message> RefUnwindSafe for Pending<Message>
where <Message as PendingMessage>::Details: RefUnwindSafe, Message: RefUnwindSafe,

§

impl<Message> Send for Pending<Message>
where <Message as PendingMessage>::Details: Send, Message: Send,

§

impl<Message> Sync for Pending<Message>
where <Message as PendingMessage>::Details: Sync, Message: Sync,

§

impl<Message> Unpin for Pending<Message>
where <Message as PendingMessage>::Details: Unpin, Message: Unpin,

§

impl<Message> UnsafeUnpin for Pending<Message>
where <Message as PendingMessage>::Details: UnsafeUnpin,

§

impl<Message> UnwindSafe for Pending<Message>
where <Message as PendingMessage>::Details: UnwindSafe, Message: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V