WAMI - Who Am I
Multi-cloud Identity and Access Management Library for Rust
Overview
WAMI (Who Am I) is a pure Rust library for Identity and Access Management (IAM), Security Token Service (STS), and Single Sign-On (SSO) operations across multiple cloud providers. Built with a domain-driven design, WAMI separates business logic from storage, making it flexible, testable, and cloud-agnostic.
Key Features:
- 🌐 Multi-cloud Support - AWS, GCP, Azure, and custom identity providers
- 🏗️ Pure Domain Logic - Business logic without storage dependencies
- 💾 Pluggable Storage - In-memory, SQL, NoSQL, or custom backends
- 🏢 Multi-tenant Architecture - Built-in hierarchical tenant isolation
- 🔐 Complete IAM Suite - Users, groups, roles, policies, credentials
- 🔑 Temporary Credentials - STS sessions and role assumption
- 📊 SSO Administration - Permission sets, assignments, and federation
- 🦀 100% Rust - Type-safe, async-first, zero-cost abstractions
- ✅ Well-tested - 402 unit tests with high coverage (all passing)
📚 Documentation
Getting Started
- Getting Started Guide - Step-by-step tutorial for your first WAMI app
- Examples - 23 working examples demonstrating all major features
Core Concepts
- Architecture - Design principles, components, and data flow
- API Reference - Detailed API documentation for all modules
Feature Guides
- IAM Guide - Users, groups, roles, and policies
- STS Guide - Temporary credentials and sessions
- SSO Admin Guide - Permission sets and account assignments
- Multi-tenant Guide - Tenant isolation and hierarchy
Advanced Topics
- Store Implementation - Create custom storage backends
- Multi-cloud Providers - AWS, GCP, Azure provider details
- Permission Checking - Policy evaluation and authorization
- ARN Architecture - Resource naming across providers
Project Information
- Changelog - Version history and release notes
- Multi-cloud Status - Provider implementation status
- Security - Security policies and vulnerability reporting
Quick Start
Installation
Add this to your Cargo.toml:
[]
= "0.8.0"
= { = "1.0", = ["full"] }
Your First Example
use builder;
use InMemoryWamiStore;
use UserStore;
use AwsProvider;
async
Output:
✅ Created user: arn:aws:iam::123456789012:user/engineering/alice
✅ Retrieved: "alice"
See Getting Started Guide for more examples.
🎯 Example Programs
WAMI includes 23 runnable examples demonstrating all major features:
| Category | Examples | Status |
|---|---|---|
| Getting Started | 01-03: Hello World, CRUD, Service Layer | ✅ All Working |
| Multi-Tenancy | 04-08: Tenants, Hierarchy, Quotas, Cross-Tenant Access, Migration | ✅ All Working |
| Multi-Cloud | 09-13: User Sync, Provider Switching, Hybrid Cloud, DR | ✅ All Working |
| Policies & RBAC | 14-17, 23: Policy Basics, Evaluation, RBAC, ABAC, Boundaries | ✅ All Working |
| STS & Federation | 18-20: Session Tokens, Role Assumption, Federation | ✅ All Working |
| SSO & Federation | 21-22: SSO Setup, Identity Providers | ✅ All Working |
Run any example with:
See examples/README.md for complete documentation.
Architecture Overview
WAMI follows a clean 3-layer architecture:
┌─────────────────────────────────────────────────┐
│ Application Layer (Your Code) │
└────────────────────┬────────────────────────────┘
│
┌────────────────────┼────────────────────────────┐
│ Domain Layer │ Pure Functions │
│ │ (wami::*) │
│ • Identity │ No storage dependencies │
│ • Credentials │ Pure business logic │
│ • Policies │ Builders & validators │
│ • STS Sessions │ │
│ • Tenants │ │
└────────────────────┬────────────────────────────┘
│
┌────────────────────┼────────────────────────────┐
│ Storage Layer │ Traits & Implementations │
│ WamiStore │ In-memory, SQL, custom │
│ StsStore │ Pluggable backends │
│ TenantStore │ │
└─────────────────────────────────────────────────┘
Key Benefits:
- ✅ Separation of Concerns - Domain logic independent from storage
- ✅ Testability - Pure functions are easy to test
- ✅ Flexibility - Use any storage backend (memory, SQL, NoSQL)
- ✅ Type Safety - Rust's type system prevents common errors
Read more in Architecture Guide.
Core Features
🔐 Identity Management
use ;
// Create user
let user = build_user;
store.create_user.await?;
// Create group and add user
let group = build_group;
store.create_group.await?;
store.add_user_to_group.await?;
// Create role with trust policy
let role = build_role;
store.create_role.await?;
🔑 Credentials & STS
use access_key;
use session;
// Create access keys
let key = build_access_key;
store.create_access_key.await?;
// Create temporary session
let session = build_session;
store.create_session.await?;
🏢 Multi-tenant Support
use ;
// Create parent tenant
let parent_id = root;
let parent = Tenant ;
store.create_tenant.await?;
// Create child tenant
let child_id = parent_id.child;
let child = Tenant ;
store.create_tenant.await?;
// Query hierarchy
let descendants = store.get_descendants.await?;
Project Structure
wami/
├── src/
│ ├── wami/ # Domain layer (pure functions)
│ │ ├── identity/ # Users, groups, roles
│ │ ├── credentials/ # Access keys, MFA, certificates
│ │ ├── policies/ # IAM policies
│ │ ├── sts/ # Sessions, temporary credentials
│ │ ├── sso_admin/ # SSO configuration
│ │ └── tenant/ # Multi-tenant models
│ │
│ ├── store/ # Storage layer
│ │ ├── traits/ # Storage trait definitions
│ │ └── memory/ # In-memory implementations
│ │
│ ├── provider/ # Cloud provider abstractions
│ │ ├── aws.rs
│ │ ├── gcp.rs
│ │ └── azure.rs
│ │
│ └── error.rs # Error types
│
├── docs/ # 📚 All documentation
├── examples/ # Working code examples
└── tests/ # Integration tests
Testing
Run the full test suite:
WAMI has 376 tests (all passing ✅) covering:
- ✅ Domain logic (pure functions)
- ✅ Store implementations (CRUD, queries, concurrency)
- ✅ Multi-tenant isolation
- ✅ Resource enumeration and downcasting
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Add tests for your changes
- Ensure all tests pass (
cargo test) - Run
cargo clippyandcargo fmt - Submit a pull request
See Contributing Guide for more details.
Roadmap
In Planning
- Policy Condition Keys - 140+ condition keys and 91 operators for fine-grained access control (Summary)
Future Enhancements
- SQL store implementations (PostgreSQL, MySQL)
- Advanced policy evaluation engine
- Identity Provider Support - SAML and OIDC federation (✅ Completed in v0.8.0)
- Audit logging and compliance
- Service/orchestration layer
See Issues Tracker for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Security
Found a security issue? Please see Security Policy for reporting guidelines.
Links
- Documentation - Complete documentation index
- Crates.io - Published crate
- Docs.rs - API documentation
- GitHub - Source code
- Issues - Bug reports and feature requests