PHPackages                             azaharizaman/nexus-identity-operations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. azaharizaman/nexus-identity-operations

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

azaharizaman/nexus-identity-operations
======================================

Non-operational orchestrator for user lifecycle management - defines interfaces for Identity, Tenant, and AuditLogger operations

v0.1.0-alpha1(2mo ago)02MITPHP ^8.3

Since May 5Compare

[ Source](https://github.com/azaharizaman/nexus-identity-operations)[ Packagist](https://packagist.org/packages/azaharizaman/nexus-identity-operations)[ RSS](/packages/azaharizaman-nexus-identity-operations/feed)WikiDiscussions Synced 3w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Nexus\\IdentityOperations
=========================

[](#nexusidentityoperations)

> **Orchestrator for user lifecycle management**
>
> Coordinates Identity, Tenant, and AuditLogger packages for user lifecycle management.

---

Overview
--------

[](#overview)

The **IdentityOperations** orchestrator is a non-business operational orchestrator that manages user lifecycle operations within the Nexus ERP system. It provides comprehensive user management workflows including onboarding, authentication, permissions, and MFA management.

### Key Capabilities

[](#key-capabilities)

- **User Onboarding** - Create users, assign to tenants, setup permissions, send welcome notifications
- **User Lifecycle** - Activate, suspend, deactivate users with proper audit trails
- **MFA Management** - Enable, verify, disable MFA for users
- **Permission Management** - Assign, revoke, check permissions

### Value to Other Orchestrators

[](#value-to-other-orchestrators)

OrchestratorValue Provided**TenantOperations**Validates tenant has active users**FinanceOperations**Validates user has proper financial permissions**HumanResourceOperations**Manages employee user accounts**SalesOperations**Manages sales user permissions**ProcurementOperations**Manages procurement user permissions**SupplyChainOperations**Manages warehouse user permissions**CRMOperations**Manages CRM user permissions---

Quick Start
-----------

[](#quick-start)

### Example: User Onboarding

[](#example-user-onboarding)

```
use Nexus\IdentityOperations\Coordinators\UserOnboardingCoordinator;
use Nexus\IdentityOperations\DTOs\UserCreateRequest;

$coordinator = $container->get(UserOnboardingCoordinator::class);

$request = new UserCreateRequest(
    email: 'john.doe@example.com',
    password: 'secure-password',
    firstName: 'John',
    lastName: 'Doe',
    tenantId: 'tenant-123',
    roles: ['user'],
    sendWelcomeEmail: true,
);

$result = $coordinator->createUser($request);

if ($result->success) {
    echo "User created: {$result->userId}";
    echo "Tenant assignment: {$result->tenantUserId}";
} else {
    echo "Onboarding failed: {$result->message}";
}
```

### Example: User Lifecycle (Suspend)

[](#example-user-lifecycle-suspend)

```
use Nexus\IdentityOperations\Coordinators\UserLifecycleCoordinator;
use Nexus\IdentityOperations\DTOs\UserSuspendRequest;

$coordinator = $container->get(UserLifecycleCoordinator::class);

$request = new UserSuspendRequest(
    userId: 'user-456',
    suspendedBy: 'admin-789',
    reason: 'Policy violation',
);

$result = $coordinator->suspend($request);

if ($result->success) {
    echo "User suspended: {$result->suspendedAt}";
} else {
    echo "Suspend failed: {$result->message}";
}
```

### Example: MFA Enable

[](#example-mfa-enable)

```
use Nexus\IdentityOperations\Coordinators\MfaCoordinator;
use Nexus\IdentityOperations\DTOs\MfaEnableRequest;

$coordinator = $container->get(MfaCoordinator::class);

$request = new MfaEnableRequest(
    userId: 'user-456',
    method: MfaMethod::TOTP,
);

$result = $coordinator->enable($request);

if ($result->success) {
    echo "MFA enabled, secret: {$result->secret}";
    echo "QR code: {$result->qrCodeUrl}";
}
```

### Example: Permission Assignment

[](#example-permission-assignment)

```
use Nexus\IdentityOperations\Coordinators\UserPermissionCoordinator;
use Nexus\IdentityOperations\DTOs\PermissionAssignRequest;

$coordinator = $container->get(UserPermissionCoordinator::class);

$request = new PermissionAssignRequest(
    userId: 'user-456',
    permission: 'finance.reports.view',
    tenantId: 'tenant-123',
    assignedBy: 'admin-789',
);

$result = $coordinator->assign($request);

if ($result->success) {
    echo "Permission assigned: {$result->permissionId}";
}
```

---

Architecture
------------

[](#architecture)

This orchestrator follows the **Advanced Orchestrator Pattern** with these principles:

1. **Coordinators are Traffic Cops** - Direct flow, don't do work
2. **DataProviders Aggregate** - Cross-package data aggregation
3. **Rules are Composable** - Individual, testable validation classes
4. **Services do Heavy Lifting** - Complex business logic
5. **Strict Contracts** - Always use DTOs

---

Directory Structure
-------------------

[](#directory-structure)

```
src/
├── Coordinators/           # Entry points for operations
├── DataProviders/         # Cross-package data aggregation
├── Rules/                 # Validation constraints
├── Services/              # Complex business logic
├── DTOs/                 # Request/Response objects
├── Contracts/             # Interfaces
└── Exceptions/            # Domain errors

```

---

Available Coordinators
----------------------

[](#available-coordinators)

CoordinatorPurposeKey Operations`UserOnboardingCoordinator`Create new users`createUser()`, `setupInitialPermissions()``UserLifecycleCoordinator`Manage user states`activate()`, `suspend()`, `deactivate()``UserAuthenticationCoordinator`Authenticate users`authenticate()`, `refreshToken()`, `logout()``UserPermissionCoordinator`Manage permissions`assign()`, `revoke()`, `check()``MfaCoordinator`Manage MFA`enable()`, `verify()`, `disable()`---

Installation
------------

[](#installation)

```
composer require azaharizaman/nexus-identity-operations
```

### Dependencies

[](#dependencies)

- `azaharizaman/nexus-identity` - Core user management
- `azaharizaman/nexus-tenant` - Tenant context
- `azaharizaman/nexus-audit-logger` - Audit trail logging
- `azaharizaman/nexus-common` - Common utilities

---

Architecture Layers
-------------------

[](#architecture-layers)

```
┌─────────────────────────────────────────────────────────┐
│                    Adapters (L3)                        │
│   Implements orchestrator interfaces                    │
└─────────────────────────────────────────────────────────┘
                            ▲ implements
┌─────────────────────────────────────────────────────────┐
│              IdentityOperations (L2)                     │
│   - Defines own interfaces in Contracts/                │
│   - Depends only on PSR interfaces                      │
│   - Coordinates multi-package workflows                 │
└─────────────────────────────────────────────────────────┘
                            ▲ uses via interfaces
┌─────────────────────────────────────────────────────────┐
│                Atomic Packages (L1)                      │
│   - Identity, Tenant, AuditLogger                       │
└─────────────────────────────────────────────────────────┘

```

---

Testing
-------

[](#testing)

```
# Unit tests (Rules, Services)
vendor/bin/phpunit tests/Unit

# Integration tests (Coordinators)
vendor/bin/phpunit tests/Integration
```

---

License
-------

[](#license)

MIT License

---

Related Documentation
---------------------

[](#related-documentation)

- [Nexus Architecture Guidelines](../../ARCHITECTURE.md) - System-wide patterns

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance84

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

81d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/117408?v=4)[Azahari Zaman](/maintainers/azaharizaman)[@azaharizaman](https://github.com/azaharizaman)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/azaharizaman-nexus-identity-operations/health.svg)

```
[![Health](https://phpackages.com/badges/azaharizaman-nexus-identity-operations/health.svg)](https://phpackages.com/packages/azaharizaman-nexus-identity-operations)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[symfony/mailer

Helps sending emails

1.6k409.1M1.5k](/packages/symfony-mailer)[web-auth/webauthn-lib

FIDO2/Webauthn Support For PHP

12510.5M141](/packages/web-auth-webauthn-lib)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k13.0M221](/packages/simplesamlphp-simplesamlphp)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

515100.5k3](/packages/web-auth-webauthn-framework)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M425](/packages/drupal-core-recommended)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
