# wso2-extensions/identity-governance architecture

> Architecture diagram of the GitHub repository wso2-extensions/identity-governance, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wso2-extensions/identity-governance
- Repository: https://github.com/wso2-extensions/identity-governance

## Overview

##### Main System Components

a. Core Governance Components:
- Identity Governance Service (central component)
- User Management
- Password Management
- Account Management
- Recovery Services

b. Security & Validation Layer:
- Captcha Services
- Password Policy Enforcement
- Account Suspension
- Multi-attribute Login

c. Data Storage Layer:
- JDBC Data Stores
- User Identity Stores
- Recovery Data Storage

##### Component Relationships

a. User-Facing Services:
**API Layer (REST) → Service Layer → Core Components → Data Layer**

b. Authentication Flow:
**Multi-attribute Login → Password Validation → Security Checks → User Store**

c. Recovery Flows:
**Recovery Request → Validation → Notification → Recovery Process**

##### Specific Implementation Details

Key components with their relationships:

**Identity Governance Service**
- Password Management
- Password Policy
- Password History
- Password Expiry
- Account Management
- Account Suspension
- Idle Account Detection
- User Rename
- Recovery Management
- Username Recovery
- Password Recovery
- Self Registration
- Security Services
- Captcha
- PII Controller
- Multi-attribute Login

##### Implementation Notes

- RESTful API endpoints for user management
- Security validation flows
- Data persistence paths
- Event listener chains
- Service component relationships

##### Technical Details

Specific implementations:
- OSGI service components
- Event listeners
- Data store implementations
- API endpoints
- Security filters

##### Integration Points

External system connections:
- Identity Providers
- User Stores
- Notification Systems
- Audit Systems

This system design should reflect the modular nature of the project while showing how all components work together to provide a complete identity governance solution.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph API["API Layer"]
        REST[REST Endpoints]
    end

    subgraph Core["Core Governance Components"]
        IGS["Identity Governance Service"]:::core
        UM["User Management"]:::core
        PM["Password Management"]:::core
        AM["Account Management"]:::core
        RS["Recovery Services"]:::core
    end

    subgraph Security["Security & Validation Layer"]
        CS["Captcha Services"]:::security
        PPE["Password Policy Enforcement"]:::security
        AS["Account Suspension"]:::security
        MAL["Multi-attribute Login"]:::security
    end

    subgraph Data["Data Storage Layer"]
        JDBC["JDBC Data Stores"]:::data
        UIS["User Identity Stores"]:::data
        RDS["Recovery Data Storage"]:::data
    end

    subgraph PM_Components["Password Management Components"]
        PP["Password Policy"]:::component
        PH["Password History"]:::component
        PE["Password Expiry"]:::component
    end

    subgraph AM_Components["Account Management Components"]
        ASN["Account Suspension"]:::component
        IAD["Idle Account Detection"]:::component
        UR["User Rename"]:::component
    end

    subgraph RS_Components["Recovery Management Components"]
        UNR["Username Recovery"]:::component
        PWR["Password Recovery"]:::component
        SR["Self Registration"]:::component
    end

    %% Connections
    REST --> IGS
    IGS --> UM
    IGS --> PM
    IGS --> AM
    IGS --> RS

    PM --> PM_Components
    AM --> AM_Components
    RS --> RS_Components

    MAL --> PPE
    PPE --> JDBC
    AS --> UIS
    RS_Components --> RDS

    %% Click Events
    click IGS "https://github.com/wso2-extensions/identity-governance/blob/master/components/org.wso2.carbon.identity.governance/src/main/java/org/wso2/carbon/identity/governance/IdentityGovernanceService.java"
    click PM "https://github.com/wso2-extensions/identity-governance/tree/master/components/org.wso2.carbon.identity.password.policy/"
    click AM "https://github.com/wso2-extensions/identity-governance/tree/master/components/org.wso2.carbon.identity.account.suspension.notification.task/"
    click RS "https://github.com/wso2-extensions/identity-governance/tree/master/components/org.wso2.carbon.identity.recovery/"
    click CS "https://github.com/wso2-extensions/identity-governance/tree/master/components/org.wso2.carbon.identity.captcha/"
    click MAL "https://github.com/wso2-extensions/identity-governance/tree/master/components/org.wso2.carbon.identity.multi.attribute.login/"
    click JDBC "https://github.com/wso2-extensions/identity-governance/blob/master/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/store/JDBCRecoveryDataStore.java"
    click UIS "https://github.com/wso2-extensions/identity-governance/blob/master/components/org.wso2.carbon.identity.governance/src/main/java/org/wso2/carbon/identity/governance/store/UserIdentityDataStore.java"
    click UM "https://github.com/wso2-extensions/identity-governance/tree/master/components/org.wso2.carbon.identity.user.rename.core/"
    click UNR "https://github.com/wso2-extensions/identity-governance/blob/master/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/username/NotificationUsernameRecoveryManager.java"
    click PWR "https://github.com/wso2-extensions/identity-governance/blob/master/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/password/NotificationPasswordRecoveryManager.java"
    click IAD "https://github.com/wso2-extensions/identity-governance/tree/master/components/org.wso2.carbon.identity.idle.account.identification/"

    %% Styles
    classDef core fill:#2374f7,stroke:#000,stroke-width:2px,color:#fff
    classDef security fill:#4CAF50,stroke:#000,stroke-width:2px,color:#fff
    classDef data fill:#FFD700,stroke:#000,stroke-width:2px,color:#000
    classDef component fill:#90A4AE,stroke:#000,stroke-width:2px,color:#fff

    %% Legend
    subgraph Legend
        L1["Core Services"]:::core
        L2["Security Components"]:::security
        L3["Data Stores"]:::data
        L4["Sub Components"]:::component
    end
```
