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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! SCIM 2.0 server library for Rust.
//!
//! A modern, type-safe implementation of the SCIM 2.0 protocol with clean architecture,
//! multi-tenant support, and pluggable storage backends.
//!
//! # Core Architecture
//!
//! This library follows a clean, layered architecture:
//!
//! - **SCIM Protocol Layer**: [`ScimServer`] handles SCIM HTTP operations
//! - **Resource Layer**: [`Resource`] provides type-safe resource representation
//! - **Storage Layer**: [`ResourceProvider`] trait for pluggable backends
//! - **Schema Layer**: [`Schema`] definitions with validation
//! - **Multi-tenancy**: Built-in support via [`TenantContext`]
//!
//! # Quick Start
//!
//! ```rust,no_run
//! use scim_server::ScimServer;
//! use scim_server::providers::StandardResourceProvider;
//! use scim_server::storage::InMemoryStorage;
//! use std::sync::Arc;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! // 1. Set up storage and provider
//! let storage = InMemoryStorage::new();
//! let provider = StandardResourceProvider::new(storage);
//!
//! // 2. Create SCIM server
//! let server = ScimServer::new(provider)?;
//!
//! // 3. Server is ready for HTTP integration
//! # Ok(())
//! # }
//! ```
//!
//! # Key Features
//!
//! - **Type Safety**: Value objects with compile-time validation
//! - **Multi-tenant**: Full tenant isolation with configurable strategies
//! - **Async First**: Built on async/await for high performance
//! - **Pluggable Storage**: Bring your own database via [`ResourceProvider`]
//! - **Schema Validation**: Automatic validation against SCIM schemas
//! - **Version Control**: ETag-based optimistic concurrency control
//! - **Extensible**: Support for custom schemas and value objects
//!
//! # Architecture Overview
//!
//! ```text
//! ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
//! │ HTTP Layer │───▶│ ScimServer │───▶│ Operation │
//! │ (Axum/etc) │ │ (Protocol) │ │ Handler │
//! └─────────────────┘ └──────────────────┘ └─────────────────┘
//! │ │
//! ▼ ▼
//! ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
//! │ Schema │ │ Resource │ │ ResourceProvider│
//! │ Validation │ │ (Value Objects) │ │ (Storage) │
//! └─────────────────┘ └──────────────────┘ └─────────────────┘
//! ```
/// Model Context Protocol integration for AI agents.
///
/// This module is only available when the `mcp` feature is enabled.
/// Add `features = ["mcp"]` to your Cargo.toml dependency to use this module.
// Re-export commonly used types for convenience
pub use ;
pub use ResourceProvider;
pub use ;
pub use ;
pub use ;
pub use SchemaDiscovery;
pub use ;
// Re-export additional types needed by examples and advanced usage
pub use ;
pub use ;
pub use ;
pub use AuthenticationScheme;
// Multi-tenant types
pub use ;
// MCP integration re-exports (feature-gated)
/// Model Context Protocol integration types.
///
/// These types are only available when the `mcp` feature is enabled.
/// Add `features = ["mcp"]` to your Cargo.toml dependency to use these types.
pub use ;