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,
impl<Message> Pending<Message>where
Message: PendingMessage,
Sourcepub fn with_issue_instant(self, issued_at: SamlInstant) -> Pending<Message>
pub fn with_issue_instant(self, issued_at: SamlInstant) -> Pending<Message>
Record an issue instant.
Sourcepub fn with_expiration(self, expires_at: SamlInstant) -> Pending<Message>
pub fn with_expiration(self, expires_at: SamlInstant) -> Pending<Message>
Record an expiration instant.
Sourcepub fn relay_state(&self) -> &RelayStateParam
pub fn relay_state(&self) -> &RelayStateParam
RelayState state.
Sourcepub fn peer_entity_id(&self) -> &EntityId
pub fn peer_entity_id(&self) -> &EntityId
Peer entity ID.
Sourcepub fn issued_at(&self) -> Option<&SamlInstant>
pub fn issued_at(&self) -> Option<&SamlInstant>
Issue instant, if recorded.
Sourcepub fn expires_at(&self) -> Option<&SamlInstant>
pub fn expires_at(&self) -> Option<&SamlInstant>
Expiration instant, if recorded.
Source§impl Pending<AuthnRequest>
impl Pending<AuthnRequest>
Sourcepub fn try_new(
request_id: MessageId,
relay_state: RelayStateParam,
acs: AcsEndpoint,
response_binding: SsoResponseBinding,
idp_entity_id: EntityId,
) -> Result<Pending<AuthnRequest>, SamlError>
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.
Sourcepub fn with_request_binding(
self,
request_binding: SsoRequestBinding,
) -> Pending<AuthnRequest>
pub fn with_request_binding( self, request_binding: SsoRequestBinding, ) -> Pending<AuthnRequest>
Record the outbound AuthnRequest binding selected for dispatch.
Sourcepub fn from_snapshot(
snapshot: PendingSnapshot<AuthnRequest>,
) -> Result<Pending<AuthnRequest>, SamlError>
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");Sourcepub fn snapshot(&self) -> PendingSnapshot<AuthnRequest>
pub fn snapshot(&self) -> PendingSnapshot<AuthnRequest>
Build a persistable snapshot.
Sourcepub fn request_id(&self) -> &MessageId
pub fn request_id(&self) -> &MessageId
Request ID.
Sourcepub fn request_binding(&self) -> Option<SsoRequestBinding>
pub fn request_binding(&self) -> Option<SsoRequestBinding>
Request binding, when tracked.
Sourcepub fn response_binding(&self) -> SsoResponseBinding
pub fn response_binding(&self) -> SsoResponseBinding
Expected response binding.
Sourcepub fn acs(&self) -> &AcsEndpoint
pub fn acs(&self) -> &AcsEndpoint
Selected ACS endpoint.
Sourcepub fn idp_entity_id(&self) -> &EntityId
pub fn idp_entity_id(&self) -> &EntityId
Selected IdP entity ID.
Source§impl Pending<LogoutRequest>
impl Pending<LogoutRequest>
Sourcepub fn try_new(
request_id: MessageId,
relay_state: RelayStateParam,
binding: LogoutBinding,
peer_entity_id: EntityId,
) -> Result<Pending<LogoutRequest>, SamlError>
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.
Sourcepub fn from_snapshot(
snapshot: PendingSnapshot<LogoutRequest>,
) -> Result<Pending<LogoutRequest>, SamlError>
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");Sourcepub fn snapshot(&self) -> PendingSnapshot<LogoutRequest>
pub fn snapshot(&self) -> PendingSnapshot<LogoutRequest>
Build a persistable snapshot.
Sourcepub fn request_binding(&self) -> LogoutBinding
pub fn request_binding(&self) -> LogoutBinding
Logout request binding selected for dispatch.
Sourcepub fn response_binding(&self) -> LogoutBinding
pub fn response_binding(&self) -> LogoutBinding
Expected logout response binding.