1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! # gamlastan::core
//!
//! Core SAML 2.0 types, constants, and identifiers for the gamlastan library.
//!
//! This module provides the foundational data types used by all other modules:
//! assertions, protocol messages, constants, entity IDs, SAML IDs, status codes,
//! NameID formats, and time helpers.
//!
//! ## Borrowed and Owned Types
//!
//! Most parsed XML types follow a dual-type pattern:
//!
//! - `FooRef<'a>` borrows strings and child values from the parsed XML document;
//! - `Foo` owns its data and is suitable for construction, storage, and
//! crossing async/thread/lifetime boundaries;
//! - `FooRef::to_owned()` converts from borrowed to owned.
//!
//! Prefer borrowed types when immediately validating or inspecting incoming XML.
//! Prefer owned types when constructing messages or storing parsed data.
//!
//! ## Example: Construct a NameID and Attribute
//!
//! ```
//! use gamlastan::core::assertion::attribute::{Attribute, AttributeValue};
//! use gamlastan::core::assertion::name_id::NameId;
//! use gamlastan::core::constants::{ATTRNAME_FORMAT_URI, NAMEID_PERSISTENT};
//!
//! let name_id = NameId {
//! value: "opaque-id".to_string(),
//! format: Some(NAMEID_PERSISTENT.to_string()),
//! name_qualifier: Some("https://idp.example.org/metadata".to_string()),
//! sp_name_qualifier: Some("https://sp.example.org/metadata".to_string()),
//! sp_provided_id: None,
//! };
//!
//! let attr = Attribute {
//! name: "urn:oid:0.9.2342.19200300.100.1.3".to_string(),
//! name_format: Some(ATTRNAME_FORMAT_URI.to_string()),
//! friendly_name: Some("mail".to_string()),
//! values: vec![AttributeValue::String("alice@example.org".to_string())],
//! };
//!
//! assert_eq!(name_id.format.as_deref(), Some(NAMEID_PERSISTENT));
//! assert_eq!(attr.friendly_name.as_deref(), Some("mail"));
//! ```
//!
//! ## Modules
//!
//! - [`namespace`] - All SAML/XML namespace URI constants
//! - [`constants`] - Binding URIs, NameID formats, status codes, authn context classes
//! - [`identifiers`] - EntityId, SamlId, SamlVersion
//! - [`time`] - DateTime wrappers and validity window helpers
//! - [`assertion`] - SAML assertion types (NameId, Subject, Conditions, Statements, etc.)
//! - [`protocol`] - SAML protocol types (AuthnRequest, Response, Status, LogoutRequest, etc.)
//! - [`error`] - Core error types
// Re-export commonly used types at crate root for convenience.
pub use CoreError;
pub use ;
pub use ;